Files correlati : 288 Ricompilazione Demo : [ ] Commento : 0001222: impostazione codice di ricerca se imposto il codice e poi clicco sulla lente di ingrandimento il codice non viene riportato nella ricerca che quindi parte dal codice più basso disponibile. verificato sia sulla stampa rendiconto che sul pagato. git-svn-id: svn://10.65.10.50/trunk@18601 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			165 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			165 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#include <about.h>
 | 
						|
#include <applicat.h>
 | 
						|
#include <colors.h>
 | 
						|
#include <config.h>
 | 
						|
#include <dongle.h>
 | 
						|
#include <prefix.h>
 | 
						|
#include <sheet.h>
 | 
						|
#include <sqlset.h>
 | 
						|
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
// Finestra informazioni
 | 
						|
///////////////////////////////////////////////////////////
 | 
						|
 | 
						|
class TInfo_mask : public TArray_sheet
 | 
						|
{ 
 | 
						|
protected:
 | 
						|
  virtual bool get_cell_colors(int row, int col, COLOR& fore, COLOR& back) const;
 | 
						|
 | 
						|
public:
 | 
						|
  void add_row(const char* prompt, const char* value, int err = 0);
 | 
						|
  void add_row(const char* prompt, unsigned long value, int err = 0);
 | 
						|
	TInfo_mask();
 | 
						|
};
 | 
						|
 | 
						|
bool TInfo_mask::get_cell_colors(int r, int c, COLOR& fore, COLOR& back) const
 | 
						|
{
 | 
						|
  const int err = ((TArray_sheet*)this)->row(r).get_int(2);
 | 
						|
  if (err > 0)
 | 
						|
  {
 | 
						|
    fore = err == 1 ? NORMAL_COLOR        : FOCUS_COLOR;
 | 
						|
    back = err == 1 ? REQUIRED_BACK_COLOR : FOCUS_BACK_COLOR;
 | 
						|
  }
 | 
						|
  return TArray_sheet::get_cell_colors(r, c, fore, back);
 | 
						|
}
 | 
						|
 | 
						|
void TInfo_mask::add_row(const char* prompt, const char* value, int err)
 | 
						|
{
 | 
						|
  TToken_string* r = new TToken_string;
 | 
						|
  r->add(prompt);
 | 
						|
  r->add(value);
 | 
						|
  r->add(err);
 | 
						|
  add(r);
 | 
						|
}
 | 
						|
 | 
						|
void TInfo_mask::add_row(const char* prompt, unsigned long value, int err)
 | 
						|
{
 | 
						|
	TString16 str; str.format("%lu", value);
 | 
						|
	add_row(prompt, str);
 | 
						|
}
 | 
						|
 | 
						|
