Patch level : 10.0
Files correlati : ba7 ba8 Ricompilazione Demo : [ ] Commento : Aggiornato postino riportando modifiche dalla 5.0 git-svn-id: svn://10.65.10.50/trunk@16787 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									419fb5ac96
								
							
						
					
					
						commit
						de77f64a9c
					
				@ -1,7 +1,6 @@
 | 
			
		||||
#include <applicat.h>
 | 
			
		||||
#include <automask.h>
 | 
			
		||||
#include <browfile.h>
 | 
			
		||||
#include <config.h>
 | 
			
		||||
#include <defmask.h>
 | 
			
		||||
#include <dongle.h>
 | 
			
		||||
#include <execp.h>
 | 
			
		||||
@ -552,7 +551,7 @@ void TMailer_mask::test_delete()
 | 
			
		||||
				row->get(sender_pos, file); // Cartella di provenienza
 | 
			
		||||
				file.add(id);
 | 
			
		||||
				file.ext("ini");
 | 
			
		||||
				xvt_fsys_remove_file(file);
 | 
			
		||||
				file.fremove();
 | 
			
		||||
				deleted = true;
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
@ -630,7 +629,7 @@ void TMailer_mask::expand_tabs(TMail_message& msg, const int tab) const
 | 
			
		||||
