From 1f2b50d0c372b4ffefd9b82e97d73d8f68de6cd4 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 8 May 2015 10:16:11 +0000 Subject: [PATCH] git-svn-id: svn://10.65.10.50/branches/R_10_00@23083 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/ccommon.h | 4 ++-- include/cfiles.c | 10 ++++++---- include/isam.cpp | 6 ++---- include/prefix.cpp | 2 +- include/prefix.h | 4 ++-- include/progind.cpp | 8 ++++---- include/xvtility.cpp | 46 ++------------------------------------------ 7 files changed, 19 insertions(+), 61 deletions(-) diff --git a/include/ccommon.h b/include/ccommon.h index d94334c5e..5d9399c01 100755 --- a/include/ccommon.h +++ b/include/ccommon.h @@ -50,8 +50,8 @@ #define UPCASE(c) toupper(c) #define LOWCASE(c) tolower(c) #define LENGTH(s) strlen(s) -#define STREMPTY(s) (!(LENGTH(s))) -#define STRNOTEMPTY(s) (!STREMPTY(s)) +#define STREMPTY(s) (!(s && *s)) +#define STRNOTEMPTY(s) (s && *s) #define STRCMP(s1,op,s2) (strcmp(s1,s2) op 0) #define CSTR(n,s) sprintf((s), "%-d", (n)) #define CSTR4(n,s) sprintf((s), "%-ld", (n)) diff --git a/include/cfiles.c b/include/cfiles.c index 24af05e1e..187cca4e3 100755 --- a/include/cfiles.c +++ b/include/cfiles.c @@ -384,9 +384,7 @@ HIDDEN BOOLEAN CGetFirmDir() BOOLEAN good = xvt_fsys_file_exists(prawin); if (good) { - int len = 0; - - len = xvt_sys_get_profile_string(prawin, "Main", "Study", "", __ptprf, sizeof(__ptprf)); + int len = xvt_sys_get_profile_string(prawin, "Main", "Study", "", __ptprf, sizeof(__ptprf)); good = len > 0; if (good) { @@ -401,8 +399,12 @@ HIDDEN BOOLEAN CGetFirmDir() xvt_sys_get_profile_string(prawin, "Main", "Firm", "com", firm, sizeof(firm)); ditta = atol(firm); - if (ditta > 0) sprintf(firm, "%05lda", ditta); + if (ditta > 0) + sprintf(firm, "%05lda", ditta); + else + strcpy(firm, "com"); xvt_fsys_build_pathname(cprefix, NULL, __ptprf, firm, NULL, NULL); + good = xvt_fsys_dir_exists(cprefix); } } diff --git a/include/isam.cpp b/include/isam.cpp index f0021ba5c..e88062df9 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -1504,8 +1504,7 @@ TIsamtempfile::TIsamtempfile(int logicnum, const char* radix, bool create, bool if (sz <= 64) fatal_box("Impossibile aprire il file %s", (const char*)n); - const TDir dir(logicnum); - const long len = dir.len(); + const long len = curr().len(); eod = eox = sz / len; } @@ -1557,7 +1556,6 @@ int TIsamtempfile::open( if (err != NOERR) { err = get_error(err); -// dalla 1.5 serve ? relisfd(_isamfile); fatal_box("Can't create temp file '%s' num. %d: Error n. %d", (const char*)filename, num(), err); } } @@ -1577,7 +1575,7 @@ int TIsamtempfile::open( if (err == NOERR) { - _isam_handle = prefix().open_isamfile(_logicnum, filename); + _isam_handle = prefix().open_isamfile(_logicnum, filename, true); TCodeb_handle fhnd = handle(_curr_key = 1); if (fhnd < 0) err = get_error(fhnd); diff --git a/include/prefix.cpp b/include/prefix.cpp index 11c6cd9a6..ba648f83f 100755 --- a/include/prefix.cpp +++ b/include/prefix.cpp @@ -996,7 +996,7 @@ void TPrefix::set( // // @flag NULL | Chiude tutti i files // @flag COM | Apre il direttorio con i dati comuni - // @flag DEF | Riapre la ditta indicata nel file prefix.txt + // @flag DEF | Riapre la ditta indicata nel file campo.ini // @flag codice ditta | Apre la ditta indicata { if (name == NULL) diff --git a/include/prefix.h b/include/prefix.h index 327dad57e..54fa76c52 100755 --- a/include/prefix.h +++ b/include/prefix.h @@ -97,8 +97,8 @@ class TPrefix : public TObject { // @access:(INTERNAL) Private Member - // @cmember:(INTERNAL) Contenuto del file "prefix.txt" - TString _prefix; + // @cmember:(INTERNAL) Contenuto di Study in Campo.ini + TFilename _prefix; // @cmember:(INTERNAL) Livello degli archivi unsigned int _filelevel, _stdlevel; diff --git a/include/progind.cpp b/include/progind.cpp index 77efd81be..ace9ba2cf 100755 --- a/include/progind.cpp +++ b/include/progind.cpp @@ -335,7 +335,7 @@ bool TProgress_monitor::set_status(long n) { _pi = new TProgind(_total, _txt, _cancellable); _pi->set_start_time(_start); - end_wait(); + xvt_scr_reset_busy_cursor(); } // Aggiorna la TProgind associata, sempre che esista _status = min(n, _total); @@ -369,7 +369,7 @@ 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), _pi(NULL), _start(clock()) -{ begin_wait(); } +{ xvt_scr_set_busy_cursor(); } TProgress_monitor::~TProgress_monitor() { @@ -377,7 +377,7 @@ TProgress_monitor::~TProgress_monitor() if (_pi != NULL) delete _pi; else - end_wait(); + xvt_scr_reset_busy_cursor(); } /////////////////////////////////////////////////////////// @@ -390,7 +390,7 @@ static TIndwin* __indwin__p = NULL; void progind_create(long m, const char* t, bool b, bool c) { CHECK(__indwin__p == NULL, "Cannot have more than one progress indicator"); - __indwin__p = new TProgind(m, t, b, c, 60); + __indwin__p = new TProgind(m, t, b, c); do_events(); } diff --git a/include/xvtility.cpp b/include/xvtility.cpp index 29028cdab..363236702 100755 --- a/include/xvtility.cpp +++ b/include/xvtility.cpp @@ -772,53 +772,11 @@ COLOR trans_color( return col; } -// @doc INTERNAL -// @func HIDDEN void | set_cursor | Cambia il cursore del mouse -HIDDEN void set_wait_cursor( - bool w) // @parm Indica il tipo di cursore da utilizzare: - // - // @flag TRUE | Cursore a clessidra per le wait - // @flag FALSE | Cursore a frecca normale -{ - static int _count = 0; -// static WINDOW _win = NULL_WIN; - - if (w) - { - if (_count == 0) - { -/* _win = cur_win(); - if (_win == NULL_WIN) - _win = TASK_WIN; - xvt_win_set_cursor(_win, CURSOR_WAIT); -*/ - xvt_win_set_cursor(TASK_WIN, CURSOR_WAIT); - } - _count++; - } - else - { - _count--; - CHECK(_count >= 0, "end_wait without matching begin_wait"); - if (_count == 0) - { - /* - WINDOW cur = cur_win(); - if (cur == _win) - xvt_win_set_cursor(_win, CURSOR_ARROW); - else - xvt_win_set_cursor(TASK_WIN, CURSOR_ARROW); - */ - xvt_win_set_cursor(TASK_WIN, CURSOR_ARROW); - } - } -} - void begin_wait() -{ set_wait_cursor(true); } +{ xvt_scr_set_busy_cursor(); } void end_wait() -{ set_wait_cursor(false); } +{ xvt_scr_reset_busy_cursor(); } // @doc INTERNAL