Ajout de l'affiliation dans la bdd, le fetch et la fenêtre de résultats Correction de bugs dans la fenêtre d'options de recherche Correction du comportement de fermeture des fenêtres Modification des checkbox dans la fenêtre de résultats (disable plutôt qu'hidden) pour un bug d'affichage de la fenêtremaster
@@ -11,6 +11,69 @@ | |||
<File Name="tinyxml2.h"/> | |||
<File Name="tinyxml2.cpp"/> | |||
</VirtualDirectory> | |||
<Dependencies Name="Debug"/> | |||
<Dependencies Name="Debug_WIN"/> | |||
<Dependencies Name="Release"/> | |||
<Dependencies Name="Release_WIN"/> | |||
<VirtualDirectory Name="Frame"> | |||
<File Name="cosmosGUI.h"/> | |||
<File Name="cosmos.fbp"/> | |||
<File Name="cosmosGUI.cpp"/> | |||
<File Name="cosmos.cpp"/> | |||
<File Name="main.cpp"/> | |||
<File Name="cosmos.h"/> | |||
<VirtualDirectory Name="icons"> | |||
<File Name="icons/correc.xpm"/> | |||
<File Name="icons/export.xpm"/> | |||
<File Name="icons/import.xpm"/> | |||
<File Name="icons/optionsgales.xpm"/> | |||
<File Name="icons/optionsrche.xpm"/> | |||
<File Name="icons/play.xpm"/> | |||
<File Name="cosmos.xpm"/> | |||
<File Name="cosmos.ico"/> | |||
</VirtualDirectory> | |||
<File Name="cosmos.rc"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="Dialogs"> | |||
<VirtualDirectory Name="correc"> | |||
<File Name="correc.cpp"/> | |||
<File Name="correc.fbp"/> | |||
<File Name="correc.h"/> | |||
<File Name="correcGUI.cpp"/> | |||
<File Name="correcGUI.h"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="options"> | |||
<File Name="options.cpp"/> | |||
<File Name="options.fbp"/> | |||
<File Name="options.h"/> | |||
<File Name="optionsGUI.cpp"/> | |||
<File Name="optionsGUI.h"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="optionsRche"> | |||
<File Name="optionsRche.cpp"/> | |||
<File Name="optionsRche.fbp"/> | |||
<File Name="optionsRche.h"/> | |||
<File Name="optionsRcheGUI.cpp"/> | |||
<File Name="optionsRcheGUI.h"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="resultats"> | |||
<File Name="resultats.cpp"/> | |||
<File Name="resultats.fbp"/> | |||
<File Name="resultats.h"/> | |||
<File Name="resultatsGUI.cpp"/> | |||
<File Name="resultatsGUI.h"/> | |||
</VirtualDirectory> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="Objects"> | |||
<File Name="bdd.h"/> | |||
<File Name="config.h"/> | |||
<File Name="misc.h"/> | |||
<File Name="recherche.h"/> | |||
<File Name="bdd.cpp"/> | |||
<File Name="config.cpp"/> | |||
<File Name="misc.cpp"/> | |||
<File Name="recherche.cpp"/> | |||
</VirtualDirectory> | |||
<Settings Type="Executable"> | |||
<GlobalSettings> | |||
<Compiler Options="" C_Options=""> | |||
@@ -34,6 +97,7 @@ | |||
]]> | |||
</Environment> | |||
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath=""> | |||
@@ -57,6 +121,7 @@ | |||
<CustomPreBuild/> | |||
</AdditionalRules> | |||
<Completion EnableCpp11="no"> | |||
<ClangCmpFlagsC/> | |||
<ClangCmpFlags/> | |||
<ClangPP/> | |||
<SearchPaths/> | |||
@@ -70,14 +135,10 @@ | |||
<Library Value="curl"/> | |||
<Library Value="sqlite3"/> | |||
</Linker> | |||
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/> | |||
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="yes"/> | |||
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug_WIN" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/> | |||
<Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> | |||
<![CDATA[ | |||
]]> | |||
<![CDATA[]]> | |||
</Environment> | |||
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath=""> | |||
<PostConnectCommands/> | |||
@@ -100,6 +161,7 @@ | |||
<CustomPreBuild/> | |||
</AdditionalRules> | |||
<Completion EnableCpp11="no"> | |||
<ClangCmpFlagsC/> | |||
<ClangCmpFlags/> | |||
<ClangPP/> | |||
<SearchPaths/> | |||
@@ -117,6 +179,7 @@ | |||
<![CDATA[ | |||
]]> | |||
</Environment> | |||
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath=""> | |||
@@ -140,6 +203,7 @@ | |||
<CustomPreBuild/> | |||
</AdditionalRules> | |||
<Completion EnableCpp11="no"> | |||
<ClangCmpFlagsC/> | |||
<ClangCmpFlags/> | |||
<ClangPP/> | |||
<SearchPaths/> | |||
@@ -153,14 +217,10 @@ | |||
<Library Value="curl"/> | |||
<Library Value="sqlite3"/> | |||
</Linker> | |||
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/> | |||
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="yes"/> | |||
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release_WIN" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/> | |||
<Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> | |||
<![CDATA[ | |||
]]> | |||
<![CDATA[]]> | |||
</Environment> | |||
<Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath=""> | |||
<PostConnectCommands/> | |||
@@ -183,70 +243,11 @@ | |||
<CustomPreBuild/> | |||
</AdditionalRules> | |||
<Completion EnableCpp11="no"> | |||
<ClangCmpFlagsC/> | |||
<ClangCmpFlags/> | |||
<ClangPP/> | |||
<SearchPaths/> | |||
</Completion> | |||
</Configuration> | |||
</Settings> | |||
<Dependencies Name="Debug"/> | |||
<Dependencies Name="Debug_WIN"/> | |||
<Dependencies Name="Release"/> | |||
<Dependencies Name="Release_WIN"/> | |||
<VirtualDirectory Name="Frame"> | |||
<File Name="cosmosGUI.h"/> | |||
<File Name="cosmos.fbp"/> | |||
<File Name="cosmosGUI.cpp"/> | |||
<File Name="cosmos.cpp"/> | |||
<File Name="main.cpp"/> | |||
<File Name="cosmos.h"/> | |||
<VirtualDirectory Name="icons"> | |||
<File Name="icons/correc.xpm"/> | |||
<File Name="icons/export.xpm"/> | |||
<File Name="icons/import.xpm"/> | |||
<File Name="icons/optionsgales.xpm"/> | |||
<File Name="icons/optionsrche.xpm"/> | |||
<File Name="icons/play.xpm"/> | |||
</VirtualDirectory> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="Dialogs"> | |||
<VirtualDirectory Name="correc"> | |||
<File Name="correc.cpp"/> | |||
<File Name="correc.fbp"/> | |||
<File Name="correc.h"/> | |||
<File Name="correcGUI.cpp"/> | |||
<File Name="correcGUI.h"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="options"> | |||
<File Name="options.cpp"/> | |||
<File Name="options.fbp"/> | |||
<File Name="options.h"/> | |||
<File Name="optionsGUI.cpp"/> | |||
<File Name="optionsGUI.h"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="optionsRche"> | |||
<File Name="optionsRche.cpp"/> | |||
<File Name="optionsRche.fbp"/> | |||
<File Name="optionsRche.h"/> | |||
<File Name="optionsRcheGUI.cpp"/> | |||
<File Name="optionsRcheGUI.h"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="resultats"> | |||
<File Name="resultats.cpp"/> | |||
<File Name="resultats.fbp"/> | |||
<File Name="resultats.h"/> | |||
<File Name="resultatsGUI.cpp"/> | |||
<File Name="resultatsGUI.h"/> | |||
</VirtualDirectory> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="Objects"> | |||
<File Name="bdd.h"/> | |||
<File Name="config.h"/> | |||
<File Name="misc.h"/> | |||
<File Name="recherche.h"/> | |||
<File Name="bdd.cpp"/> | |||
<File Name="config.cpp"/> | |||
<File Name="misc.cpp"/> | |||
<File Name="recherche.cpp"/> | |||
</VirtualDirectory> | |||
</CodeLite_Project> |
@@ -33,7 +33,7 @@ void class_bdd::CreateEmpty(const wxString& path) | |||
rc += sqlite3_open_v2(_C(path), &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); | |||
rc += sqlite3_exec(db, "CREATE TABLE Consult(id INTEGER PRIMARY KEY ASC, n_dossier INTEGER, nom VARCHAR(50), prenom VARCHAR(50), responsable VARCHAR(100), consultant VARCHAR(50), theme TEXT, etablissement VARCHAR(100), travail VARCHAR(50), date_cs DATE, service VARCHAR(100));", NULL, NULL, NULL); | |||
rc += sqlite3_exec(db, "CREATE TABLE Result(id INTEGER PRIMARY KEY ASC, publi BOOLEAN DEFAULT 0, publi_CHU BOOLEAN DEFAULT 0, cs_associe BOOLEAN DEFAULT 0, nb_result INTEGER DEFAULT 0, id_result TEXT DEFAULT \"\");", NULL, NULL, NULL); | |||
rc += sqlite3_exec(db, "CREATE TABLE Publi(id INTEGER PRIMARY KEY, titre TEXT, auteurs TEXT, abstract TEXT, revue TEXT, lien VARCHAR(50), date_publi TEXT);", NULL, NULL, NULL); | |||
rc += sqlite3_exec(db, "CREATE TABLE Publi(id INTEGER PRIMARY KEY, titre TEXT, auteurs TEXT, abstract TEXT, revue TEXT, lien VARCHAR(50), date_publi TEXT, affiliation TEXT);", NULL, NULL, NULL); | |||
rc += sqlite3_exec(db, "CREATE TABLE Correc(orig TEXT PRIMARY KEY, dest TEXT);", NULL, NULL, NULL); | |||
if (rc) | |||
{ | |||
@@ -463,18 +463,19 @@ bool class_bdd::IsPubli(const wxString& id) | |||
return out; | |||
} | |||
void class_bdd::AddPubli(wxString id, wxString title, wxString authors, wxString abstract, wxString journal, wxString link, wxString date) | |||
void class_bdd::AddPubli(wxString id, wxString title, wxString authors, wxString abstract, wxString journal, wxString link, wxString date, wxString affiliation) | |||
{ | |||
title.Replace("\"", "_"); | |||
abstract.Replace("\"", "_"); | |||
wxString requete = "INSERT OR REPLACE INTO Publi (id, titre, auteurs, abstract, revue, lien, date_publi) VALUES ("; | |||
wxString requete = "INSERT OR REPLACE INTO Publi (id, titre, auteurs, abstract, revue, lien, date_publi, affiliation) VALUES ("; | |||
requete << id << ", " | |||
<< "\"" << title << "\", " | |||
<< "\"" << authors << "\", " | |||
<< "\"" << abstract << "\", " | |||
<< "\"" << journal << "\", " | |||
<< "\"" << link << "\", " | |||
<< "\"" << date << "\");"; | |||
<< "\"" << date << "\", " | |||
<< "\"" << affiliation << "\");"; | |||
rc = sqlite3_exec(db, requete, NULL, NULL, NULL); | |||
if (rc) | |||
wxMessageBox(_itoW(rc) + "\n" + requete); | |||
@@ -491,6 +492,7 @@ wxArrayString class_bdd::GetPublis(wxString id) | |||
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 4))); | |||
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 5))); | |||
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 6))); | |||
out.Add(wxString::FromUTF8((const char*)sqlite3_column_text(stmt, 7))); | |||
return out; | |||
} |
@@ -27,6 +27,7 @@ class class_bdd | |||
// import/export | |||
void Importer(const wxString& filename); | |||
//TODO: exporter revue pour les publications | |||
void Exporter(const wxString& filename); | |||
// mise à jour de la grille | |||
@@ -53,7 +54,7 @@ class class_bdd | |||
// gestion des publis | |||
bool IsPubli(const wxString& id); | |||
void AddPubli(wxString id, wxString title, wxString authors, wxString abstract, wxString journal, wxString link, wxString date); | |||
void AddPubli(wxString id, wxString title, wxString authors, wxString abstract, wxString journal, wxString link, wxString date, wxString affiliation); | |||
wxArrayString GetPublis(wxString id); | |||
}; | |||
@@ -47,3 +47,8 @@ void correc::OnOk( wxCommandEvent& event ) | |||
{ | |||
Close(); | |||
} | |||
void correc::OnClose( wxCloseEvent& event ) | |||
{ | |||
Show(false); | |||
} |
@@ -52,7 +52,7 @@ | |||
<event name="OnActivate"></event> | |||
<event name="OnActivateApp"></event> | |||
<event name="OnChar"></event> | |||
<event name="OnClose"></event> | |||
<event name="OnClose">OnClose</event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnHibernate"></event> | |||
@@ -20,6 +20,8 @@ protected: | |||
void OnCellChange( wxGridEvent& event ); | |||
void OnLabelLeftClick( wxGridEvent& event ); | |||
void OnOk( wxCommandEvent& event ); | |||
void OnClose( wxCloseEvent& event ); | |||
public: | |||
/** Constructor */ | |||
correc( wxWindow* parent, class_bdd* bdd ); | |||
@@ -64,6 +64,7 @@ dialog_correc::dialog_correc( wxWindow* parent, wxWindowID id, const wxString& t | |||
this->Centre( wxBOTH ); | |||
// Connect Events | |||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_correc::OnClose ) ); | |||
grid_correcs->Connect( wxEVT_GRID_CELL_CHANGE, wxGridEventHandler( dialog_correc::OnCellChange ), NULL, this ); | |||
grid_correcs->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( dialog_correc::OnLabelLeftClick ), NULL, this ); | |||
bouton_ok->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_correc::OnOk ), NULL, this ); | |||
@@ -72,6 +73,7 @@ dialog_correc::dialog_correc( wxWindow* parent, wxWindowID id, const wxString& t | |||
dialog_correc::~dialog_correc() | |||
{ | |||
// Disconnect Events | |||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_correc::OnClose ) ); | |||
grid_correcs->Disconnect( wxEVT_GRID_CELL_CHANGE, wxGridEventHandler( dialog_correc::OnCellChange ), NULL, this ); | |||
grid_correcs->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( dialog_correc::OnLabelLeftClick ), NULL, this ); | |||
bouton_ok->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_correc::OnOk ), NULL, this ); | |||
@@ -37,7 +37,7 @@ class dialog_correc : public wxDialog | |||
virtual void OnCellChange( wxGridEvent& event ) { event.Skip(); } | |||
virtual void OnLabelLeftClick( wxGridEvent& event ) { event.Skip(); } | |||
virtual void OnOk( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } | |||
public: | |||
@@ -49,13 +49,7 @@ void cosmos::OnExport( wxCommandEvent& event ) | |||
void cosmos::OnQuit( wxCommandEvent& event ) | |||
{ | |||
delete fenetre_resultats; | |||
delete recherche; | |||
delete fenetre_corrections; | |||
delete bdd; | |||
delete fenetre_options; | |||
delete config; | |||
exit(0); | |||
Close(); | |||
} | |||
void cosmos::OnQuit( wxCloseEvent& event ) | |||
@@ -0,0 +1,2 @@ | |||
#include "wx/msw/wx.rc" | |||
wxicon cosmos cosmos.ico |
@@ -0,0 +1,69 @@ | |||
/* XPM */ | |||
const char * cosmos_xpm[] = { | |||
"64 64 2 1", | |||
" c None", | |||
". c #FFFFFF", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" .. . .. ", | |||
" .. ", | |||
" ... ", | |||
" .. ", | |||
" .. ", | |||
" .. ", | |||
" .. ", | |||
" . ", | |||
" .. ", | |||
" .. ", | |||
" .. ", | |||
" . ", | |||
" . ...... ", | |||
" . ........... ", | |||
" . ............... ", | |||
" .. ....... ..... ", | |||
" .. ........ ... ", | |||
" .. .......... ... ", | |||
" . ............. ... ", | |||
" .. .............. .. ", | |||
" .. ............... .. ", | |||
" .. ................ .. ", | |||
" .. ................. .. ", | |||
" .. ................ .. ", | |||
" .. ................ .. ", | |||
" .. ................ .. ", | |||
" .. ............... . ", | |||
" .. ............. .. ", | |||
" .. ............ .. ", | |||
" ... ..... .. ", | |||
" ... ..... .. ", | |||
" ... ..... .. ", | |||
" ..... ...... . ", | |||
" ............... .. ", | |||
" ........... . ", | |||
" .. . ", | |||
" . ", | |||
" . ", | |||
" .. ", | |||
" .. ", | |||
" .. ", | |||
" . ", | |||
" . ", | |||
" ... ", | |||
" .. ", | |||
" .... ", | |||
" . .. .... ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" ", | |||
" "}; |
@@ -12,6 +12,7 @@ | |||
#include "icons/optionsgales.xpm" | |||
#include "icons/optionsrche.xpm" | |||
#include "icons/play.xpm" | |||
#include "cosmos.xpm" | |||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable" | |||
@@ -20,6 +21,7 @@ | |||
cosmosGUI::cosmosGUI( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) | |||
{ | |||
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); | |||
this->SetIcon(wxICON(cosmos)); | |||
menubar = new wxMenuBar( 0 ); | |||
menu_Fichier = new wxMenu(); | |||
@@ -22,18 +22,13 @@ void options::OnCancel( wxCloseEvent& event ) | |||
checkbox_proxy->SetValue(config->IsUseProxy()); | |||
textctrl_url->SetValue(config->GetProxyUrl()); | |||
spinctrl_port->SetValue(config->GetProxyPort()); | |||
this->Hide(); | |||
Show(false); | |||
UpdateUI(); | |||
} | |||
void options::OnCancel( wxCommandEvent& event ) | |||
{ | |||
dirpicker_dbpath->SetPath(config->GetPathDb()); | |||
checkbox_proxy->SetValue(config->IsUseProxy()); | |||
textctrl_url->SetValue(config->GetProxyUrl()); | |||
spinctrl_port->SetValue(config->GetProxyPort()); | |||
this->Hide(); | |||
UpdateUI(); | |||
Close(); | |||
} | |||
void options::OnOk( wxCommandEvent& event ) | |||
@@ -43,7 +38,7 @@ void options::OnOk( wxCommandEvent& event ) | |||
config->SetProxyUrl(textctrl_url->GetValue()); | |||
config->SetProxyPort(spinctrl_port->GetValue()); | |||
config->Save(); | |||
this->Hide(); | |||
Show(false); | |||
} | |||
void options::OnToggleProxy( wxCommandEvent& event ) | |||
@@ -77,33 +77,43 @@ void optionsRche::OnAdd( wxCommandEvent& event ) | |||
void optionsRche::OnUp( wxCommandEvent& event ) | |||
{ | |||
int selected = checklist_ruleset->GetSelection(); | |||
config->MoveRuleUp(selected); | |||
if (selected > 0) | |||
if (selected != wxNOT_FOUND) | |||
{ | |||
wxString temp = checklist_ruleset->GetString(selected-1); | |||
checklist_ruleset->SetString(selected-1, checklist_ruleset->GetStringSelection()); | |||
checklist_ruleset->SetString(selected, temp); | |||
checklist_ruleset->SetSelection(selected-1); | |||
config->MoveRuleUp(selected); | |||
if (selected > 0) | |||
{ | |||
wxString temp = checklist_ruleset->GetString(selected-1); | |||
checklist_ruleset->SetString(selected-1, checklist_ruleset->GetStringSelection()); | |||
checklist_ruleset->SetString(selected, temp); | |||
checklist_ruleset->SetSelection(selected-1); | |||
} | |||
} | |||
} | |||
void optionsRche::OnDown( wxCommandEvent& event ) | |||
{ | |||
int selected = checklist_ruleset->GetSelection(); | |||
config->MoveRuleDown(selected); | |||
if (selected < (int)checklist_ruleset->GetCount() - 1) | |||
if (selected != wxNOT_FOUND) | |||
{ | |||
wxString temp = checklist_ruleset->GetString(selected+1); | |||
checklist_ruleset->SetString(selected+1, checklist_ruleset->GetStringSelection()); | |||
checklist_ruleset->SetString(selected, temp); | |||
checklist_ruleset->SetSelection(selected+1); | |||
config->MoveRuleDown(selected); | |||
if (selected < (int)checklist_ruleset->GetCount() - 1) | |||
{ | |||
wxString temp = checklist_ruleset->GetString(selected+1); | |||
checklist_ruleset->SetString(selected+1, checklist_ruleset->GetStringSelection()); | |||
checklist_ruleset->SetString(selected, temp); | |||
checklist_ruleset->SetSelection(selected+1); | |||
} | |||
} | |||
} | |||
void optionsRche::OnDel( wxCommandEvent& event ) | |||
{ | |||
config->DelRule(checklist_ruleset->GetSelection()); | |||
checklist_ruleset->Delete(checklist_ruleset->GetSelection()); | |||
int selected = checklist_ruleset->GetSelection(); | |||
if (selected != wxNOT_FOUND) | |||
{ | |||
config->DelRule(selected); | |||
checklist_ruleset->Delete(selected); | |||
} | |||
} | |||
void optionsRche::OnUpdate( wxCommandEvent& event ) | |||
@@ -134,6 +144,11 @@ void optionsRche::OnUpdate( wxCommandEvent& event ) | |||
} | |||
void optionsRche::OnOk( wxCommandEvent& event ) | |||
{ | |||
Close(); | |||
} | |||
void optionsRche::OnClose( wxCloseEvent& event ) | |||
{ | |||
// Actualisation des sets selectionnés | |||
for (int i=0; i < (int)checklist_ruleset->GetCount(); i++) | |||
@@ -143,7 +158,7 @@ void optionsRche::OnOk( wxCommandEvent& event ) | |||
config->SetRule(i, temp); | |||
} | |||
config->Save(); | |||
Close(); | |||
Show(false); | |||
} | |||
void optionsRche::UpdateUI( wxCommandEvent& event ) | |||
@@ -52,7 +52,7 @@ | |||
<event name="OnActivate"></event> | |||
<event name="OnActivateApp"></event> | |||
<event name="OnChar"></event> | |||
<event name="OnClose"></event> | |||
<event name="OnClose">OnClose</event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnHibernate"></event> | |||
@@ -25,6 +25,7 @@ protected: | |||
void UpdateUI( wxCommandEvent& event ); | |||
void OnUpdate( wxCommandEvent& event ); | |||
void OnOk( wxCommandEvent& event ); | |||
void OnClose( wxCloseEvent& event ); | |||
public: | |||
/** Constructor */ | |||
@@ -189,6 +189,7 @@ dialog_optionsRche::dialog_optionsRche( wxWindow* parent, wxWindowID id, const w | |||
this->Centre( wxBOTH ); | |||
// Connect Events | |||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_optionsRche::OnClose ) ); | |||
checklist_ruleset->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( dialog_optionsRche::OnChecklistSelect ), NULL, this ); | |||
bouton_add->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_optionsRche::OnAdd ), NULL, this ); | |||
bouton_up->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_optionsRche::OnUp ), NULL, this ); | |||
@@ -207,6 +208,7 @@ dialog_optionsRche::dialog_optionsRche( wxWindow* parent, wxWindowID id, const w | |||
dialog_optionsRche::~dialog_optionsRche() | |||
{ | |||
// Disconnect Events | |||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( dialog_optionsRche::OnClose ) ); | |||
checklist_ruleset->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( dialog_optionsRche::OnChecklistSelect ), NULL, this ); | |||
bouton_add->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_optionsRche::OnAdd ), NULL, this ); | |||
bouton_up->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_optionsRche::OnUp ), NULL, this ); | |||
@@ -69,6 +69,7 @@ class dialog_optionsRche : public wxDialog | |||
wxButton* bouton_ok; | |||
// Virtual event handlers, overide them in your derived class | |||
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } | |||
virtual void OnChecklistSelect( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnAdd( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnUp( wxCommandEvent& event ) { event.Skip(); } | |||
@@ -31,6 +31,7 @@ void class_recherche::Start() | |||
if (config->GetRule(j).in_use) | |||
{ | |||
wxProgressDialog dialog_progress("Recherche", _T("Recherche avec la règle «") + config->GetRule(j).name + _T("»"), selection.GetCount(), NULL, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_SMOOTH | wxPD_ELAPSED_TIME | wxPD_REMAINING_TIME | wxPD_CAN_ABORT); | |||
dialog_progress.Update(0); | |||
for (unsigned int i=0; i < selection.GetCount(); i++) | |||
{ | |||
if (is_first_pass || (grid_consults->GetCellValue(selection[i], 0) == "0")) | |||
@@ -46,7 +47,6 @@ void class_recherche::Start() | |||
void class_recherche::Go(int row, rule regle) | |||
{ | |||
//TODO: coloration de la grille pour les consults avec nouveaux résultats | |||
wxString id_consult = grid_consults->GetCellValue(row, 13); | |||
wxString requete = Build(row, regle); | |||
eSearch(requete); | |||
@@ -95,7 +95,7 @@ void class_recherche::ParseFetch() | |||
parcours = parcours->FirstChildElement("PubmedArticle"); | |||
do | |||
{ | |||
wxString id, title, authors, abstract, journal, link, date; | |||
wxString id, title, authors, abstract, journal, link, date, affiliation; | |||
parcours = parcours->FirstChildElement("MedlineCitation"); //MedlineCitation | |||
id << parcours->FirstChildElement("PMID")->GetText(); // PMID | |||
@@ -119,8 +119,8 @@ void class_recherche::ParseFetch() | |||
title << parcours->NextSiblingElement("ArticleTitle")->GetText(); // *ArticleTitle | |||
if (parcours->NextSiblingElement("Abstract")) | |||
{ | |||
parcours = parcours->NextSiblingElement("Abstract"); // Abstract | |||
XMLElement* parcoursabstract = parcours->FirstChildElement("AbstractText"); // AbstractText | |||
parcours = parcours->NextSiblingElement("Abstract"); // Abstract | |||
XMLElement* parcoursabstract = parcours->FirstChildElement("AbstractText"); // AbstractText | |||
do | |||
{ | |||
if (parcoursabstract->FirstAttribute()) | |||
@@ -131,6 +131,10 @@ void class_recherche::ParseFetch() | |||
} | |||
else | |||
abstract = ""; | |||
if (parcours->NextSiblingElement("Affiliation")) | |||
affiliation << parcours->NextSiblingElement("Affiliation")->GetText(); // *Affiliation | |||
else | |||
affiliation = ""; | |||
parcours = parcours->NextSiblingElement("AuthorList"); // AuthorList | |||
XMLElement* parcoursauteurs = parcours->FirstChildElement("Author"); // Author | |||
do | |||
@@ -148,7 +152,7 @@ void class_recherche::ParseFetch() | |||
authors = authors.BeforeLast(','); | |||
parcours = parcours->Parent()->Parent()->Parent()->ToElement()->NextSiblingElement("PubmedArticle"); | |||
bdd->AddPubli(id, title, authors, abstract, journal, link, date); | |||
bdd->AddPubli(id, title, authors, abstract, journal, link, date, affiliation); | |||
}while(parcours); | |||
delete(doc); | |||
@@ -72,11 +72,16 @@ void resultats::OnNext( wxCommandEvent& event ) | |||
} | |||
void resultats::OnOk( wxCommandEvent& event ) | |||
{ | |||
Close(); | |||
} | |||
void resultats::OnClose( wxCloseEvent& event ) | |||
{ | |||
if (changed) | |||
Commit(); | |||
changed = false; | |||
Close(); | |||
Show(false); | |||
} | |||
void resultats::Update() | |||
@@ -134,10 +139,11 @@ void resultats::Update() | |||
statictext_date->SetLabel("Date de publication : "); | |||
hyperlink_lien->SetURL(""); | |||
hyperlink_lien->Disable(); | |||
textctrl_affiliation->SetValue(""); | |||
checkbox_publi->Set3StateValue(wxCHK_UNCHECKED); | |||
checkbox_publi->Disable(); | |||
checkbox_publichu->Hide(); | |||
checkbox_cs->Hide(); | |||
checkbox_publichu->Disable(); | |||
checkbox_cs->Disable(); | |||
} | |||
if (current_row_consult == 0) | |||
bouton_prec->Disable(); | |||
@@ -161,6 +167,7 @@ void resultats::UpdateUI() | |||
statictext_date->SetLabel("Date de publication : " + detail_publi[5]); | |||
hyperlink_lien->Enable(); | |||
hyperlink_lien->SetURL(detail_publi[4]); | |||
textctrl_affiliation->SetValue(detail_publi[6]); | |||
checkbox_publi->Enable(); | |||
wxCheckBoxState etat; | |||
if (list_publi[current_row_publi].Left(1) == "!") | |||
@@ -178,18 +185,17 @@ void resultats::UpdateCheckUI() | |||
{ | |||
if (nb_publi > 0) | |||
{ | |||
checkbox_publichu->Show(); | |||
checkbox_cs->Show(); | |||
checkbox_publichu->Enable(); | |||
checkbox_cs->Enable(); | |||
this->Refresh(); | |||
} | |||
else | |||
{ | |||
checkbox_publichu->SetValue(false); | |||
checkbox_cs->SetValue(false); | |||
checkbox_publichu->Hide(); | |||
checkbox_cs->Hide(); | |||
checkbox_publichu->Disable(); | |||
checkbox_cs->Disable(); | |||
} | |||
Fit(); | |||
} | |||
void resultats::Commit() | |||
@@ -798,6 +798,122 @@ | |||
<event name="OnUpdateUI"></event> | |||
</object> | |||
</object> | |||
<object class="sizeritem" expanded="1"> | |||
<property name="border">5</property> | |||
<property name="flag">wxALL</property> | |||
<property name="proportion">0</property> | |||
<object class="wxStaticText" expanded="1"> | |||
<property name="bg"></property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">0</property> | |||
<property name="id">wxID_ANY</property> | |||
<property name="label">Affiliation :</property> | |||
<property name="maximum_size"></property> | |||
<property name="minimum_size"></property> | |||
<property name="name">statictext_affiliation</property> | |||
<property name="permission">protected</property> | |||
<property name="pos"></property> | |||
<property name="size"></property> | |||
<property name="style"></property> | |||
<property name="subclass"></property> | |||
<property name="tooltip"></property> | |||
<property name="validator_data_type"></property> | |||
<property name="validator_style">wxFILTER_NONE</property> | |||
<property name="validator_type">wxDefaultValidator</property> | |||
<property name="validator_variable"></property> | |||
<property name="window_extra_style"></property> | |||
<property name="window_name"></property> | |||
<property name="window_style"></property> | |||
<property name="wrap">-1</property> | |||
<event name="OnChar"></event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnKeyDown"></event> | |||
<event name="OnKeyUp"></event> | |||
<event name="OnKillFocus"></event> | |||
<event name="OnLeaveWindow"></event> | |||
<event name="OnLeftDClick"></event> | |||
<event name="OnLeftDown"></event> | |||
<event name="OnLeftUp"></event> | |||
<event name="OnMiddleDClick"></event> | |||
<event name="OnMiddleDown"></event> | |||
<event name="OnMiddleUp"></event> | |||
<event name="OnMotion"></event> | |||
<event name="OnMouseEvents"></event> | |||
<event name="OnMouseWheel"></event> | |||
<event name="OnPaint"></event> | |||
<event name="OnRightDClick"></event> | |||
<event name="OnRightDown"></event> | |||
<event name="OnRightUp"></event> | |||
<event name="OnSetFocus"></event> | |||
<event name="OnSize"></event> | |||
<event name="OnUpdateUI"></event> | |||
</object> | |||
</object> | |||
<object class="sizeritem" expanded="1"> | |||
<property name="border">5</property> | |||
<property name="flag">wxALL|wxEXPAND</property> | |||
<property name="proportion">0</property> | |||
<object class="wxTextCtrl" expanded="1"> | |||
<property name="bg"></property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">0</property> | |||
<property name="id">wxID_ANY</property> | |||
<property name="maximum_size"></property> | |||
<property name="maxlength">0</property> | |||
<property name="minimum_size"></property> | |||
<property name="name">textctrl_affiliation</property> | |||
<property name="permission">protected</property> | |||
<property name="pos"></property> | |||
<property name="size"></property> | |||
<property name="style">wxTE_READONLY|wxTE_WORDWRAP</property> | |||
<property name="subclass"></property> | |||
<property name="tooltip"></property> | |||
<property name="validator_data_type"></property> | |||
<property name="validator_style">wxFILTER_NONE</property> | |||
<property name="validator_type">wxDefaultValidator</property> | |||
<property name="validator_variable"></property> | |||
<property name="value"></property> | |||
<property name="window_extra_style"></property> | |||
<property name="window_name"></property> | |||
<property name="window_style"></property> | |||
<event name="OnChar"></event> | |||
<event name="OnEnterWindow"></event> | |||
<event name="OnEraseBackground"></event> | |||
<event name="OnKeyDown"></event> | |||
<event name="OnKeyUp"></event> | |||
<event name="OnKillFocus"></event> | |||
<event name="OnLeaveWindow"></event> | |||
<event name="OnLeftDClick"></event> | |||
<event name="OnLeftDown"></event> | |||
<event name="OnLeftUp"></event> | |||
<event name="OnMiddleDClick"></event> | |||
<event name="OnMiddleDown"></event> | |||
<event name="OnMiddleUp"></event> | |||
<event name="OnMotion"></event> | |||
<event name="OnMouseEvents"></event> | |||
<event name="OnMouseWheel"></event> | |||
<event name="OnPaint"></event> | |||
<event name="OnRightDClick"></event> | |||
<event name="OnRightDown"></event> | |||
<event name="OnRightUp"></event> | |||
<event name="OnSetFocus"></event> | |||
<event name="OnSize"></event> | |||
<event name="OnText"></event> | |||
<event name="OnTextEnter"></event> | |||
<event name="OnTextMaxLen"></event> | |||
<event name="OnTextURL"></event> | |||
<event name="OnUpdateUI"></event> | |||
</object> | |||
</object> | |||
<object class="sizeritem" expanded="1"> | |||
<property name="border">5</property> | |||
<property name="flag">wxEXPAND</property> | |||
@@ -873,10 +989,10 @@ | |||
<property name="checked">0</property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="enabled">0</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">1</property> | |||
<property name="hidden">0</property> | |||
<property name="id">CHK_PUBLICHU</property> | |||
<property name="label">Publi CHU</property> | |||
<property name="maximum_size"></property> | |||
@@ -930,10 +1046,10 @@ | |||
<property name="checked">0</property> | |||
<property name="context_help"></property> | |||
<property name="context_menu">1</property> | |||
<property name="enabled">1</property> | |||
<property name="enabled">0</property> | |||
<property name="fg"></property> | |||
<property name="font"></property> | |||
<property name="hidden">1</property> | |||
<property name="hidden">0</property> | |||
<property name="id">CHK_CS</property> | |||
<property name="label">Consultant associé</property> | |||
<property name="maximum_size"></property> | |||
@@ -30,6 +30,7 @@ protected: | |||
void OnPrev( wxCommandEvent& event ); | |||
void OnNext( wxCommandEvent& event ); | |||
void OnOk( wxCommandEvent& event ); | |||
void OnClose( wxCloseEvent& event ); | |||
void UpdateUI(); //met à jour les détails pour une publication | |||
void UpdateCheckUI(); //met à jour les checkboxes | |||
void Commit(); //enregistre les modifs dans la bdd | |||
@@ -83,6 +83,13 @@ dialog_resultats::dialog_resultats( wxWindow* parent, wxWindowID id, const wxStr | |||
hyperlink_lien = new wxHyperlinkCtrl( this, wxID_ANY, wxT("Lien vers la page PubMed"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); | |||
sizer_detail->Add( hyperlink_lien, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); | |||
statictext_affiliation = new wxStaticText( this, wxID_ANY, wxT("Affiliation :"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
statictext_affiliation->Wrap( -1 ); | |||
sizer_detail->Add( statictext_affiliation, 0, wxALL, 5 ); | |||
textctrl_affiliation = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_WORDWRAP ); | |||
sizer_detail->Add( textctrl_affiliation, 0, wxALL|wxEXPAND, 5 ); | |||
wxBoxSizer* sizer_publi; | |||
sizer_publi = new wxBoxSizer( wxHORIZONTAL ); | |||
@@ -90,12 +97,12 @@ dialog_resultats::dialog_resultats( wxWindow* parent, wxWindowID id, const wxStr | |||
sizer_publi->Add( checkbox_publi, 1, wxALL|wxEXPAND, 5 ); | |||
checkbox_publichu = new wxCheckBox( this, CHK_PUBLICHU, wxT("Publi CHU"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
checkbox_publichu->Hide(); | |||
checkbox_publichu->Enable( false ); | |||
sizer_publi->Add( checkbox_publichu, 1, wxALL|wxEXPAND, 5 ); | |||
checkbox_cs = new wxCheckBox( this, CHK_CS, wxT("Consultant associé"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
checkbox_cs->Hide(); | |||
checkbox_cs->Enable( false ); | |||
sizer_publi->Add( checkbox_cs, 1, wxALL|wxEXPAND, 5 ); | |||
@@ -47,6 +47,8 @@ class dialog_resultats : public wxDialog | |||
wxTextCtrl* textctrl_revue; | |||
wxStaticText* statictext_date; | |||
wxHyperlinkCtrl* hyperlink_lien; | |||
wxStaticText* statictext_affiliation; | |||
wxTextCtrl* textctrl_affiliation; | |||
wxCheckBox* checkbox_publi; | |||
wxCheckBox* checkbox_publichu; | |||
wxCheckBox* checkbox_cs; | |||
@@ -18,6 +18,8 @@ | |||
]]> | |||
</Environment> | |||
<BuildMatrix> | |||
@@ -11,13 +11,13 @@ | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="/home/satamaxx/Programmes/Sante_Pub/CosMoS/bdd.cpp" Name="FileName"/> | |||
<int Value="338" Name="FirstVisibleLine"/> | |||
<int Value="363" Name="FirstVisibleLine"/> | |||
<int Value="363" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="/home/satamaxx/Programmes/Sante_Pub/CosMoS/cosmos.cpp" Name="FileName"/> | |||
<int Value="54" Name="FirstVisibleLine"/> | |||
<int Value="0" Name="FirstVisibleLine"/> | |||
<int Value="0" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||