Milgiorato supporto per progress dialog nativa

git-svn-id: svn://10.65.10.50/branches/R_10_00@23122 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2015-07-10 14:52:21 +00:00
parent a95d8aa36f
commit eba1707224
14 changed files with 120 additions and 79 deletions

View File

@ -54,13 +54,15 @@ void history()
http_isredirected_server(server, url);
http_dir(server, url, txt);
if (txt.empty())
#ifdef DBG
if (txt.empty()) // Se non trova nulla riprova con la versione precedente
{
path.format("/release%d0/", --rel);
url = path; url << pattern;
http_isredirected_server(server, url);
http_dir(server, url, txt);
}
#endif
TFilename tmp; tmp.tempdir(); tmp.add("history.html");
ofstream h(tmp);
@ -441,8 +443,12 @@ TInfo_mask::TInfo_mask() : TProperty_sheet(TR("Informazioni"))
prot = "SSA";
{
TString_array ssa;
if (list_files("*.ssa", ssa) > 0)
const int n = list_files("*.ssa", ssa);
if (n > 0)
{
prot = ssa.row(0);
if (n > 1) prot << " ?";
}
}
break;
default:

View File

@ -937,34 +937,38 @@ bool TBrowse::do_link(bool insert)
}
}
TFilename msg; msg.temp("msg");
TFilename msg; msg.temp("msg", "ini");
app << " /i" << msg;
if (insert)
{
bool set_link = true;
TConfig ini(msg, "Transaction");
ini.set("Action", TRANSACTION_RUN);
}
else
{
TConfig ini(msg, "Transaction");
ini.set("Action", TRANSACTION_LINK);
if (insert)
{
ini.set("Action", TRANSACTION_RUN);
set_link = field().empty() && do_input(false) > 0;
}
else
ini.set("Action", TRANSACTION_LINK);
TString8 paragraph; paragraph << _cursor->file().num();
ini.set_paragraph(paragraph);
if (set_link)
{
TString8 paragraph; paragraph << _cursor->file().num();
ini.set_paragraph(paragraph);
// Uso sempre la chiave 1 per collegarmi agli altri programmi
const TRelation& rel = *_cursor->relation();
const RecDes& recd = rel.curr().rec_des(); // Descrizione del record della testata
const KeyDes& kd = recd.Ky[0]; // Elenco dei campi della chiave 1
TString inp_val;
for (int i = 0; i < kd.NkFields; i++)
{
const int nf = kd.FieldSeq[i] % MaxFields;
const RecFieldDes& rf = recd.Fd[nf];
const TFieldref fldref(rf.Name, 0);
inp_val = fldref.read(rel);
fldref.write(ini, paragraph, inp_val);
// Uso sempre la chiave 1 per collegarmi agli altri programmi
const TRelation& rel = *_cursor->relation();
const RecDes& recd = rel.curr().rec_des(); // Descrizione del record della testata
const KeyDes& kd = recd.Ky[0]; // Elenco dei campi della chiave 1
TString inp_val;
for (int i = 0; i < kd.NkFields; i++)
{
const int nf = kd.FieldSeq[i] % MaxFields;
const RecFieldDes& rf = recd.Fd[nf];
const TFieldref fldref(rf.Name, 0);
inp_val = fldref.read(rel);
fldref.write(ini, paragraph, inp_val);
}
}
}
@ -988,7 +992,7 @@ bool TBrowse::do_link(bool insert)
do_output();
}
}
::remove(msg);
msg.fremove();
}
return ok;
}

View File

@ -617,8 +617,8 @@ int DB_packfile(short vis, const char* filename, long eod)
long rc = 0L;
if (vis)
{
char s[_MAX_PATH];
strcpy(s,"Compattamento ");
char s[_MAX_PATH+32];
strcpy(s, "Compattamento ");
strcat(s, filename);
pi = xvt_dm_progress_create(NULL_WIN, s, 1, FALSE);
}
@ -651,10 +651,10 @@ int DB_packmemo(short vis, const char * filename)
WINDOW pi = NULL_WIN;
if (vis)
{
char s[_MAX_PATH];
strcpy(s, "Compattamento memo file : ");
char s[_MAX_PATH+32];
strcpy(s, "Compattamento memo : ");
strcat(s, filename);
xvt_dm_progress_create(NULL_WIN, s, 1, FALSE);
pi = xvt_dm_progress_create(NULL_WIN, s, 1, FALSE);
}
rt=d4memoCompress(dbdata[handle]);
if (pi)

View File

