Browse Source

Séparation configuration des options générales.

master
Maxime Wack 11 years ago
parent
commit
5fd5a902bd
7 changed files with 100 additions and 19 deletions
  1. +1
    -3
      CosMoS/config.cpp
  2. +1
    -4
      CosMoS/config.h
  3. +9
    -2
      CosMoS/cosmos.cpp
  4. +3
    -1
      CosMoS/cosmos.h
  5. +2
    -3
      CosMoS/options.cpp
  6. +1
    -2
      CosMoS/options.h
  7. +83
    -4
      Sante_Pub.workspace.session

+ 1
- 3
CosMoS/config.cpp View File

@@ -1,8 +1,7 @@
#include "config.h"

config::config(dialog_Options* parent)
config::config()
{
this->parent = parent;
if (!wxFileExists("cosmos.cfg"))
createDefault();
else
@@ -31,7 +30,6 @@ void config::createDefault()
wxXmlNode* dbpathtext = new wxXmlNode(dbpathnode, wxXML_TEXT_NODE, "", dbpath);
fichier_config->SetRoot(rootnode);
wxMessageBox("Vous lancez CosMoS pour la première fois,\nveuillez configurer le chemin de la base\nainsi que les paramètres de connexion");
first_time = true;
}



+ 1
- 4
CosMoS/config.h View File

@@ -6,12 +6,9 @@
#include <wx/msgdlg.h>
#include <wx/filefn.h>

#include "optionsGUI.h"

class config
{
protected:
dialog_Options* parent;
wxXmlDocument* fichier_config;
bool first_time;
wxString dbpath;
@@ -20,7 +17,7 @@ protected:
int proxyport;

public:
config(dialog_Options* parent);
config();
~config();
void createDefault();
void load();


+ 9
- 2
CosMoS/cosmos.cpp View File

@@ -4,9 +4,15 @@ cosmos::cosmos( wxWindow* parent )
:
cosmosGUI( parent )
{
fenetre_options = new options(this);
if (fenetre_options->GetConfiguration()->IsFirstTime())
configuration = new config();
fenetre_options = new options(this, configuration);
if (configuration->IsFirstTime())
{
wxMessageBox("Vous lancez CosMoS pour la première fois,\nveuillez configurer le chemin de la base\nainsi que les paramètres de connexion");
fenetre_options->ShowModal();
}

bdd = new class_bdd(fenetre_options->GetConfiguration()->GetDbpath());
}

@@ -31,6 +37,7 @@ void cosmos::OnQuit( wxCommandEvent& event )
{
delete bdd;
delete fenetre_options;
delete configuration;
this->Close();
}



+ 3
- 1
CosMoS/cosmos.h View File

@@ -9,13 +9,15 @@ Subclass of cosmosGUI, which is generated by wxFormBuilder.
#include "cosmosGUI.h"
#include "options.h"
#include "bdd.h"
#include "config.h"

//// end generated include

/** Implementing cosmosGUI */
class cosmos : public cosmosGUI
{
protected:
protected:
config* configuration;
options* fenetre_options;
class_bdd* bdd;
// Handlers for cosmosGUI events.


+ 2
- 3
CosMoS/options.cpp View File

@@ -1,10 +1,10 @@
#include "options.h"

options::options( wxWindow* parent )
options::options( wxWindow* parent, config* configuration )
:
dialog_Options( parent )
{
configuration = new config(this);
this->configuration = configuration;
dirpicker_dbpath->SetPath(configuration->GetDbpath());
checkbox_proxy->SetValue(configuration->IsUseproxy());
textctrl_url->SetValue(configuration->GetProxyurl());
@@ -14,7 +14,6 @@ dialog_Options( parent )

options::~options()
{
delete configuration;
}

void options::OnCancel( wxCloseEvent& event )


+ 1
- 2
CosMoS/options.h View File

@@ -24,9 +24,8 @@ protected:
void updatefields();
public:
/** Constructor */
options( wxWindow* parent );
options( wxWindow* parent, config* configuration );
~options();
config* GetConfiguration() {return configuration;}
//// end generated class members

};


+ 83
- 4
Sante_Pub.workspace.session View File

@@ -1,8 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<Session Name="E:\Sante_Pub\Projets\Sante_Pub.workspace">
<int Value="0" Name="m_selectedTab"/>
<wxString Value="E:\Sante_Pub\Projets\Sante_Pub.workspace" Name="m_workspaceName"/>
<TabInfoArray Name="TabInfoArray"/>
<Session Name="G:\Commun\Etudiants\Maxime W\Projets\Sante_Pub.workspace">
<int Value="2" Name="m_selectedTab"/>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\Sante_Pub.workspace" Name="m_workspaceName"/>
<TabInfoArray Name="TabInfoArray">
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\main.cpp" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\cosmosGUI.h" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="7" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\cosmosGUI.cpp" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="7" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\config.h" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\options.h" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\optionsGUI.h" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="7" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\cosmos.h" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\bdd.h" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\config.cpp" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\options.cpp" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\optionsGUI.cpp" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="7" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\bdd.cpp" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
<TabInfo>
<wxString Value="G:\Commun\Etudiants\Maxime W\Projets\CosMoS\cosmos.cpp" Name="FileName"/>
<int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
</TabInfo>
</TabInfoArray>
<SerializedObject Name="m_breakpoints">
<long Value="0" Name="Count"/>
</SerializedObject>


Loading…
Cancel
Save