Patch level : 12.0 1214
Files correlati : ba1.exe ba7.exe ba7100a.msk Commento: La conversione era lenta in partenza Il postino diventa trasferimenti. aggiunto il profilo e un parametro per caricarlo (-p<nome profilo>)
This commit is contained in:
		
							parent
							
								
									4de704b6dc
								
							
						
					
					
						commit
						780031ae86
					
				@ -1,3 +1,3 @@
 | 
				
			|||||||
182
 | 
					182
 | 
				
			||||||
0
 | 
					0
 | 
				
			||||||
$dblog|28|28|411|0|Log Transazioni|||
 | 
					$dblog|||411|0|Log Transazioni|||
 | 
				
			||||||
 | 
				
			|||||||
@ -2066,7 +2066,6 @@ int TSystemisamfile::update(
 | 
				
			|||||||
	bool interactive)    // @parm Indica se riportare i campi personalizzati 
 | 
						bool interactive)    // @parm Indica se riportare i campi personalizzati 
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
{     
 | 
					{     
 | 
				
			||||||
  //if (newrec.len() == 0)
 | 
					 | 
				
			||||||
  if (newrec.len() <= 8)
 | 
					  if (newrec.len() <= 8)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    // if (interactive) error_box(FR("Il nuovo tracciato per il file %d e' vuoto"), num()); // Fastidioso per Ilaria
 | 
					    // if (interactive) error_box(FR("Il nuovo tracciato per il file %d e' vuoto"), num()); // Fastidioso per Ilaria
 | 
				
			||||||
@ -2099,6 +2098,7 @@ int TSystemisamfile::update(
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int lenr = wrec.len();
 | 
					  int lenr = wrec.len();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (lenr != 0)
 | 
					  if (lenr != 0)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    const long lev = prefix().filelevel();
 | 
					    const long lev = prefix().filelevel();
 | 
				
			||||||
@ -2160,7 +2160,12 @@ int TSystemisamfile::update(
 | 
				
			|||||||
			wrec.rehash();
 | 
								wrec.rehash();
 | 
				
			||||||
	    lenr = wrec.len();
 | 
						    lenr = wrec.len();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (wrec == oldrec)
 | 
				
			||||||
 | 
								return NOERR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TFilename fname;
 | 
					    TFilename fname;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (toconvert)
 | 
					    if (toconvert)
 | 
				
			||||||
      fname = filename();
 | 
					      fname = filename();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2168,6 +2173,8 @@ int TSystemisamfile::update(
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      TRecnotype ni = 0L;     
 | 
					      TRecnotype ni = 0L;     
 | 
				
			||||||
      TFilename tmpfname; tmpfname.temp("tf");  
 | 
					      TFilename tmpfname; tmpfname.temp("tf");  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (oldrec.len() > 0)
 | 
				
			||||||
				err = open(_excllock);
 | 
									err = open(_excllock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (err != NOERR)
 | 
								if (err != NOERR)
 | 
				
			||||||
@ -2177,6 +2184,7 @@ int TSystemisamfile::update(
 | 
				
			|||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
				err=DB_build(tmpfname, &wrec.rec());
 | 
									err=DB_build(tmpfname, &wrec.rec());
 | 
				
			||||||
 | 
								if (oldrec.len() > 0)
 | 
				
			||||||
				close();
 | 
									close();
 | 
				
			||||||
      if (err != NOERR) 
 | 
					      if (err != NOERR) 
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
@ -2184,6 +2192,7 @@ int TSystemisamfile::update(
 | 
				
			|||||||
        return (err);
 | 
					        return (err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (dir.eod() > 0 && oldrec.len() > 0)
 | 
					      if (dir.eod() > 0 && oldrec.len() > 0)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        // Apro il file destinazione in modo esclusivo e senza indici
 | 
					        // Apro il file destinazione in modo esclusivo e senza indici
 | 
				
			||||||
 | 
				
			|||||||
@ -2769,9 +2769,11 @@ int TMask::save_profile(int num, const char* desc) const
 | 
				
			|||||||
int TMask::load_profile(int num, bool reset)
 | 
					int TMask::load_profile(int num, bool reset)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TFilename prof; 
 | 
					  TFilename prof; 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (make_profile_name(prof))
 | 
					  if (make_profile_name(prof))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    TConfig ini(prof, "Main");
 | 
					    TConfig ini(prof, "Main");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (num <= 0)
 | 
							if (num <= 0)
 | 
				
			||||||
      num = ini.get_int(user());
 | 
					      num = ini.get_int(user());
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@ -2811,6 +2813,69 @@ int TMask::load_profile(int num, bool reset)
 | 
				
			|||||||
  return num;
 | 
					  return num;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int TMask::load_profile(const char * profname, bool reset)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						TFilename prof;
 | 
				
			||||||
 | 
						int num = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (make_profile_name(prof))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
						// find profile num
 | 
				
			||||||
 | 
							TConfig ini(prof, "Main");
 | 
				
			||||||
 | 
							TString_array paragraphs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							ini.list_paragraphs(paragraphs);
 | 
				
			||||||
 | 
							ini.set_paragraph("Main");
 | 
				
			||||||
 | 
							FOR_EACH_ARRAY_ROW(paragraphs, i, para)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								TString name = ini.get("Description", *para);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (name == profname)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									num = atoi(*para);
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}		
 | 
				
			||||||
 | 
							ini.set_paragraph("Main");
 | 
				
			||||||
 | 
							if (num <= 0)
 | 
				
			||||||
 | 
								num = ini.get_int(user());
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								ini.set(user(), num);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							TString16 name; name << num;
 | 
				
			||||||
 | 
							TAssoc_array& var = ini.list_variables(name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (var.items() > 0)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								for (int pos = fields() - 1; pos >= 0; pos--)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									TMask_field& f = fld(pos);
 | 
				
			||||||
 | 
									if (f.is_loadable() && f.get_default().empty())
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										name.format("F_%d", f.dlg());
 | 
				
			||||||
 | 
										if (reset || var.objptr(name) != NULL)
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											if (f.is_sheet())
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												TSheet_field& sf = (TSheet_field&)f;
 | 
				
			||||||
 | 
												sf.destroy();
 | 
				
			||||||
 | 
												for (int r = 0; ini.exist(name, r); r++)
 | 
				
			||||||
 | 
													sf.row(r) = ini.get(name, NULL, r);
 | 
				
			||||||
 | 
												sf.force_update();
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											else
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												if (!f.is_firm())
 | 
				
			||||||
 | 
													f.set(ini.get(name));
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return num;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool TMask::kill_profile(int num)
 | 
					bool TMask::kill_profile(int num)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TFilename prof; 
 | 
					  TFilename prof; 
 | 
				
			||||||
 | 
				
			|||||||
@ -464,6 +464,8 @@ public:
 | 
				
			|||||||
  int save_profile(int num = 0, const char* desc = NULL) const;
 | 
					  int save_profile(int num = 0, const char* desc = NULL) const;
 | 
				
			||||||
  // @cmember Carica il profilo <p num>
 | 
					  // @cmember Carica il profilo <p num>
 | 
				
			||||||
  int load_profile(int num = 0, bool reset = true);
 | 
					  int load_profile(int num = 0, bool reset = true);
 | 
				
			||||||
 | 
						// @cmember Carica il profilo <p name>  
 | 
				
			||||||
 | 
						int TMask::load_profile(const char * profname, bool reset = true);
 | 
				
			||||||
  // @cmember Elimina il profilo <p num>
 | 
					  // @cmember Elimina il profilo <p num>
 | 
				
			||||||
  bool kill_profile(int num);
 | 
					  bool kill_profile(int num);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -45,6 +45,7 @@ protected:
 | 
				
			|||||||
public:
 | 
					public:
 | 
				
			||||||
  void reset();
 | 
					  void reset();
 | 
				
			||||||
  bool log(int severity, const char* msg); // severity: 0=normal; 1=warning; 2=error
 | 
					  bool log(int severity, const char* msg); // severity: 0=normal; 1=warning; 2=error
 | 
				
			||||||
 | 
						bool line() { return log(0, ""); }
 | 
				
			||||||
  void set_title(const char* title);
 | 
					  void set_title(const char* title);
 | 
				
			||||||
  void kill_duplicates(bool k = true) { _kill_duplicates = k; }
 | 
					  void kill_duplicates(bool k = true) { _kill_duplicates = k; }
 | 
				
			||||||
  const TString& title() const { return _title; }
 | 
					  const TString& title() const { return _title; }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user