@ -2385,7 +2385,7 @@ bool TListbox_control::select(int i)
{
_current = i;
xi_set_text(_obj, ""); // Senno' a volte disegna male
xi_set_text(_obj, (char*)_values.get(i));
xi_set_text(_obj, _values.get(i));
}
}
return ok;
@ -2393,8 +2393,11 @@ bool TListbox_control::select(int i)
bool TListbox_control::select_by_initial(char c)
{
int i = _current;
const int tot = items();
if (tot <= 1)
return false; // not changed
int i = _current;
for (i = (i+1)%tot; i != _current; i = (i+1)%tot)
{
if (toupper(_values.get_char(i)) == toupper(c))

View File

@ -402,11 +402,15 @@ const TString& TDongle::short_name() const
const TString& TDongle::server_name() const
{
if (network() && !xvt_sys_dongle_server_running())
if (network())
{
if (hardware() == _dongle_ssanet)
return ini_get_string(CONFIG_SSA, NULL, "Port");
return ini_get_string(CONFIG_INSTALL, "Server", "Dongle");
const int sr = xvt_sys_dongle_server_running();
if (sr == 0)
{
if (hardware() == _dongle_ssanet)
return ini_get_string(CONFIG_SSA, NULL, "Port");
return ini_get_string(CONFIG_INSTALL, "Server", "Dongle");
}
}
TString& tmp = get_tmp_string(50);

View File

@ -49,6 +49,7 @@
#define MOV_DATAINC "DATAINC"
#define MOV_LIQDIFF "LIQDIFF"
#define MOV_IVAXCASSA "IVAXCASSA"
#define MOV_SPLITPAY "SPLITPAY"
#define MOV_NOLEGGIO "NOLEGGIO"
#define MOV_INVIOFE "INVIOFE"
#define MOV_CONTSEP "CONTSEP"

View File

@ -325,6 +325,9 @@ TTimerind::~TTimerind()
// TProgress_monitor
///////////////////////////////////////////////////////////
static int _pm_inst = 0;
static WINDOW _pm_parent = NULL_WIN;
bool TProgress_monitor::set_status(long n)
{
// Aggiusto timer iniziale se necessario
@ -334,7 +337,7 @@ bool TProgress_monitor::set_status(long n)
// Se è passato un secondo allora crea la progress dialog
if (_pd == NULL_WIN && n > 0 && (clock() - _start) >= CLOCKS_PER_SEC)
{
_pd = xvt_dm_progress_create(NULL_WIN/*cur_win()*/, main_app().title(), _total, _cancellable);
_pd = xvt_dm_progress_create(_pm_parent, main_app().title(), _total, _cancellable);
if (_txt.full())
xvt_dm_progress_set_text(_pd, _txt);
xvt_scr_reset_busy_cursor();
@ -370,10 +373,27 @@ bool TProgress_monitor::is_cancelled() const
TProgress_monitor::TProgress_monitor(long items, const char* txt, bool cancancel)
: _total(items), _txt(txt), _status(0), _cancellable(cancancel),
_pd(NULL_WIN), _start(clock()), _cancelled(false)
{ xvt_scr_set_busy_cursor(); }
{
xvt_scr_set_busy_cursor();
if (_pm_parent == NULL_WIN)
{
_pm_parent = cur_win();
if (_pm_parent == NULL_WIN)
_pm_parent = TASK_WIN;
xvt_vobj_set_enabled(_pm_parent, false);
_pm_inst = 1;
}
else
_pm_inst++;
}
TProgress_monitor::~TProgress_monitor()
{
if (--_pm_inst <= 0)
{
xvt_vobj_set_enabled(_pm_parent, true);
_pm_parent = NULL_WIN;
}
// Distruggi la TProgind o la clessidra, a seconda del caso
if (_pd != NULL_WIN)
xvt_dm_progress_destroy(_pd);

View File

@ -55,6 +55,11 @@
#define RDOC_DAPROVV "DAPROVV"
#define RDOC_DANDOC "DANDOC"
#define RDOC_DAIDRIGA "DAIDRIGA"
#define RDOC_ACODNUM "DACODNUM"
#define RDOC_AANNO "DAANNO"
#define RDOC_APROVV "DAPROVV"
#define RDOC_ANDOC "DANDOC"
#define RDOC_AIDRIGA "DAIDRIGA"
#define RDOC_CODCMS "CODCMS"
#define RDOC_FASCMS "FASCMS"
#define RDOC_CODCOSTO "CODCOSTO"

View File

@ -2735,9 +2735,9 @@ bool TRelation_description::choose_field(
{
_cur_field = (int)sht.selected();
_cfield = fd.row(_cur_field);
return TRUE;
return true;
}
return FALSE;
return false;
}
// @doc INTERNAL
@ -2753,12 +2753,12 @@ bool TRelation_description::build_menu(
//
// @devnote Funzione non implementata.
{
return FALSE;
return false;
}
bool TRelation_description::remove_menu()
{
return FALSE;
return false;
}
bool TRelation_description::set_cur_file(int id)

View File

@ -238,7 +238,7 @@ class TCursor : public TContainer
// @access:(INTERNAL) Private Member
{
// *** maximum number of elements in a cursor working page
enum {_cmaxelpage=4096};
enum { _cmaxelpage=16384 };
// @cmember:(INTERNAL) Relazione su cui costruire il cursore
TRelation* _if;

View File

@ -1253,16 +1253,26 @@ const TFilename& TFilename::tempdir()
if (create)
{
_tempdir.cut(0);
xvt_sys_get_env("TEMP", _tempdir.get_buffer(), _tempdir.size());
if (_tempdir.empty())
xvt_sys_get_env("TMP", _tempdir.get_buffer(), _tempdir.size());
xvt_sys_get_profile_string(NULL, "Main", "Temp", "", _tempdir.get_buffer(), _tempdir.size());
if (_tempdir.blank())
{
xvt_sys_get_env("TEMP", _tempdir.get_buffer(), _tempdir.size());
if (_tempdir.blank())
xvt_sys_get_env("TMP", _tempdir.get_buffer(), _tempdir.size());
if (_tempdir.len() > 28) // troppo lunga!
{
_tempdir.currdir();
_tempdir.add("temp");
xvt_sys_set_profile_string(NULL, "Main", "Temp", _tempdir);
}
}
bool ok = dexist(_tempdir);
if (!ok) // Codebase NON funziona senza una temp esistente!
{
ok = make_dir(_tempdir);
if (!ok)
fatal_box("La cartella temporanea '%s' non esiste", (const char*)_tempdir);
cantwrite_box(_tempdir);
}
const int last = len()-1;
@ -1284,7 +1294,7 @@ const TFilename& TFilename::tempdir()
{
ok = make_dir(_tempdir);
if (!ok)
fatal_box("Impossibile creare la cartella temporanea '%s'", (const char*)_tempdir);
cantwrite_box(_tempdir);
}
xvt_sys_set_env("TMP", _tempdir); // Usata da _tmpnam
@ -1296,12 +1306,8 @@ const TFilename& TFilename::tempdir()
const TFilename& TFilename::currdir()
{
DIRECTORY d;
xvt_fsys_get_dir(&d); // verificare
DIRECTORY d; xvt_fsys_get_dir(&d);
xvt_fsys_convert_dir_to_str(&d, get_buffer(), size());
return *this;
}
// Certified 50%

View File

@ -71,8 +71,8 @@ HIDDEN bool _emptycopy_val(TMask_field& f, KEY)
HIDDEN bool check_pi_estera(const TString& st, const TString& paiva)
{
const int len = paiva.len();
const char* p = paiva;
const int len = paiva.len();
const char* p = paiva;
const bool nat = real::is_natural(p);
if (st == "AT")

View File

@ -346,7 +346,7 @@ bool can_close()
bool is_valid_window(WINDOW w)
{
bool ok = FALSE;
bool ok = false;
if (w != NULL_WIN)
ok = (xvt_vobj_get_attr(w, ATTR_NATIVE_WINDOW) != 0L);
return ok;
@ -356,20 +356,12 @@ bool is_valid_window(WINDOW w)
//
// @rdesc Restituisce l'handle della finestra corrente.
WINDOW cur_win()
// @comm Se non esiste una finestra corrente allora ritorna NULL_WIN
// @comm Se non esiste una finestra corrente allora ritorna NULL_WIN
{
WINDOW win = NULL_WIN;
TWindow* w = WinManager.cur_win();
if (w != NULL)
{
win = w->win();
/*if (!is_valid_window(win))
{
w->stop_run(K_FORCE_CLOSE);
win = NULL_WIN;
}*/
}
return win;
}
@ -460,8 +452,8 @@ void TWindow::open()
void TWindow::open_modal()
{
set_modal(TRUE);
_open = TRUE;
set_modal(true);
_open = true;
open();
WinManager.reg(this);
@ -480,14 +472,14 @@ void TWindow::close_modal()
{
WinManager.unreg(this);
close();
_open = FALSE;
set_modal(FALSE);
_open = false;
set_modal(false);
}
}
bool TWindow::stop_run(KEY key)
{
_running = FALSE;
_running = false;
_lastkey = key;
return true;
}
@ -512,7 +504,7 @@ KEY TWindow::run()
const bool was_open = is_open();
start_run();
_running = TRUE;
_running = true;
if (!was_open)
open_modal();
@ -666,12 +658,12 @@ void TWindow::force_update()
bool TWindow::save_ctools()
{
if (_ctools_saved == FALSE)
if (!_ctools_saved)
{
xvt_dwin_get_draw_ctools(win(), &_ct);
return _ctools_saved = TRUE;
return _ctools_saved = true;
}
return FALSE;
return false;
}
bool TWindow::restore_ctools()
@ -679,10 +671,10 @@ bool TWindow::restore_ctools()
if (_ctools_saved)
{
xvt_dwin_set_draw_ctools(win(), &_ct);
_ctools_saved = FALSE;
return TRUE;
_ctools_saved = false;
return true;
}
return FALSE;
return false;
}

View File

@ -250,10 +250,10 @@ public:
// @cmember Minimizza (iconizza) la finestra
void minimize() const;
// @cmember Attiva/disattiva la finestra
virtual void activate(bool = TRUE);
virtual void activate(bool = true);
// @cmember Disattiva la finestra (chiama <mf TWindow::activate>)
void deactivate()
{ activate(FALSE); }
{ activate(false); }
// @cmember Mostra la finestra modale
void open_modal();