summaryrefslogtreecommitdiff
path: root/src/gui/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/core')
-rw-r--r--src/gui/core/logs.c32
-rw-r--r--src/gui/core/panels.c22
2 files changed, 36 insertions, 18 deletions
diff --git a/src/gui/core/logs.c b/src/gui/core/logs.c
index 59910f1..cdb2a0d 100644
--- a/src/gui/core/logs.c
+++ b/src/gui/core/logs.c
@@ -24,6 +24,14 @@
#include "logs.h"
+#include <assert.h>
+
+
+#include "panels.h"
+#include "../panels/logs.h"
+#include "../../glibext/log.h"
+
+
/******************************************************************************
* *
@@ -38,26 +46,20 @@
* *
******************************************************************************/
-void do_log_message_alt2(LogMessageType type, const char *msg)
+void do_log_message_alt(LogMessageType type, const char *msg)
{
-#if 0
-
-#ifdef INCLUDE_GTK_SUPPORT
-
- GEditorItem *item; /* Eventuel affichage présent */
+ GLogEntry *entry; /* Nouvel élément de journal */
+ GtkTiledPanel *panel; /* Panneau de journalisation */
- item = find_editor_item_by_type(G_TYPE_LOG_PANEL);
+ entry = g_log_entry_new(type, msg);
- if (item != NULL)
- {
- g_log_panel_add_message(G_LOG_PANEL(item), type, msg);
- g_object_unref(G_OBJECT(item));
- }
+ panel = get_framework_panel_singleton(GTK_TYPE_LOGS_PANEL);
+ assert(panel != NULL);
-#endif
+ g_log_panel_add_message(GTK_LOGS_PANEL(panel), entry);
-#endif
+ unref_object(panel);
- printf("[log GUI] [%u] %s\n", type, msg);
+ unref_object(entry);
}
diff --git a/src/gui/core/panels.c b/src/gui/core/panels.c
index 4c113b8..3232e0c 100644
--- a/src/gui/core/panels.c
+++ b/src/gui/core/panels.c
@@ -35,6 +35,7 @@
#include "../panels/binary.h"
#include "../panels/binary-params.h"
+#include "../panels/logs.h"
#include "../panels/welcome.h"
#include "../../gtkext/launcher.h"
@@ -168,10 +169,23 @@ bool load_main_framework_panel_definitions(void)
bool result; /* Bilan à retourner */
panel_info_t info; /* Infos d'enregistrement */
- // TODO register_panel_item(G_TYPE_LOG_PANEL, config);
-
/* Chargement du panneau de rapport au plus tôt */
- // TODO panel = g_panel_item_new(G_TYPE_LOG_PANEL, NULL);
+
+ info.category = NULL;
+
+ info.image = NULL;
+ info.title = _("Logs");
+ info.desc = NULL;
+
+ info.personality = FPP_SINGLETON;
+
+ info.panel_type = GTK_TYPE_LOGS_PANEL;
+ info.params_type = G_TYPE_INVALID;
+
+ result = register_framework_panel_definition(&info);
+ if (!result) goto done;
+
+ /* Chargements des panneaux restants */
info.category = "Main";
@@ -187,6 +201,8 @@ bool load_main_framework_panel_definitions(void)
result = register_framework_panel_definition(&info);
if (!result) goto done;
+ /* --- */
+
info.category = NULL;
info.image = NULL;