Patch level :4.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :risolto il problema di asimmetria comportamento next/back git-svn-id: svn://10.65.10.50/trunk@15529 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8ead286823
commit
4a3383690c
183
setup/Setup.cpp
183
setup/Setup.cpp
@ -225,8 +225,10 @@ class CampoWizard : public wxWizard
|
||||
unsigned int _installation_type; //tipo di installazione selezionata (standard,server,client...)
|
||||
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE();
|
||||
int Pages() const { return m_nPages; }
|
||||
CampoWizardPage* Page(int p) const { return m_pPage[p]; }
|
||||
void OnNext(wxCommandEvent& e);
|
||||
|
||||
public:
|
||||
bool Run();
|
||||
@ -241,6 +243,9 @@ public:
|
||||
CampoWizard(wxWindow* pParent);
|
||||
};
|
||||
|
||||
////////////////////////////
|
||||
|
||||
|
||||
//Campo wizard page (pagina generica del programma, di cui saranno figlie le singole pagine)
|
||||
class CampoWizardPage : public wxWizardPageSimple
|
||||
{
|
||||
@ -254,6 +259,7 @@ protected:
|
||||
void AddLabel(wxGridBagSizer* pSizer, const wxChar* label, unsigned int row, unsigned int column);
|
||||
|
||||
public:
|
||||
virtual bool ForwardValidate() { return true; }
|
||||
wxString Get(wxWindowID id) const;
|
||||
bool Set(wxWindowID id, const wxString& str);
|
||||
int GetSelection(wxWindowID id) const;
|
||||
@ -357,13 +363,13 @@ class CampoWizardPage2 : public CampoWizardPage
|
||||
wxRadioBox* m_pRadioBox;
|
||||
|
||||
protected:
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool ForwardValidate();
|
||||
|
||||
public:
|
||||
CampoWizardPage2(wxWizard* parent);
|
||||
};
|
||||
|
||||
bool CampoWizardPage2::TransferDataFromWindow()
|
||||
bool CampoWizardPage2::ForwardValidate()
|
||||
{
|
||||
const int last_row = m_pRadioBox->GetRowCount() - 1;
|
||||
const int selected_row = m_pRadioBox->GetSelection();
|
||||
@ -401,9 +407,9 @@ CampoWizardPage2::CampoWizardPage2(wxWizard* parent) : CampoWizardPage(parent)
|
||||
//sono installazioni valide quelle che presentano la coppia di files campo.ini e campo.aut (senza..
|
||||
//..questi 2 soggetti il programma non parte)
|
||||
wxString campo_ini = path;
|
||||
campo_ini << "\\campo.ini";
|
||||
campo_ini << "/campo.ini";
|
||||
wxString campo_aut = path;
|
||||
campo_aut << "\\campo.aut";
|
||||
campo_aut << "/campo.aut";
|
||||
if (wxFileName::FileExists(campo_ini) && wxFileName::FileExists(campo_aut))
|
||||
{
|
||||
asCampi.Add(path);
|
||||
@ -456,13 +462,13 @@ CampoWizardPage2::CampoWizardPage2(wxWizard* parent) : CampoWizardPage(parent)
|
||||
class CampoWizardPage3 : public CampoWizardPage
|
||||
{
|
||||
protected:
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool ForwardValidate();
|
||||
|
||||
public:
|
||||
CampoWizardPage3(wxWizard* parent);
|
||||
};
|
||||
|
||||
bool CampoWizardPage3::TransferDataFromWindow()
|
||||
bool CampoWizardPage3::ForwardValidate()
|
||||
{
|
||||
if (GetSelection(301) == 1)
|
||||
return ErrorBox("Impossibile proseguire se non si accetta la licenza sul software!!");
|
||||
@ -802,13 +808,13 @@ class CampoWizardPage5 : public CampoWizardPage
|
||||
wxRadioBox* m_pRadioBox;
|
||||
|
||||
protected:
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool ForwardValidate();
|
||||
|
||||
public:
|
||||
CampoWizardPage5(wxWizard* parent);
|
||||
};
|
||||
|
||||
bool CampoWizardPage5::TransferDataFromWindow()
|
||||
bool CampoWizardPage5::ForwardValidate()
|
||||
{
|
||||
const unsigned int type = m_pRadioBox->GetSelection();
|
||||
GetWizard().SetInstallationType(type);
|
||||
@ -851,7 +857,7 @@ class CampoWizardPage6 : public CampoWizardPage
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE();
|
||||
void OnDirPick(wxCommandEvent& e);
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool ForwardValidate();
|
||||
|
||||
public:
|
||||
CampoWizardPage6(wxWizard* parent);
|
||||
@ -876,7 +882,7 @@ void CampoWizardPage6::OnDirPick(wxCommandEvent& e)
|
||||
}
|
||||
|
||||
//metodo per il controllo dell'area dati;se la directory indicata non e' vuota non puoi usarla ne' crearla
|
||||
bool CampoWizardPage6::TransferDataFromWindow()
|
||||
bool CampoWizardPage6::ForwardValidate()
|
||||
{
|
||||
wxDir dirDataPath(Get(603));
|
||||
if (dirDataPath.Exists(Get(603)) && (dirDataPath.HasFiles() || dirDataPath.HasSubDirs()))
|
||||
@ -917,7 +923,7 @@ CampoWizardPage6::CampoWizardPage6(wxWizard* parent) : CampoWizardPage(parent)
|
||||
//prompt
|
||||
AddLabel(gbsSizer, "Cartella dati", 1, 0);
|
||||
//campo testo
|
||||
strPath += "\\dati";
|
||||
strPath += "/dati";
|
||||
wxTextCtrl* tcDataPath = new wxTextCtrl(this, 603, strPath, wxDefaultPosition, wxSize(320,-1));
|
||||
gbsSizer->Add(tcDataPath, wxGBPosition(1, 1));
|
||||
//bottone 'sfoglia'
|
||||
@ -937,7 +943,8 @@ class CampoWizardPage7 : public CampoWizardPage
|
||||
{
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE();
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool ForwardValidate();
|
||||
void OnDirPick(wxCommandEvent& e);
|
||||
void OnSrvClick(wxCommandEvent& e);
|
||||
|
||||
public:
|
||||
@ -945,10 +952,25 @@ public:
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(CampoWizardPage7, CampoWizardPage)
|
||||
EVT_BUTTON(702, OnDirPick)
|
||||
EVT_BUTTON(704, OnDirPick)
|
||||
EVT_CHECKBOX(705, OnSrvClick)
|
||||
EVT_CHECKBOX(707, OnSrvClick)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void CampoWizardPage7::OnDirPick(wxCommandEvent& e)
|
||||
{
|
||||
const wxWindowID wiTargetField = e.GetId() - 1;
|
||||
wxString strPath = Get(wiTargetField);
|
||||
wxDirDialog dlg(this, wxDirSelectorPromptStr, strPath,
|
||||
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
strPath = dlg.GetPath();
|
||||
Set(wiTargetField, strPath);
|
||||
}
|
||||
}
|
||||
|
||||
void CampoWizardPage7::OnSrvClick(wxCommandEvent& e)
|
||||
{
|
||||
wxWindow* pWnd = FindWindowById(e.GetId() + 1);
|
||||
@ -956,8 +978,12 @@ void CampoWizardPage7::OnSrvClick(wxCommandEvent& e)
|
||||
pWnd->Enable(e.IsChecked());
|
||||
}
|
||||
|
||||
bool CampoWizardPage7::TransferDataFromWindow()
|
||||
bool CampoWizardPage7::ForwardValidate()
|
||||
{
|
||||
wxDir dirDataPath(Get(703));
|
||||
if (dirDataPath.Exists(Get(703)) && (dirDataPath.HasFiles() || dirDataPath.HasSubDirs()))
|
||||
return ErrorBox("La cartella indicata per la creazione dell'area dati non e' vuota! Selezionarne un'altra!");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -965,8 +991,10 @@ CampoWizardPage7::CampoWizardPage7(wxWizard* parent) : CampoWizardPage(parent)
|
||||
{
|
||||
wxString strTitle = wxT("Installazione di tipo Server");
|
||||
wxString strBody = wxT("<p>Digitare nel campo <b>'Cartella programma'</b> il percorso completo della cartella dove si desidera installare il programma. ");
|
||||
strBody += wxT("Il percorso di default (consigliato) e' <i>C:\\Campo</i> </p>");
|
||||
strBody += wxT("<p>Le cartella del programma e dei dati <b>dovranno essere condivise in modalita' lettura/scrittura</b> agli utenti di sistema e di rete che utilizzeranno il software <b><i>Campo</i></b>. ");
|
||||
strBody += wxT("Il percorso consigliato e' <i>C:\\Campo</i> </p>");
|
||||
strBody += wxT("<p>Digitare nel campo <b>'Cartella dati'</b> il percorso completo della cartella dove si desidera installare l'area dati. ");
|
||||
strBody += wxT("Il percorso consigliato e' <i>C:\\Campo\\dati</i> </p>");
|
||||
strBody += wxT("<p>Le cartelle del programma e dei dati <b><u>dovranno essere condivise in modalita' lettura/scrittura</u></b> agli utenti di sistema e di rete che utilizzeranno il software <b><i>Campo</i></b>. ");
|
||||
strBody += wxT("In mancanza di tale condivisione nessun client potra' accedere al server!</p>");
|
||||
strBody += wxT("<p><b>Gestore autorizzazioni:</b> e' il software che permette di gestire una chiave di protezione hardware multiutenza condivisa in rete. ");
|
||||
strBody += wxT("Installando tale software e' necessario specificare il computer su cui e' montata la chiave di protezione multiutenza.");
|
||||
@ -994,7 +1022,7 @@ CampoWizardPage7::CampoWizardPage7(wxWizard* parent) : CampoWizardPage(parent)
|
||||
//prompt
|
||||
AddLabel(gbsSizer, "Cartella dati", 1, 0);
|
||||
//campo testo
|
||||
strPath += "\\dati";
|
||||
strPath += "/dati";
|
||||
wxTextCtrl* tcDataPath = new wxTextCtrl(this, 703, strPath, wxDefaultPosition, wxSize(320,-1));
|
||||
gbsSizer->Add(tcDataPath, wxGBPosition(1, 1));
|
||||
//bottone 'sfoglia'
|
||||
@ -1027,15 +1055,104 @@ CampoWizardPage7::CampoWizardPage7(wxWizard* parent) : CampoWizardPage(parent)
|
||||
class CampoWizardPage8 : public CampoWizardPage
|
||||
{
|
||||
protected:
|
||||
DECLARE_EVENT_TABLE();
|
||||
virtual bool ForwardValidate();
|
||||
void OnDirPick(wxCommandEvent& e);
|
||||
void OnSrvClick(wxCommandEvent& e);
|
||||
|
||||
public:
|
||||
CampoWizardPage8(wxWizard* parent);
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(CampoWizardPage8, CampoWizardPage)
|
||||
EVT_BUTTON(802, OnDirPick)
|
||||
EVT_BUTTON(804, OnDirPick)
|
||||
EVT_BUTTON(806, OnDirPick)
|
||||
EVT_CHECKBOX(807, OnSrvClick)
|
||||
EVT_CHECKBOX(809, OnSrvClick)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void CampoWizardPage8::OnDirPick(wxCommandEvent& e)
|
||||
{
|
||||
const wxWindowID wiTargetField = e.GetId() - 1;
|
||||
wxString strPath = Get(wiTargetField);
|
||||
wxDirDialog dlg(this, wxDirSelectorPromptStr, strPath,
|
||||
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
strPath = dlg.GetPath();
|
||||
Set(wiTargetField, strPath);
|
||||
}
|
||||
}
|
||||
|
||||
void CampoWizardPage8::OnSrvClick(wxCommandEvent& e)
|
||||
{
|
||||
wxWindow* pWnd = FindWindowById(e.GetId() + 1);
|
||||
if (pWnd)
|
||||
pWnd->Enable(e.IsChecked());
|
||||
}
|
||||
|
||||
bool CampoWizardPage8::ForwardValidate()
|
||||
{
|
||||
//controllo esistenza programmi sul server
|
||||
const wxString strPrgPath = Get(803);
|
||||
wxDir dirPrgPath(strPrgPath);
|
||||
bool ok_prg = false;
|
||||
//deve esistere non vuota, e contenere almeno campo.ini,install.ini,campo.aut,ba0.exe
|
||||
if (dirPrgPath.Exists(strPrgPath) && dirPrgPath.HasFiles() && dirPrgPath.HasSubDirs())
|
||||
{
|
||||
wxFileName fnFileToCheck(strPrgPath, "campo");
|
||||
fnFileToCheck.SetExt("ini");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("install");
|
||||
fnFileToCheck.SetExt("ini");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("campo");
|
||||
fnFileToCheck.SetExt("aut");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
fnFileToCheck.SetName("ba0");
|
||||
fnFileToCheck.SetExt("exe");
|
||||
if (fnFileToCheck.FileExists())
|
||||
{
|
||||
ok_prg = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ok_prg)
|
||||
return ErrorBox("La cartella selezionata come origine dei programmi NON e' valida!");
|
||||
|
||||
//controllo esistenza dati sul server
|
||||
wxString strDataPath = Get(805);
|
||||
wxDir dirDataPath(strDataPath);
|
||||
bool ok_data = false;
|
||||
//deve esistere non vuota, e contenere la sottodirectory "com" con i dati comuni
|
||||
if (dirDataPath.Exists(strDataPath) && dirDataPath.HasSubDirs("com"))
|
||||
{
|
||||
strDataPath << "/com";
|
||||
wxFileName fnFileToCheck(strDataPath, "tabcom");
|
||||
fnFileToCheck.SetExt("dbf");
|
||||
if (fnFileToCheck.FileExists())
|
||||
ok_data = true;
|
||||
}
|
||||
if (!ok_data)
|
||||
return ErrorBox("La cartella selezionata come area dati NON e' valida!");
|
||||
return true;
|
||||
}
|
||||
|
||||
CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
|
||||
{
|
||||
wxString strTitle = wxT("Installazione di tipo Client");
|
||||
wxString strBody = wxT("<p>Digitare nel campo <b>'Cartella locale programma'</b> il percorso completo della cartella dove si desidera installare il programma. ");
|
||||
strBody += wxT("Il percorso di default (consigliato) e' <i>C:\\Campo</i> </p>");
|
||||
strBody += wxT("Il percorso consigliato e' <i>C:\\Campo</i> </p>");
|
||||
strBody += wxT("<p>Digitare nel campo <b>'Cartella remota origine programmi'</b> il percorso completo della cartella di rete dove sono i files origine del programma. ");
|
||||
strBody += wxT("E' la cartella di programmi condivisa dal server precedentemente installato.</p>");
|
||||
strBody += wxT("<p>Digitare nel campo <b>'Cartella remota dati da utilizzare'</b> il percorso completo della cartella di rete dove sono i dati. ");
|
||||
strBody += wxT("E' la cartella dei dati condivisa dal server precedentemente installato.</p>");
|
||||
SetHTMLText(strTitle, strBody);
|
||||
|
||||
//griglia per sistemare i campi
|
||||
@ -1071,13 +1188,33 @@ CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
|
||||
//prompt
|
||||
AddLabel(gbsSizer, "Cartella remota dati da utilizzare", 2, 0);
|
||||
//campo testo
|
||||
strPath += "\\dati";
|
||||
strPath += "/dati";
|
||||
wxTextCtrl* tcDataPath = new wxTextCtrl(this, 805, strPath, wxDefaultPosition, wxSize(320,-1));
|
||||
gbsSizer->Add(tcDataPath, wxGBPosition(2, 1));
|
||||
//bottone 'sfoglia'
|
||||
wxButton* bDataButton = new wxButton(this, 806, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
|
||||
gbsSizer->Add(bDataButton, wxGBPosition(2, 2));
|
||||
|
||||
//quarta riga della griglia
|
||||
//check usa authoriz
|
||||
wxCheckBox* chAuthoriz = new wxCheckBox(this, 807, wxT("Utilizza il gestore delle autorizzazioni"));
|
||||
chAuthoriz->SetValue(false);
|
||||
gbsSizer->Add(chAuthoriz, wxGBPosition(3, 1));
|
||||
//quale e' il server authoriz
|
||||
wxTextCtrl* tcAuthoriz = new wxTextCtrl(this, 808, "nomeserverautorizzazioni", wxDefaultPosition, wxSize(96,-1));
|
||||
tcAuthoriz->Disable();
|
||||
gbsSizer->Add(tcAuthoriz, wxGBPosition(3, 2));
|
||||
|
||||
//quarta riga della griglia
|
||||
//check usa diction
|
||||
wxCheckBox* chDictionary = new wxCheckBox(this, 809, wxT("Utilizza il gestore dei dizionari"));
|
||||
chDictionary->SetValue(false);
|
||||
gbsSizer->Add(chDictionary, wxGBPosition(4, 1));
|
||||
//quale e' il server diction
|
||||
wxTextCtrl* tcDiction = new wxTextCtrl(this, 810, "nomeserverdizionario", wxDefaultPosition, wxSize(96,-1));
|
||||
tcDiction->Disable();
|
||||
gbsSizer->Add(tcDiction, wxGBPosition(4, 2));
|
||||
|
||||
}
|
||||
/**********************************************************************************************************/
|
||||
//pagina con la selezione di destinazione
|
||||
@ -1129,6 +1266,16 @@ CampoWizardPage10::CampoWizardPage10(wxWizard* parent) : CampoWizardPage(parent)
|
||||
// CampoWizard
|
||||
///////////////////////////////////////////////////////////
|
||||
//la dichiarazione della classe e' prima in quanto alcuni suoi metodi sono usati da altre classi scritte piu' su
|
||||
BEGIN_EVENT_TABLE(CampoWizard, wxWizard)
|
||||
EVT_BUTTON(wxID_FORWARD, CampoWizard::OnNext)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void CampoWizard::OnNext(wxCommandEvent& e)
|
||||
{
|
||||
CampoWizardPage* p = (CampoWizardPage*)GetCurrentPage();
|
||||
if (p->ForwardValidate())
|
||||
e.Skip();
|
||||
}
|
||||
|
||||
bool CampoWizard::Run()
|
||||
{ return RunWizard(Page(0)); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user