Patch level :4.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :iniziata installazione server


git-svn-id: svn://10.65.10.50/trunk@15519 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-07-25 14:33:55 +00:00
parent ff8ef41194
commit 942d516ec4

View File

@ -30,14 +30,16 @@ extern "C"
///////////////////////////////////////////////////////////
// Utilities
///////////////////////////////////////////////////////////
void ErrorBox(LPCSTR str)
bool ErrorBox(LPCSTR str)
{
wxMessageBox(str, "Installazione", wxOK | wxICON_ERROR);
wxMessageBox(str, APPNAME, wxOK | wxICON_ERROR);
return false;
}
void WarningBox(LPCSTR str)
bool WarningBox(LPCSTR str)
{
wxMessageBox(str, "Installazione", wxOK | wxICON_EXCLAMATION);
wxMessageBox(str, APPNAME, wxOK | wxICON_EXCLAMATION);
return false;
}
wxString GetDefaultDestination()
@ -217,7 +219,7 @@ class CampoWizardPage; //predefinizione di CampoWizardPage (magia nera!!)
//predefinizione pure della CampoWizard con tutti i suoi metodi per poterlo usare nel metodo GetWizard (magia nerissima!!)
class CampoWizard : public wxWizard
{
enum { m_nPages = 11 };
enum { m_nPages = 10 };
CampoWizardPage* m_pPage[m_nPages];
wxString _destination_path; //path di aggiornamento/installazione
unsigned int _installation_type; //tipo di installazione selezionata (standard,server,client...)
@ -463,10 +465,8 @@ public:
bool CampoWizardPage3::TransferDataFromWindow()
{
if (GetSelection(301) == 1)
{
wxMessageBox("Impossibile proseguire se non si accetta la licenza sul software!!", APPNAME, wxICON_ERROR|wxOK);
return false;
}
return ErrorBox("Impossibile proseguire se non si accetta la licenza sul software!!");
return true;
}
@ -851,6 +851,7 @@ class CampoWizardPage6 : public CampoWizardPage
protected:
DECLARE_EVENT_TABLE();
void OnDirPick(wxCommandEvent& e);
virtual bool TransferDataFromWindow();
public:
CampoWizardPage6(wxWizard* parent);
@ -874,6 +875,16 @@ 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()
{
wxDir dirDataPath(Get(603));
if (dirDataPath.Exists(Get(603)) && (dirDataPath.HasFiles() || dirDataPath.HasSubDirs()))
return ErrorBox("La cartella indicata per la creazione dell'area dati non e' vuota! Selezionarne un'altra!");
return true;
}
CampoWizardPage6::CampoWizardPage6(wxWizard* parent) : CampoWizardPage(parent)
{
wxString strTitle = wxT("Installazione di tipo Standard");
@ -881,6 +892,8 @@ CampoWizardPage6::CampoWizardPage6(wxWizard* parent) : CampoWizardPage(parent)
strBody += wxT("Il percorso di default (consigliato) e' <i>C:\\Campo32</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 di default (consigliato) e' <i>C:\\Campo32\\dati</i> </p>");
strBody += wxT("<p><b>Dati dimostrativi:</b> area dati precompilata per esemplificare il funzionamento del software. ");
strBody += wxT("Di norma <b>NON</b> vanno caricati nel caso di una normale installazione!</p>");
SetHTMLText(strTitle, strBody);
//griglia per sistemare i campi
@ -895,7 +908,7 @@ CampoWizardPage6::CampoWizardPage6(wxWizard* parent) : CampoWizardPage(parent)
strPath = "C:\\";
strPath += APPNAME;
wxTextCtrl* tcPrgPath = new wxTextCtrl(this, 601, strPath,
wxDefaultPosition, wxSize(320,-1), wxTE_READONLY);
wxDefaultPosition, wxSize(320,-1));
gbsSizer->Add(tcPrgPath, wxGBPosition(0, 1));
//bottone 'sfoglia'
wxButton* bPrgButton = new wxButton(this, 602, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
@ -907,11 +920,16 @@ CampoWizardPage6::CampoWizardPage6(wxWizard* parent) : CampoWizardPage(parent)
//campo testo
strPath += "\\dati";
wxTextCtrl* tcDataPath = new wxTextCtrl(this, 603, strPath,
wxDefaultPosition, wxSize(320,-1), wxTE_READONLY);
wxDefaultPosition, wxSize(320,-1));
gbsSizer->Add(tcDataPath, wxGBPosition(1, 1));
//bottone 'sfoglia'
wxButton* bDataButton = new wxButton(this, 604, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
gbsSizer->Add(bDataButton, wxGBPosition(1, 2));
//terza riga della griglia
wxCheckBox* chDataDemo = new wxCheckBox(this, 605, wxT("Carica i dati dimostrativi"));
chDataDemo->SetValue(false);
gbsSizer->Add(chDataDemo, wxGBPosition(2, 0));
}
/**********************************************************************************************************/
@ -926,8 +944,41 @@ public:
CampoWizardPage7::CampoWizardPage7(wxWizard* parent) : CampoWizardPage(parent)
{
wxString strTitle = wxT("Installazione di tipo Server");
wxString strBody = wxT("Pagina 7. Installazione 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:\\Campo32</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("In mancanza di tale condivisione nessun client potra' accedere al server!</p>");
SetHTMLText(strTitle, strBody);
//griglia per sistemare i campi
wxGridBagSizer* gbsSizer = new wxGridBagSizer(VGAP, HGAP);
GetSizer()->Add(gbsSizer);
//prima riga della griglia
//prompt
AddLabel(gbsSizer, "Cartella programmi", 0, 0);
//campo testo
wxString strPath;
strPath = "C:\\";
strPath += APPNAME;
wxTextCtrl* tcPrgPath = new wxTextCtrl(this, 701, strPath,
wxDefaultPosition, wxSize(320,-1));
gbsSizer->Add(tcPrgPath, wxGBPosition(0, 1));
//bottone 'sfoglia'
wxButton* bPrgButton = new wxButton(this, 702, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
gbsSizer->Add(bPrgButton, wxGBPosition(0, 2));
//seconda riga della griglia
//prompt
AddLabel(gbsSizer, "Cartella dati", 1, 0);
//campo testo
strPath += "\\dati";
wxTextCtrl* tcDataPath = new wxTextCtrl(this, 703, strPath,
wxDefaultPosition, wxSize(320,-1));
gbsSizer->Add(tcDataPath, wxGBPosition(1, 1));
//bottone 'sfoglia'
wxButton* bDataButton = new wxButton(this, 704, wxT("Sfoglia"), wxDefaultPosition, wxSize(48, -1));
gbsSizer->Add(bDataButton, wxGBPosition(1, 2));
}
/**********************************************************************************************************/
// 8 Installazione client
@ -950,48 +1001,20 @@ CampoWizardPage8::CampoWizardPage8(wxWizard* parent) : CampoWizardPage(parent)
class CampoWizardPage9 : public CampoWizardPage
{
protected:
DECLARE_EVENT_TABLE();
void OnDirPick(wxCommandEvent& e);
public:
CampoWizardPage9(wxWizard* parent);
};
BEGIN_EVENT_TABLE(CampoWizardPage9, CampoWizardPage)
EVT_BUTTON(202, OnDirPick)
END_EVENT_TABLE()
void CampoWizardPage9::OnDirPick(wxCommandEvent& e)
{
wxFileName strPath = Get(201);
wxDirDialog dlg(this, wxDirSelectorPromptStr, strPath.GetPath(),
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
if (dlg.ShowModal() == wxID_OK)
{
strPath.Assign(dlg.GetPath(), APPNAME);
Set(201, strPath.GetFullPath());
}
}
CampoWizardPage9::CampoWizardPage9(wxWizard* parent) : CampoWizardPage(parent)
{
//seconda pagina
wxString strTitle = wxT("Selezione della cartella di destinazione");
wxString strBody = wxT("APPNAME verrà installato nella cartella selezionata");
wxString strTitle = wxT("Configurazione installazione");
wxString strBody = wxT("Configurazione dei parametri di installazione fin qui pocciati");
SetHTMLText(strTitle, strBody);
wxBoxSizer* pSizer = new wxBoxSizer(wxHORIZONTAL);
GetSizer()->Add(pSizer);
const wxFileName strPath(GetDefaultDestination(), APPNAME);
wxTextCtrl* pPath = new wxTextCtrl(this, 201, strPath.GetFullPath(),
wxDefaultPosition, wxSize(320,-1), wxTE_READONLY);
pSizer->Add(pPath, 0, wxALL, 0);
wxButton* pButton = new wxButton(this, 202, wxT("..."), wxDefaultPosition, wxSize(24, -1));
pSizer->Add(pButton, 0, wxALL, 0);
}
class CampoWizardPage10 : public CampoWizardPage
{
public:
@ -999,43 +1022,20 @@ public:
};
CampoWizardPage10::CampoWizardPage10(wxWizard* parent) : CampoWizardPage(parent)
{
wxString strTitle = wxT("<img src=opengl.gif></img>");
wxString strBody;
strBody += wxT("Attivando questa opzione verrà utilizzata l'accelerazione ");
strBody += wxT("hardware della scheda video installata, altrimenti il rendering ");
strBody += wxT("delle mappe sarà implementato via software (Mesa)");
SetHTMLText(strTitle, strBody);
wxArrayString aMode;
aMode.Add(wxT("Hardware (Maggiori prestazioni, minore compatibilità)"));
aMode.Add(wxT("Software (Maggiore compatibilità, minori prestazioni)"));
wxRadioBox* pBox = new wxRadioBox(this, 301, wxT("Accelerazione OpenGL"), wxDefaultPosition, wxDefaultSize,
aMode, 0, wxRA_VERTICAL);
GetSizer()->Add(pBox, 0, wxALL, 0);
}
class CampoWizardPage11 : public CampoWizardPage
{
public:
CampoWizardPage11(wxWizard* parent);
};
CampoWizardPage11::CampoWizardPage11(wxWizard* parent) : CampoWizardPage(parent)
{
wxString strTitle = wxT("Collegamenti");
wxString strBody;
strBody += wxT("E' possibile creare l'icona di APPNAME sul desktop ");
//strBody += wxT("ed associare l'estensione <b>.rs1<b> al programma.");
//strBody += wxT("ed associare l'estensione <b>.caz<b> al programma.");
SetHTMLText(strTitle, strBody);
wxCheckBox* pIcon = new wxCheckBox(this, 401, wxT("Creare l'icona sul desktop"));
wxCheckBox* pIcon = new wxCheckBox(this, 1001, wxT("Creare l'icona sul desktop"));
pIcon->SetValue(true);
GetSizer()->Add(pIcon, 0, wxALL, 0);
GetSizer()->AddSpacer(5);
//wxCheckBox* pLink = new wxCheckBox(this, 402, wxT("Associare i file .rs1 al programma"));
//wxCheckBox* pLink = new wxCheckBox(this, 1002, wxT("Associare i file .caz al programma"));
//pLink->SetValue(true);
//GetSizer()->Add(pLink, 0, wxALL, 0);
}
@ -1080,11 +1080,11 @@ void CampoWizard::SetDestinationPath(const wxString& path)
//..che sta in _destination_path
if (_destination_path.IsEmpty())
{
m_pPage[2]->Chain(m_pPage[1], m_pPage[2]);
wxWizardPageSimple::Chain(m_pPage[1], m_pPage[2]);
}
else
{
m_pPage[2]->Chain(m_pPage[3], m_pPage[8]);
wxWizardPageSimple::Chain(m_pPage[3], m_pPage[8]);
}
}
@ -1099,17 +1099,17 @@ void CampoWizard::SetInstallationType(const unsigned int type)
//in base al tipo di installazione spara l'utente alla pagina corretta
switch (_installation_type)
{
case 0: //standard
m_pPage[5]->Chain(m_pPage[4], m_pPage[5]);
break;
case 1: //server
m_pPage[5]->Chain(m_pPage[4], m_pPage[6]);
wxWizardPageSimple::Chain(m_pPage[4], m_pPage[6]); //manda l'utente alla pagina server
wxWizardPageSimple::Chain(m_pPage[6], m_pPage[8]); //manda l'utente alla pagina riassuntiva
break;
case 2: //client
m_pPage[5]->Chain(m_pPage[4], m_pPage[7]);
wxWizardPageSimple::Chain(m_pPage[4], m_pPage[7]);
wxWizardPageSimple::Chain(m_pPage[7], m_pPage[8]);
break;
default: //standard
m_pPage[5]->Chain(m_pPage[4], m_pPage[5]);
wxWizardPageSimple::Chain(m_pPage[4], m_pPage[5]);
wxWizardPageSimple::Chain(m_pPage[5], m_pPage[8]);
break;
}
}
@ -1127,20 +1127,20 @@ CampoWizard::CampoWizard(wxWindow* pParent)
Create(pParent, wxID_ANY, APPNAME, bitmap);
m_pPage[0] = new CampoWizardPage1(this); //pagina benvenuto con logo
m_pPage[1] = new CampoWizardPage2(this); //pagina scelta aggiornamento/tipo installazione
m_pPage[2] = new CampoWizardPage3(this); //pagina licenza
m_pPage[3] = new CampoWizardPage4(this); //pagina test ed installazione chiavi
m_pPage[4] = new CampoWizardPage5(this); //pagina selezione tipo installazione
m_pPage[5] = new CampoWizardPage6(this); //pagina installazione standard
m_pPage[6] = new CampoWizardPage7(this); //pagina installazione server
m_pPage[7] = new CampoWizardPage8(this); //pagina installazione client
m_pPage[8] = new CampoWizardPage9(this);
m_pPage[9] = new CampoWizardPage10(this);
m_pPage[10] = new CampoWizardPage11(this);
m_pPage[0] = new CampoWizardPage1(this); //benvenuto con logo
m_pPage[1] = new CampoWizardPage2(this); //scelta aggiornamento/tipo installazione
m_pPage[2] = new CampoWizardPage3(this); //licenza
m_pPage[3] = new CampoWizardPage4(this); //test ed installazione chiavi
m_pPage[4] = new CampoWizardPage5(this); //selezione tipo installazione
m_pPage[5] = new CampoWizardPage6(this); //installazione standard
m_pPage[6] = new CampoWizardPage7(this); //installazione server
m_pPage[7] = new CampoWizardPage8(this); //installazione client
m_pPage[8] = new CampoWizardPage9(this); //riassuntino installazione
m_pPage[9] = new CampoWizardPage10(this); //creazione icona sul desktop e in start/programmi/campo
for (int p = 1; p < m_nPages; p++)
m_pPage[p]->Chain(m_pPage[p-1], m_pPage[p]);
wxWizardPageSimple::Chain(m_pPage[p-1], m_pPage[p]);
GetPageAreaSizer()->Add(m_pPage[0]);
}