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)
{
wxApp* a = wxTheApp; // Memorizzo il risultato di wxGetInstance
if (a != NULL) // Puo' succedere!
if (a != nullptr) // Puo' succedere!
{
while (a->Pending())
a->Dispatch();
@ -1626,7 +1626,22 @@ BOOLEAN xvt_fsys_get_curr_dir(DIRECTORY *dirp)
void xvt_fsys_get_temp_dir(DIRECTORY *dirp)
{
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());
}
@ -1974,15 +1989,15 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
wxInputStream* input = NULL;
if (orig_url.HasScheme())
{
{
if (orig_url.GetScheme() == "ftp")
{
{
wxFTP& ftp = *wxStaticCast(&orig_url.GetProtocol(), wxFTP);
ftp.SetPassive(xvt_sys_ftp_passive_mode(orig_url.GetServer()));
}
}
input = orig_url.GetInputStream();
}
else
}
else
input = new wxFileInputStream(orig);
if (input == NULL)
@ -1994,23 +2009,23 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
if (scheme == "ftp")
{
wxFTP ftp;
const wxString strHost = dest_url.GetServer();
const wxString strUser = dest_url.GetUser();
const wxString strPwd = dest_url.GetPassword();
const wxFileName fnPath = dest_url.GetPath();
wxFTP ftp;
const wxString strHost = dest_url.GetServer();
const wxString strUser = dest_url.GetUser();
const wxString strPwd = dest_url.GetPassword();
const wxFileName fnPath = dest_url.GetPath();
const wxString fnDir = fnPath.GetPath(wxPATH_GET_VOLUME, wxPATH_UNIX);
const wxString fnName = fnPath.GetFullName();
if (!strUser.IsEmpty())
{
ftp.SetUser(strUser);
ftp.SetPassword(strPwd);
}
ftp.SetPassive(xvt_sys_ftp_passive_mode(strHost));
if (!strUser.IsEmpty())
{
ftp.SetUser(strUser);
ftp.SetPassword(strPwd);
}
ftp.SetPassive(xvt_sys_ftp_passive_mode(strHost));
if (ftp.Connect(strHost) && ftp.SetBinary() && ftp.ChDir(fnDir))
output = ftp.GetOutputStream(fnName);
if (ftp.Connect(strHost) && ftp.SetBinary() && ftp.ChDir(fnDir))
output = ftp.GetOutputStream(fnName);
}
else
{
@ -2030,6 +2045,7 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
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.
wxString PostData("postdata=");
PostData << fnPath.GetFullPath();
@ -2040,24 +2056,25 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest)
wxInputStream *httpStream = http.GetInputStream(_T("/getfile.php"));
httpok = http.GetError() == wxPROTO_NOERR;
wxDELETE(httpStream);
}
}
return httpok;
} */
else
output = new wxFileOutputStream(dest);
}
BOOLEAN ok = FALSE;
if (input != NULL && output != NULL)
BOOLEAN ok = false;
if (input != nullptr && output != nullptr)
{
input->Read(*output);
wxStreamError err = output->GetLastError();
ok = (err == wxSTREAM_NO_ERROR);
output->Close();
}
if (input != NULL)
if (input != nullptr)
delete input;
if (output != NULL && scheme != "ftp")
if (output != nullptr && scheme != "ftp")
delete output;
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')
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))
{
@ -4118,6 +4135,7 @@ static long xvt_vobj_get_metric(WINDOW win, wxSystemMetric data)
long xvt_vobj_get_attr(WINDOW win, long data)
{
long ret = 0L;
switch(data)
{
case ATTR_APP_CTL_COLORS:
@ -4378,7 +4396,9 @@ void xvt_vobj_maximize(WINDOW win)
else
{
CAST_WIN(win, w);
wxWindow* parent = w.GetParent();
if (parent == NULL)
parent = _task_win;
int width, height;
@ -4393,7 +4413,7 @@ void xvt_vobj_minimize(WINDOW win)
if (pMain != NULL)
pMain->Iconize();
else
SORRY_BOX();
SORRY_BOX();
}
void xvt_vobj_hide(WINDOW win)
@ -4401,17 +4421,17 @@ void xvt_vobj_hide(WINDOW win)
wxFrame* pMain = wxDynamicCast((wxObject*)win, wxFrame);
if (pMain != NULL)
pMain->Hide();
else
SORRY_BOX();
else
SORRY_BOX();
}
void xvt_vobj_show(WINDOW win)
{
wxFrame* pMain = wxDynamicCast((wxObject*)win, wxFrame);
if (pMain != NULL)
pMain->Show();
else
SORRY_BOX();
pMain->Show();
else
SORRY_BOX();
}
void xvt_vobj_move(WINDOW win, const RCT* rctp)