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_isredirected_server(server, url);
http_dir(server, url, txt); 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); path.format("/release%d0/", --rel);
url = path; url << pattern; url = path; url << pattern;
http_isredirected_server(server, url); http_isredirected_server(server, url);
http_dir(server, url, txt); http_dir(server, url, txt);
} }
#endif
TFilename tmp; tmp.tempdir(); tmp.add("history.html"); TFilename tmp; tmp.tempdir(); tmp.add("history.html");
ofstream h(tmp); ofstream h(tmp);
@ -441,8 +443,12 @@ TInfo_mask::TInfo_mask() : TProperty_sheet(TR("Informazioni"))
prot = "SSA"; prot = "SSA";
{ {
TString_array ssa; TString_array ssa;
if (list_files("*.ssa", ssa) > 0) const int n = list_files("*.ssa", ssa);
if (n > 0)
{
prot = ssa.row(0); prot = ssa.row(0);
if (n > 1) prot << " ?";
}
} }
break; break;
default: default:

View File

@ -937,19 +937,22 @@ bool TBrowse::do_link(bool insert)
} }
} }
TFilename msg; msg.temp("msg"); TFilename msg; msg.temp("msg", "ini");
app << " /i" << msg; app << " /i" << msg;
{
bool set_link = true;
TConfig ini(msg, "Transaction");
if (insert) if (insert)
{ {
TConfig ini(msg, "Transaction");
ini.set("Action", TRANSACTION_RUN); ini.set("Action", TRANSACTION_RUN);
set_link = field().empty() && do_input(false) > 0;
} }
else else
{
TConfig ini(msg, "Transaction");
ini.set("Action", TRANSACTION_LINK); ini.set("Action", TRANSACTION_LINK);
if (set_link)
{
TString8 paragraph; paragraph << _cursor->file().num(); TString8 paragraph; paragraph << _cursor->file().num();
ini.set_paragraph(paragraph); ini.set_paragraph(paragraph);
@ -967,6 +970,7 @@ bool TBrowse::do_link(bool insert)
fldref.write(ini, paragraph, inp_val); fldref.write(ini, paragraph, inp_val);
} }
} }
}
TExternal_app a(app); TExternal_app a(app);
a.run(); a.run();
@ -988,7 +992,7 @@ bool TBrowse::do_link(bool insert)
do_output(); do_output();
} }
} }
::remove(msg); msg.fremove();
} }
return ok; return ok;
} }

View File

@ -617,7 +617,7 @@ int DB_packfile(short vis, const char* filename, long eod)
long rc = 0L; long rc = 0L;
if (vis) if (vis)
{ {
char s[_MAX_PATH]; char s[_MAX_PATH+32];
strcpy(s, "Compattamento "); strcpy(s, "Compattamento ");
strcat(s, filename); strcat(s, filename);
pi = xvt_dm_progress_create(NULL_WIN, s, 1, FALSE); 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; WINDOW pi = NULL_WIN;
if (vis) if (vis)
{ {
char s[_MAX_PATH]; char s[_MAX_PATH+32];
strcpy(s, "Compattamento memo file : "); strcpy(s, "Compattamento memo : ");
strcat(s, filename); 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]); rt=d4memoCompress(dbdata[handle]);
if (pi) if (pi)

View File

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

View File

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

View File

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

View File

@ -325,6 +325,9 @@ TTimerind::~TTimerind()
// TProgress_monitor // TProgress_monitor
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
static int _pm_inst = 0;
static WINDOW _pm_parent = NULL_WIN;
bool TProgress_monitor::set_status(long n) bool TProgress_monitor::set_status(long n)
{ {
// Aggiusto timer iniziale se necessario // 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 // Se è passato un secondo allora crea la progress dialog
if (_pd == NULL_WIN && n > 0 && (clock() - _start) >= CLOCKS_PER_SEC) 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()) if (_txt.full())
xvt_dm_progress_set_text(_pd, _txt); xvt_dm_progress_set_text(_pd, _txt);
xvt_scr_reset_busy_cursor(); 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) TProgress_monitor::TProgress_monitor(long items, const char* txt, bool cancancel)
: _total(items), _txt(txt), _status(0), _cancellable(cancancel), : _total(items), _txt(txt), _status(0), _cancellable(cancancel),
_pd(NULL_WIN), _start(clock()), _cancelled(false) _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() 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 // Distruggi la TProgind o la clessidra, a seconda del caso
if (_pd != NULL_WIN) if (_pd != NULL_WIN)
xvt_dm_progress_destroy(_pd); xvt_dm_progress_destroy(_pd);

View File

@ -55,6 +55,11 @@
#define RDOC_DAPROVV "DAPROVV" #define RDOC_DAPROVV "DAPROVV"
#define RDOC_DANDOC "DANDOC" #define RDOC_DANDOC "DANDOC"
#define RDOC_DAIDRIGA "DAIDRIGA" #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_CODCMS "CODCMS"
#define RDOC_FASCMS "FASCMS" #define RDOC_FASCMS "FASCMS"
#define RDOC_CODCOSTO "CODCOSTO" #define RDOC_CODCOSTO "CODCOSTO"

View File

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

View File

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

View File

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

View File

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

View File

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