TInfo_mask::TInfo_mask() 
 | 
						|
          : TArray_sheet(-1, -1, 78, 20, TR("Informazioni"), "@18|@58")
 | 
						|
{
 | 
						|
  const word ser_no = dongle().number();
 | 
						|
 | 
						|
  int year = 2091, release = 10, tag = 0, patch = 1;
 | 
						|
	TString80 versione = "2091.10.00 Patch 0001";
 | 
						|
  if (main_app().get_version_info(year, release, tag, patch))
 | 
						|
		versione.format("%d.%02d.%02d Patch %04d", year, release, tag, patch);
 | 
						|
 | 
						|
  TString80 stros, strwx, strcpu;
 | 
						|
  xvt_sys_get_version(stros.get_buffer(), strwx.get_buffer(), stros.size());
 | 
						|
  xvt_sys_get_host_name(strcpu.get_buffer(), strcpu.size());
 | 
						|
 | 
						|
  TString arg;
 | 
						|
	for (int a = 0; a < main_app().argc(); a++)
 | 
						|
		arg << main_app().argv(a) << ' ';
 | 
						|
	arg.trim(); arg.lower();
 | 
						|
 | 
						|
  TConfig campoini(CONFIG_INSTALL, "Main");
 | 
						|
  TConfig userini(CONFIG_GUI, "Printer");
 | 
						|
  
 | 
						|
  TString prot;
 | 
						|
  const TDongleHardware dhw = dongle().hardware();
 | 
						|
	switch (dhw)
 | 
						|
	{
 | 
						|
	case _dongle_hardlock: prot = "Hardlock"; break;
 | 
						|
	case _dongle_eutron  : prot = "Eutron"; break;
 | 
						|
	case _dongle_network : prot = campoini.get("Dongle", "Server"); break;
 | 
						|
	default              : prot = TR("Nessuna");	break;
 | 
						|
	}
 | 
						|
 | 
						|
  const int type = campoini.get_int("Type");
 | 
						|
  const char* tipo = NULL;
 | 
						|
  switch (type)
 | 
						|
  {
 | 
						|
  case 1: tipo = TR("Postazione singola"); break;
 | 
						|
  case 2: tipo = TR("Server"); break;
 | 
						|
  case 3: tipo = TR("Client"); break;
 | 
						|
  default:
 | 
						|
    if (campoini.get_bool("TestDatabase"))
 | 
						|
    {
 | 
						|
      if (dhw == _dongle_network)
 | 
						|
        tipo = TR("Server");
 | 
						|
      else
 | 
						|
        tipo = TR("Server o Postazione singola");
 | 
						|
    }
 | 
						|
    else
 | 
						|
      tipo = TR("Client");
 | 
						|
    break;
 | 
						|
  }
 | 
						|
 | 
						|
  TFilename temp; temp.tempdir();
 | 
						|
  TString strdb, strsql;
 | 
						|
  {
 | 
						|
    TISAM_recordset rs("");
 | 
						|
    strdb = rs.driver_version();
 | 
						|
  }
 | 
						|
  {
 | 
						|
    TSQL_recordset rs("");
 | 
						|
    strsql = rs.driver_version();
 | 
						|
  }
 | 
						|
 | 
						|
	add_row(TR("Versione"), versione);
 | 
						|
	add_row(TR("Protezione"), prot);
 | 
						|
	add_row(TR("N. di serie"), ser_no, ser_no < 0);
 | 
						|
  add_row(TR("Assistenza"), dongle().year_assist());
 | 
						|
  add_row(TR("Installazione"), tipo);
 | 
						|
  add_row(TR("Sistema Operativo"), stros);
 | 
						|
	add_row(TR("Utente"), user());
 | 
						|
  add_row(TR("Computer"), strcpu);
 | 
						|
  const TString study = firm2dir(-1);
 | 
						|
  add_row(TR("Studio"), study, study.find(' ') > 0 || study.len() > 30);
 | 
						|
  add_row(TR("Ditta"), campoini.get("Firm", "Main"));
 | 
						|
  if (prefix_valid())
 | 
						|
  {
 | 
						|
    const TFirm& f = prefix().firm();
 | 
						|
    add_row(TR("Ragione Sociale"), f.ragione_sociale());
 | 
						|
    add_row(TR("Valuta"), f.codice_valuta());
 | 
						|
  }
 | 
						|
  else
 | 
						|
  {
 | 
						|
    add_row(TR("Ragione Sociale"), campoini.get("Company"));
 | 
						|
  }
 | 
						|
 | 
						|
	add_row(TR("Programma"), arg);
 | 
						|
	add_row(TR("Config locale"), campoini.name(), campoini.name().find(' ') >= 0);
 | 
						|
	add_row(TR("Config utente"), userini.name(), userini.name().find(' ') >= 0);
 | 
						|
  add_row(TR("File temporanei"), temp, temp.find(' ') >= 0);
 | 
						|
 | 
						|
  const long mbfree = xvt_fsys_get_disk_free_space(study, 'M');
 | 
						|
  TString16 strmb; strmb.format("%ld Mb", mbfree);
 | 
						|
	add_row(TR("Spazio su disco"), strmb, mbfree < 512);
 | 
						|
	
 | 
						|
  TString printer;
 | 
						|
  printer = userini.get("Name", "Printer");
 | 
						|
	if (printer.blank())
 | 
						|
		printer = TR("Nessuna");
 | 
						|
	add_row(TR("Stampante"), printer, printer.len() >= 32);
 | 
						|
 | 
						|
  xvt_print_pdf_version(printer.get_buffer(), printer.size());
 | 
						|
  add_row(TR("Libreria DB"),  strdb);
 | 
						|
  add_row(TR("Libreria GUI"), strwx);
 | 
						|
  add_row(TR("Libreria PDF"), printer);
 | 
						|
  add_row(TR("Libreria SQL"), strsql);
 | 
						|
}
 | 
						|
 | 
						|
// About box: risposta alla opzione Informazioni del menu File
 | 
						|
void about()
 | 
						|
{
 | 
						|
  TInfo_mask info;
 | 
						|
	info.run();
 | 
						|
}
 | 
						|
 |