summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-03-09 18:04:49 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-03-09 18:04:49 (GMT)
commitdc8a2b19dbb32bfe49b1ff6640cc609238b392ca (patch)
tree2103c99baeb3b792bc82fc3db28bd16ecf72b70e /src/main.c
parentf8f804cf7ff9a62404b843cf303c762101572784 (diff)
Stored and loaded panels attributes using the global configuration.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 67feabc..74ba72f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -91,11 +91,16 @@ static void show_version(void)
int main(int argc, char **argv)
{
+ int result; /* Bilan de l'exécution */
GtkWidget *editor; /* Fenêtre graphique */
GDbServer *server; /* Enregistrements locaux */
+ GGenConfig *config; /* Configuration globale */
+ bool status; /* Bilan d'opérations */
const char *filename; /* Chemin du dernier projet */
GStudyProject *project; /* Nouveau projet courant */
+ result = EXIT_FAILURE;
+
if (argc > 1 && strcmp(argv[1], "--version") == 0)
{
show_version();
@@ -165,12 +170,17 @@ int main(int argc, char **argv)
init_all_plugins(G_OBJECT(editor));
+ config = get_main_configuration();
+
+ status = complete_loading_of_all_gui_components(config);
+ if (!status) goto exit_complete_gui;
+
server = g_db_server_new("localhost", 1337);
g_db_server_start(server);
/* Charge le dernier projet */
- if (!g_generic_config_get_value(get_main_configuration(), MPK_LAST_PROJECT, &filename))
+ if (!g_generic_config_get_value(config, MPK_LAST_PROJECT, &filename))
filename = NULL;
if (filename == NULL) project = g_study_project_new(G_OBJECT(editor));
@@ -180,14 +190,20 @@ int main(int argc, char **argv)
/* Exécution du programme */
+ result = EXIT_SUCCESS;
+
gtk_main();
g_db_server_stop(server);
+ exit_complete_gui:
+
exit_all_plugins();
+ //gtk_widget_destroy(editor);
+
unload_all_basic_components();
- return EXIT_SUCCESS;
+ return result;
}