Patch level :4.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :passaggio parametri alla pagina riassuntiva


git-svn-id: svn://10.65.10.50/trunk@15534 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-07-31 10:11:16 +00:00
parent 71e25ca8ad
commit 14a68e6c42

View File

@ -221,8 +221,18 @@ class CampoWizard : public wxWizard
{ {
enum { m_nPages = 10 }; enum { m_nPages = 10 };
CampoWizardPage* m_pPage[m_nPages]; CampoWizardPage* m_pPage[m_nPages];
wxString _destination_path; //path di aggiornamento/installazione
unsigned int _installation_type; //tipo di installazione selezionata (standard,server,client...) wxString _strDestinationPath; //path di aggiornamento/installazione
unsigned int _strInstallationType; //tipo di installazione selezionata (standard,server,client...)
wxString _strPrgLocPath; //path programmi in locale
wxString _strPrgNetPath; //path programmi in remoto (server prg dir per client)
wxString _strDataPath; //path dati
wxString _strAuthSrv; //nome server authoriz
wxString _strDictSrv; //nome server diction
bool _bInstUseAuth; //installa/usa server authoriz
bool _bInstUseDict; //installa/usa server diction
protected: protected:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
@ -240,6 +250,13 @@ public:
void SetInstallationType(const unsigned int type); void SetInstallationType(const unsigned int type);
const unsigned int GetInstallationType() const; const unsigned int GetInstallationType() const;
void SetPrgLocPath(const wxString& strPrgLocPath);
const wxString& GetPrgLocPath() const;
void SetPrgNetPath(const wxString& strPrgNetPath);
const wxString& GetPrgNetPath() const;
void SetDataPath(const wxString& strDataPath);
const wxString& GetDataPath() const;
CampoWizard(wxWindow* pParent); CampoWizard(wxWindow* pParent);
}; };
@ -350,7 +367,8 @@ CampoWizardPage1::CampoWizardPage1(wxWizard* parent) : CampoWizardPage(parent)
//contenuto della prima schermata (pagina benvenuto) //contenuto della prima schermata (pagina benvenuto)
wxString strTitle = wxT("Benvenuti in <b>APPNAME</b>"); wxString strTitle = wxT("Benvenuti in <b>APPNAME</b>");
wxString strBody = wxT("<p>Questo programma vi guiderà passo a passo nell'installazione / aggiornamento del software.</p>"); wxString strBody = wxT("<p>Questo programma vi guiderà passo a passo nell'installazione / aggiornamento del software.</p>");
strBody += wxT("<p>Prima di proseguire con l'installazione assicurarsi di avere effettuato il login a Windows con un utente di tipo 'Amministratore'.</p>"); strBody += wxT("<p><u>Leggere attentamente le istruzioni</u> che saranno visualizzate nelle finestre di questo programma di installazione!</p>");
strBody += wxT("<p>Prima di proseguire con l'installazione / aggiornamento <u>assicurarsi di avere effettuato il login a Windows con un utente di tipo 'Amministratore' di sistema.</u></p>");
SetHTMLText(strTitle, strBody); SetHTMLText(strTitle, strBody);
} }
@ -889,10 +907,21 @@ void CampoWizardPage6::OnDirPick(wxCommandEvent& e)
//metodo per il controllo dell'area dati;se la directory indicata non e' vuota non puoi usarla ne' crearla //metodo per il controllo dell'area dati;se la directory indicata non e' vuota non puoi usarla ne' crearla
bool CampoWizardPage6::ForwardValidate() bool CampoWizardPage6::ForwardValidate()
{ {
wxDir dirDataPath(Get(603)); //controllo esistenza directory vuota per i programmi in locale
if (dirDataPath.Exists(Get(603)) && (dirDataPath.HasFiles() || dirDataPath.HasSubDirs())) const wxString strPrgLocPath = Get(601);
wxDir dirPrgLocPath(strPrgLocPath);
if (dirPrgLocPath.Exists(Get(601)) && (dirPrgLocPath.HasFiles() || dirPrgLocPath.HasSubDirs()))
return ErrorBox("La cartella selezionata per l'installazione dei programmi NON e' valida! Selezionarne un'altra!");
const wxString strDataPath = Get(603);
wxDir dirDataPath(strDataPath);
if (dirDataPath.Exists(strDataPath) && (dirDataPath.HasFiles() || dirDataPath.HasSubDirs()))
return ErrorBox("La cartella indicata per la creazione dell'area dati non e' vuota! Selezionarne un'altra!"); return ErrorBox("La cartella indicata per la creazione dell'area dati non e' vuota! Selezionarne un'altra!");
//setta alla pagina riassuntiva i valori della pagina attuale
GetWizard().SetPrgLocPath(strPrgLocPath);
GetWizard().SetDataPath(strDataPath);
return true; return true;
} }
@ -985,10 +1014,22 @@ void CampoWizardPage7::OnSrvClick(wxCommandEvent& e)
bool CampoWizardPage7::ForwardValidate() bool CampoWizardPage7::ForwardValidate()
{ {
wxDir dirDataPath(Get(703)); //controllo esistenza directory vuota per i programmi in locale
if (dirDataPath.Exists(Get(703)) && (dirDataPath.HasFiles() || dirDataPath.HasSubDirs())) const wxString strPrgLocPath = Get(701);
wxDir dirPrgLocPath(strPrgLocPath);
if (dirPrgLocPath.Exists(strPrgLocPath) && (dirPrgLocPath.HasFiles() || dirPrgLocPath.HasSubDirs()))
return ErrorBox("La cartella selezionata per l'installazione dei programmi NON e' valida! Selezionarne un'altra!");
//controllo della directory dell'area dati: deve essere nuova o vuota affinche' possa essere utilizzata!!
const wxString strDataPath = Get(703);
wxDir dirDataPath(strDataPath);
if (dirDataPath.Exists(strDataPath) && (dirDataPath.HasFiles() || dirDataPath.HasSubDirs()))
return ErrorBox("La cartella indicata per la creazione dell'area dati non e' vuota! Selezionarne un'altra!"); return ErrorBox("La cartella indicata per la creazione dell'area dati non e' vuota! Selezionarne un'altra!");
//setta alla pagina riassuntiva i valori della pagina attuale
GetWizard().SetPrgLocPath(strPrgLocPath);
GetWizard().SetDataPath(strDataPath);
return true; return true;
} }
@ -1054,6 +1095,8 @@ CampoWizardPage7::CampoWizardPage7(wxWizard* parent) : CampoWizardPage(parent)
tcDiction->Disable(); tcDiction->Disable();
gbsSizer->Add(tcDiction, wxGBPosition(3, 2)); gbsSizer->Add(tcDiction, wxGBPosition(3, 2));
} }
/**********************************************************************************************************/ /**********************************************************************************************************/
// 8 Installazione client // 8 Installazione client
/**********************************************************************************************************/ /**********************************************************************************************************/
@ -1099,14 +1142,20 @@ void CampoWizardPage8::OnSrvClick(wxCommandEvent& e)
bool CampoWizardPage8::ForwardValidate() bool CampoWizardPage8::ForwardValidate()
{ {
//controllo esistenza programmi sul server //controllo esistenza directory vuota per i programmi in locale
const wxString strPrgPath = Get(803); const wxString strPrgLocPath = Get(801);
wxDir dirPrgPath(strPrgPath); wxDir dirPrgLocPath(strPrgLocPath);
if (dirPrgLocPath.Exists(strPrgLocPath) && (dirPrgLocPath.HasFiles() || dirPrgLocPath.HasSubDirs()))
return ErrorBox("La cartella selezionata per l'installazione dei programmi NON e' valida! Selezionarne un'altra!");
//controllo esistenza directory e programmi sul server
const wxString strPrgNetPath = Get(803);
wxDir dirPrgPath(strPrgNetPath);
bool ok_prg = false; bool ok_prg = false;
//deve esistere non vuota, e contenere almeno campo.ini,install.ini,campo.aut,ba0.exe //deve esistere non vuota, e contenere almeno campo.ini,install.ini,campo.aut,ba0.exe
if (dirPrgPath.Exists(strPrgPath) && dirPrgPath.HasFiles() && dirPrgPath.HasSubDirs()) if (dirPrgPath.Exists(strPrgNetPath) && dirPrgPath.HasFiles() && dirPrgPath.HasSubDirs())
{ {
wxFileName fnFileToCheck(strPrgPath, "campo"); wxFileName fnFileToCheck(strPrgNetPath, "campo");
fnFileToCheck.SetExt("ini"); fnFileToCheck.SetExt("ini");
if (fnFileToCheck.FileExists()) if (fnFileToCheck.FileExists())
{ {
@ -1146,6 +1195,12 @@ bool CampoWizardPage8::ForwardValidate()
} }
if (!ok_data) if (!ok_data)
return ErrorBox("La cartella selezionata come area dati NON e' valida!"); return ErrorBox("La cartella selezionata come area dati NON e' valida!");
//setta alla pagina riassuntiva i valori della pagina attuale
GetWizard().SetPrgLocPath(strPrgLocPath);
GetWizard().SetPrgNetPath(strPrgNetPath);
GetWizard().SetDataPath(strDataPath);
return true; return true;
} }
@ -1235,7 +1290,26 @@ public:
bool CampoWizardPage9::TransferDataToWindow() bool CampoWizardPage9::TransferDataToWindow()
{ {
const unsigned int uTipoInstall = GetWizard().GetInstallationType(); CampoWizard& cw = GetWizard();
const unsigned int uInstallType = cw.GetInstallationType();
switch (uInstallType)
{
case 1: //server
cw.GetPrgLocPath();
cw.GetDataPath();
break;
case 2: //client
cw.GetPrgLocPath();
cw.GetPrgNetPath();
cw.GetDataPath();
break;
case 3: //aggiornamento
break;
default: //standard
cw.GetPrgLocPath();
cw.GetDataPath();
break;
}
return true; return true;
} }
@ -1318,10 +1392,10 @@ bool CampoWizard::GetBool(wxWindowID id) const
void CampoWizard::SetDestinationPath(const wxString& path) void CampoWizard::SetDestinationPath(const wxString& path)
{ {
_destination_path = path; _strDestinationPath = path;
//Se il path di destinazione e' vuoto -> nuova installazione, senno' e' un aggiornamento della installazione.. //Se il path di destinazione e' vuoto -> nuova installazione, senno' e' un aggiornamento della installazione..
//..che sta in _destination_path //..che sta in _strDestinationPath
if (_destination_path.IsEmpty()) if (_strDestinationPath.IsEmpty())
{ {
wxWizardPageSimple::Chain(m_pPage[1], m_pPage[2]); wxWizardPageSimple::Chain(m_pPage[1], m_pPage[2]);
} }
@ -1333,14 +1407,14 @@ void CampoWizard::SetDestinationPath(const wxString& path)
const wxString& CampoWizard::GetDestinationPath() const const wxString& CampoWizard::GetDestinationPath() const
{ {
return _destination_path; return _strDestinationPath;
} }
void CampoWizard::SetInstallationType(const unsigned int type) void CampoWizard::SetInstallationType(const unsigned int type)
{ {
_installation_type = type; _strInstallationType = type;
//in base al tipo di installazione spara l'utente alla pagina corretta //in base al tipo di installazione spara l'utente alla pagina corretta
switch (_installation_type) switch (_strInstallationType)
{ {
case 1: //server case 1: //server
wxWizardPageSimple::Chain(m_pPage[4], m_pPage[6]); //manda l'utente alla pagina server wxWizardPageSimple::Chain(m_pPage[4], m_pPage[6]); //manda l'utente alla pagina server
@ -1361,7 +1435,37 @@ void CampoWizard::SetInstallationType(const unsigned int type)
const unsigned int CampoWizard::GetInstallationType() const const unsigned int CampoWizard::GetInstallationType() const
{ {
return _installation_type; return _strInstallationType;
}
void CampoWizard::SetPrgLocPath(const wxString& strPrgLocPath)
{
_strPrgLocPath = strPrgLocPath;
}
const wxString& CampoWizard::GetPrgLocPath() const
{
return _strPrgLocPath;
}
void CampoWizard::SetPrgNetPath(const wxString& strPrgNetPath)
{
_strPrgNetPath = strPrgNetPath;
}
const wxString& CampoWizard::GetPrgNetPath() const
{
return _strPrgNetPath;
}
void CampoWizard::SetDataPath(const wxString& strDataPath)
{
_strDataPath = strDataPath;
}
const wxString& CampoWizard::GetDataPath() const
{
return _strDataPath;
} }
CampoWizard::CampoWizard(wxWindow* pParent) CampoWizard::CampoWizard(wxWindow* pParent)