void TMailer_mask::scan_dir(const TFilename& dir, TMail_messages& box) const
 | 
			
		||||
{
 | 
			
		||||
  TString_array msg;
 | 
			
		||||
  TFilename mask(dir); 
 | 
			
		||||
  TFilename mask = dir;
 | 
			
		||||
  mask.add("*.ini");
 | 
			
		||||
  ::list_files(mask, msg);
 | 
			
		||||
 | 
			
		||||
@ -692,8 +691,8 @@ void TMailer_mask::fill_messages()
 | 
			
		||||
  TWait_cursor hourglass;
 | 
			
		||||
  
 | 
			
		||||
  TFilename server(get(F_SERVER));
 | 
			
		||||
  TString16 user(get(F_USER));
 | 
			
		||||
  TString16 password(get(F_PASSWORD));
 | 
			
		||||
  TString80 user(get(F_USER));
 | 
			
		||||
  TString80 password(get(F_PASSWORD));
 | 
			
		||||
  TMail_box mailbox;
 | 
			
		||||
  if (mailbox.default_params(server, user, password))
 | 
			
		||||
  {
 | 
			
		||||
@ -701,6 +700,7 @@ void TMailer_mask::fill_messages()
 | 
			
		||||
    set(F_USER, user);
 | 
			
		||||
    set(F_PASSWORD, password);
 | 
			
		||||
  }
 | 
			
		||||
  expand_sys_vars(server);
 | 
			
		||||
             
 | 
			
		||||
  int totmapi = 0;                       
 | 
			
		||||
  
 | 
			
		||||
@ -874,7 +874,7 @@ void adjust_long_lines(const TFilename& tmp)
 | 
			
		||||
  dst.close();
 | 
			
		||||
  if (adjusted)
 | 
			
		||||
    fcopy(dst_name, tmp);
 | 
			
		||||
  remove_file(dst_name);
 | 
			
		||||
  dst_name.fremove();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TMailer_mask::track(const TMail_message& msg, const TString& app, const TString& action, int err)
 | 
			
		||||
@ -950,39 +950,37 @@ bool TMailer_mask::exec_app(int& err, const TString& appname, TMail_message& msg
 | 
			
		||||
    TString command_line(appname);
 | 
			
		||||
    command_line << " /i" << tmp;
 | 
			
		||||
    TExternal_app app(command_line);
 | 
			
		||||
    err = app.run();
 | 
			
		||||
    err = app.run(false, true, false); // Don't iconize (nor restore) the task window!
 | 
			
		||||
    xvt_sys_sleep(1000);
 | 
			
		||||
 | 
			
		||||
    if (err == NOERR)
 | 
			
		||||
    {
 | 
			
		||||
      TConfig ini(tmp, "Transaction");
 | 
			
		||||
      if (ini.get("Result") == "OK")
 | 
			
		||||
      if (ini.get("Result").compare("OK", -1, true) == 0 || 
 | 
			
		||||
          ini.get("Action").compare("RUN", -1, true) == 0)
 | 
			
		||||
        err = 0;
 | 
			
		||||
      else    
 | 
			
		||||
        err = ini.get_int("Error");
 | 
			
		||||
 | 
			
		||||
			const TString&  backup = get(F_BACKUP);
 | 
			
		||||
 | 
			
		||||
			if (backup.full())
 | 
			
		||||
			TFilename backup = get(F_BACKUP);
 | 
			
		||||
      expand_sys_vars(backup);
 | 
			
		||||
			if (backup.exist())
 | 
			
		||||
			{    
 | 
			
		||||
        const TSheet_field& sf = sfield(F_MESSAGES);	
 | 
			
		||||
 | 
			
		||||
        TString id;
 | 
			
		||||
    		TFilename file;
 | 
			
		||||
				TString id;
 | 
			
		||||
			  TSheet_field& sf = sfield(F_MESSAGES);
 | 
			
		||||
				
 | 
			
		||||
				sh_row.get(sf.cid2index(F_ID), id);
 | 
			
		||||
				sh_row.get(sf.cid2index(F_SENDER), file); // Cartella di provenienza
 | 
			
		||||
								file.add(id);
 | 
			
		||||
				file.add(id);
 | 
			
		||||
				file.ext("ini");
 | 
			
		||||
 | 
			
		||||
				TFilename dest(backup);
 | 
			
		||||
 | 
			
		||||
				if (!is_slash(dest[dest.len() - 1]))
 | 
			
		||||
					dest << '/';
 | 
			
		||||
				dest << file.name();
 | 
			
		||||
				dest << fcopy(tmp, dest);
 | 
			
		||||
				TFilename dest = backup;
 | 
			
		||||
				dest.add(file.name());
 | 
			
		||||
        fcopy(tmp, dest);
 | 
			
		||||
			}
 | 
			
		||||
    }     
 | 
			
		||||
    remove_file(tmp);
 | 
			
		||||
    tmp.fremove();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  track(msg, appname, action, err);
 | 
			
		||||
@ -1177,7 +1175,9 @@ void TMailer_mask::save_all_lines()
 | 
			
		||||
  TViswin& vv = bf.vis_win();
 | 
			
		||||
 | 
			
		||||
  TString msg;
 | 
			
		||||
  const struct tm* d = xvt_time_now();
 | 
			
		||||
  
 | 
			
		||||
  time_t tempo; time(&tempo);
 | 
			
		||||
  const struct tm* d = localtime(&tempo);
 | 
			
		||||
  msg.format(FR("- Inizio elaborazione: %02d-%02d-%04d %02d:%02d:%02d"), 
 | 
			
		||||
             d->tm_mday, d->tm_mon+1, 1900+d->tm_year,
 | 
			
		||||
             d->tm_hour, d->tm_min, d->tm_sec);
 | 
			
		||||
@ -1232,7 +1232,8 @@ void TMailer_mask::save_all_lines()
 | 
			
		||||
    vv.add_line(msg);
 | 
			
		||||
  }      
 | 
			
		||||
  
 | 
			
		||||
  d = xvt_time_now();
 | 
			
		||||
  time(&tempo);
 | 
			
		||||
  d = localtime(&tempo);
 | 
			
		||||
  msg.format("- Fine elaborazione: %02d-%02d-%04d %02d:%02d:%02d", 
 | 
			
		||||
             d->tm_mday, d->tm_mon+1, 1900+d->tm_year,
 | 
			
		||||
             d->tm_hour, d->tm_min, d->tm_sec);
 | 
			
		||||
@ -1500,6 +1501,8 @@ TMailer_mask::~TMailer_mask()
 | 
			
		||||
// TMailer
 | 
			
		||||
///////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
const char* const appname = TR("Postino");
 | 
			
		||||
 | 
			
		||||
class TMailer : public TSkeleton_application
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
@ -1508,14 +1511,21 @@ public:
 | 
			
		||||
 | 
			
		||||
void TMailer::main_loop()
 | 
			
		||||
{
 | 
			
		||||
  WINDOW tray = xvt_trayicon_create(TASK_WIN, 0, appname);
 | 
			
		||||
 | 
			
		||||
  open_files(LF_USER, 0);
 | 
			
		||||
  TMailer_mask mm;
 | 
			
		||||
  mm.run();
 | 
			
		||||
 | 
			
		||||
  xvt_trayicon_destroy(tray);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ba7100(int argc, char* argv[])
 | 
			
		||||
{
 | 
			
		||||
  long style = xvt_vobj_get_attr(NULL_WIN, ATTR_WIN_PM_TWIN_STARTUP_STYLE);
 | 
			
		||||
  style |= WSF_NO_TASKBAR;
 | 
			
		||||
  xvt_vobj_set_attr(NULL_WIN, ATTR_WIN_PM_TWIN_STARTUP_STYLE, style);
 | 
			
		||||
  TMailer app;
 | 
			
		||||
  app.run(argc, argv, TR("Postino"));
 | 
			
		||||
  app.run(argc, argv, appname);
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -956,7 +956,7 @@ void TQuery_mask::save_as(TRecordsetExportFormat fmt)
 | 
			
		||||
bool TQuery_mask::get_qry_path(TFilename& path) const
 | 
			
		||||
{
 | 
			
		||||
  const TString& name = get(F_CODICE);
 | 
			
		||||
  const bool ok = name.not_empty();
 | 
			
		||||
  const bool ok = name.full();
 | 
			
		||||
  if (ok)
 | 
			
		||||
  {
 | 
			
		||||
    path = name;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user