Patch level : 12.00 1370

Files correlati     : xvaga.dll
Bug                 :

Commento:
La cartella dei file temporanei può essere personalizzata mettento nella variablie Temp di conf.ini %Study
This commit is contained in:
Alessandro Bonazzi 2025-02-07 23:34:15 +01:00
parent cada1f1fa9
commit 383a6f7d36

View File

@ -300,7 +300,7 @@ DRAW_CTOOLS* xvt_app_get_default_ctools(DRAW_CTOOLS *ct)
void xvt_app_process_pending_events(void) void xvt_app_process_pending_events(void)
{ {
wxApp* a = wxTheApp; // Memorizzo il risultato di wxGetInstance wxApp* a = wxTheApp; // Memorizzo il risultato di wxGetInstance
if (a != NULL) // Puo' succedere! if (a != nullptr) // Puo' succedere!
{ {
while (a->Pending()) while (a->Pending())
a->Dispatch(); a->Dispatch();
@ -1626,7 +1626,22 @@ BOOLEAN xvt_fsys_get_curr_dir(DIRECTORY *dirp)
void xvt_fsys_get_temp_dir(DIRECTORY *dirp) void xvt_fsys_get_temp_dir(DIRECTORY *dirp)
{ {
xvt_sys_get_profile_string(NULL, "Main", "Temp", "", dirp->path, sizeof(dirp->path)); xvt_sys_get_profile_string(NULL, "Main", "Temp", "", dirp->path, sizeof(dirp->path));
if (!*dirp->path)
wxString work_dirp(dirp->path);
work_dirp.MakeUpper();
const int pos = work_dirp.Find("%STUDY");
if (pos >= 0)
{
char wrk[_MAX_PATH]; xvt_sys_get_profile_string(NULL, "Main", "Study", "", wrk, sizeof(wrk));
strcat_s(wrk, dirp->path + pos + 7);
dirp->path[pos] = '\0';
strcat_s(dirp->path, wrk);
}
if (!*dirp->path)
wxStrcpy(dirp->path, wxFileName::GetTempDir()); wxStrcpy(dirp->path, wxFileName::GetTempDir());
} }
@ -1974,17 +1989,17 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
wxInputStream* input = NULL; wxInputStream* input = NULL;
if (orig_url.HasScheme()) if (orig_url.HasScheme())
{ {
if (orig_url.GetScheme() == "ftp") if (orig_url.GetScheme() == "ftp")
{ {
wxFTP& ftp = *wxStaticCast(&orig_url.GetProtocol(), wxFTP); wxFTP& ftp = *wxStaticCast(&orig_url.GetProtocol(), wxFTP);
ftp.SetPassive(xvt_sys_ftp_passive_mode(orig_url.GetServer())); ftp.SetPassive(xvt_sys_ftp_passive_mode(orig_url.GetServer()));
} }
input = orig_url.GetInputStream(); input = orig_url.GetInputStream();
} }
else else
input = new wxFileInputStream(orig); input = new wxFileInputStream(orig);
if (input == NULL) if (input == NULL)
return FALSE; return FALSE;
@ -1994,23 +2009,23 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
if (scheme == "ftp") if (scheme == "ftp")
{ {
wxFTP ftp; wxFTP ftp;
const wxString strHost = dest_url.GetServer(); const wxString strHost = dest_url.GetServer();
const wxString strUser = dest_url.GetUser(); const wxString strUser = dest_url.GetUser();
const wxString strPwd = dest_url.GetPassword(); const wxString strPwd = dest_url.GetPassword();
const wxFileName fnPath = dest_url.GetPath(); const wxFileName fnPath = dest_url.GetPath();
const wxString fnDir = fnPath.GetPath(wxPATH_GET_VOLUME, wxPATH_UNIX); const wxString fnDir = fnPath.GetPath(wxPATH_GET_VOLUME, wxPATH_UNIX);
const wxString fnName = fnPath.GetFullName(); const wxString fnName = fnPath.GetFullName();
if (!strUser.IsEmpty()) if (!strUser.IsEmpty())
{ {
ftp.SetUser(strUser); ftp.SetUser(strUser);
ftp.SetPassword(strPwd); ftp.SetPassword(strPwd);
} }
ftp.SetPassive(xvt_sys_ftp_passive_mode(strHost)); ftp.SetPassive(xvt_sys_ftp_passive_mode(strHost));
if (ftp.Connect(strHost) && ftp.SetBinary() && ftp.ChDir(fnDir)) if (ftp.Connect(strHost) && ftp.SetBinary() && ftp.ChDir(fnDir))
output = ftp.GetOutputStream(fnName); output = ftp.GetOutputStream(fnName);
} }
else else
{ {
@ -2030,6 +2045,7 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
http.SetPassword(strPwd); http.SetPassword(strPwd);
} }
http.SetHeader(_T("Content-type"), _T("application/x-www-form-urlencoded")); //remember to define “Content-type: application/x-www-form-urlencoded”, or remote server cant get your posted data. http.SetHeader(_T("Content-type"), _T("application/x-www-form-urlencoded")); //remember to define “Content-type: application/x-www-form-urlencoded”, or remote server cant get your posted data.
wxString PostData("postdata="); wxString PostData("postdata=");
PostData << fnPath.GetFullPath(); PostData << fnPath.GetFullPath();
@ -2040,24 +2056,25 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
wxInputStream *httpStream = http.GetInputStream(_T("/getfile.php")); wxInputStream *httpStream = http.GetInputStream(_T("/getfile.php"));
httpok = http.GetError() == wxPROTO_NOERR; httpok = http.GetError() == wxPROTO_NOERR;
wxDELETE(httpStream); wxDELETE(httpStream);
} }
return httpok; return httpok;
} */ } */
else else
output = new wxFileOutputStream(dest); output = new wxFileOutputStream(dest);
} }
BOOLEAN ok = FALSE; BOOLEAN ok = false;
if (input != NULL && output != NULL)
if (input != nullptr && output != nullptr)
{ {
input->Read(*output); input->Read(*output);
wxStreamError err = output->GetLastError(); wxStreamError err = output->GetLastError();
ok = (err == wxSTREAM_NO_ERROR); ok = (err == wxSTREAM_NO_ERROR);
output->Close(); output->Close();
} }
if (input != NULL) if (input != nullptr)
delete input; delete input;
if (output != NULL && scheme != "ftp") if (output != nullptr && scheme != "ftp")
delete output; delete output;
return ok; return ok;
} }
@ -3662,7 +3679,7 @@ int xvt_sys_get_profile_string(const char* file, const char* paragraph, const ch
if (file == NULL || *file == '\0') if (file == NULL || *file == '\0')
file = xvt_fsys_get_campo_ini(); file = xvt_fsys_get_campo_ini();
if (!(paragraph && *paragraph) && wxStricmp(file, "ssa.ini") == 0) if (!(paragraph && *paragraph) && wxStricmp(file, "ssa.ini") == 0)
{ {
if (xvt_fsys_file_exists(file)) if (xvt_fsys_file_exists(file))
{ {
@ -4118,6 +4135,7 @@ static long xvt_vobj_get_metric(WINDOW win, wxSystemMetric data)
long xvt_vobj_get_attr(WINDOW win, long data) long xvt_vobj_get_attr(WINDOW win, long data)
{ {
long ret = 0L; long ret = 0L;
switch(data) switch(data)
{ {
case ATTR_APP_CTL_COLORS: case ATTR_APP_CTL_COLORS:
@ -4378,7 +4396,9 @@ void xvt_vobj_maximize(WINDOW win)
else else
{ {
CAST_WIN(win, w); CAST_WIN(win, w);
wxWindow* parent = w.GetParent(); wxWindow* parent = w.GetParent();
if (parent == NULL) if (parent == NULL)
parent = _task_win; parent = _task_win;
int width, height; int width, height;
@ -4393,7 +4413,7 @@ void xvt_vobj_minimize(WINDOW win)
if (pMain != NULL) if (pMain != NULL)
pMain->Iconize(); pMain->Iconize();
else else
SORRY_BOX(); SORRY_BOX();
} }
void xvt_vobj_hide(WINDOW win) void xvt_vobj_hide(WINDOW win)
@ -4401,17 +4421,17 @@ void xvt_vobj_hide(WINDOW win)
wxFrame* pMain = wxDynamicCast((wxObject*)win, wxFrame); wxFrame* pMain = wxDynamicCast((wxObject*)win, wxFrame);
if (pMain != NULL) if (pMain != NULL)
pMain->Hide(); pMain->Hide();
else else
SORRY_BOX(); SORRY_BOX();
} }
void xvt_vobj_show(WINDOW win) void xvt_vobj_show(WINDOW win)
{ {
wxFrame* pMain = wxDynamicCast((wxObject*)win, wxFrame); wxFrame* pMain = wxDynamicCast((wxObject*)win, wxFrame);
if (pMain != NULL) if (pMain != NULL)
pMain->Show(); pMain->Show();
else else
SORRY_BOX(); SORRY_BOX();
} }
void xvt_vobj_move(WINDOW win, const RCT* rctp) void xvt_vobj_move(WINDOW win, const RCT* rctp)