summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2025-02-20 21:37:10 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2025-02-20 21:37:10 (GMT)
commit0bec2b96a14da29a680aafe54895fd9cfb3bcf09 (patch)
treeba2dd91ed51cd0fb0eb801439271028fbf1c6f81 /src/gui/panels
parentf58a0e1138a3a3b8a4cfa237f1fe75a24ea8e2ba (diff)
Create a GTK widget to launch panels.
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/Makefile.am1
-rw-r--r--src/gui/panels/binary-launch.ui65
-rw-r--r--src/gui/panels/binary.c23
-rw-r--r--src/gui/panels/gresource.xml1
4 files changed, 11 insertions, 79 deletions
diff --git a/src/gui/panels/Makefile.am b/src/gui/panels/Makefile.am
index 476a436..525b1f6 100644
--- a/src/gui/panels/Makefile.am
+++ b/src/gui/panels/Makefile.am
@@ -38,7 +38,6 @@ IMG_PATH = ../../../data/images
RES_FILES = \
binary.ui \
- binary-launch.ui \
binary-props.ui \
$(IMG_PATH)/binfile-symbolic.svg \
welcome.ui \
diff --git a/src/gui/panels/binary-launch.ui b/src/gui/panels/binary-launch.ui
deleted file mode 100644
index 553f758..0000000
--- a/src/gui/panels/binary-launch.ui
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
-
- <object class="GtkGrid" id="launcher">
- <property name="margin-bottom">12</property>
- <property name="margin-end">12</property>
- <property name="margin-start">12</property>
- <property name="margin-top">12</property>
- <property name="column-spacing">12</property>
- <child>
- <object class="GtkImage">
- <property name="icon-name">binfile-symbolic</property>
- <property name="pixel-size">48</property>
- <layout>
- <property name="column">0</property>
- <property name="row">0</property>
- <property name="row-span">2</property>
- </layout>
- <style>
- <class name="icon-dropshadow"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="label">&lt;b&gt;Binary analysis&lt;/b&gt;</property>
- <property name="use-markup">TRUE</property>
- <property name="xalign">0</property>
- <layout>
- <property name="column">1</property>
- <property name="row">0</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="label">Load a binary content and parse its format if recognized</property>
- <property name="hexpand">true</property>
- <property name="xalign">0</property>
- <layout>
- <property name="column">1</property>
- <property name="row">1</property>
- </layout>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkImage">
- <property name="icon-name">go-next-symbolic</property>
- <property name="margin-start">12</property>
- <layout>
- <property name="column">2</property>
- <property name="row">0</property>
- <property name="row-span">2</property>
- </layout>
- <style>
- <class name="icon-dropshadow"/>
- </style>
- </object>
- </child>
- </object>
-
-</interface>
diff --git a/src/gui/panels/binary.c b/src/gui/panels/binary.c
index de0a4d0..23426e3 100644
--- a/src/gui/panels/binary.c
+++ b/src/gui/panels/binary.c
@@ -25,6 +25,9 @@
#include "binary.h"
+#include <i18n.h>
+
+
#include "binary-int.h"
#include "../window.h"
#include "../../analysis/contents/file.h"
@@ -81,7 +84,7 @@ static void g_binary_panel_finalize(GBinaryPanel *);
static PanelItemPersonality g_binary_panel_get_personality(const GBinaryPanel *);
/* Fournit un composant pour lancer l'activité d'un panneau. */
-static GtkWidget *g_binary_panel_get_launcher(GBinaryPanel *);
+static GtkPanelLauncher *g_binary_panel_get_launcher(GPanelItem *);
/* Fournit un composant pour paramétrer l'activité d'un panneau. */
static GtkWidget *g_binary_panel_get_properties(GBinaryPanel *);
@@ -267,8 +270,8 @@ static void g_binary_panel_class_init(GBinaryPanelClass *class)
panel = G_PANEL_ITEM_CLASS(class);
panel->get_personality = (get_panel_item_personality_cb)g_binary_panel_get_personality;
- panel->get_launcher = (get_panel_item_widget_cb)g_binary_panel_get_launcher;
- panel->get_properties = (get_panel_item_widget_cb)g_binary_panel_get_properties;
+ panel->get_launcher = g_binary_panel_get_launcher;
+ panel->get_properties = (get_panel_item_props_cb)g_binary_panel_get_properties;
panel->get_panel = (get_panel_item_panel_cb)g_binary_panel_get_panel;
}
@@ -394,17 +397,13 @@ static PanelItemPersonality g_binary_panel_get_personality(const GBinaryPanel *p
* *
******************************************************************************/
-static GtkWidget *g_binary_panel_get_launcher(GBinaryPanel *panel)
+static GtkPanelLauncher *g_binary_panel_get_launcher(GPanelItem *panel)
{
- GtkWidget *result; /* Composant à retourner */
- GtkBuilder *builder; /* Constructeur d'UI */
+ GtkPanelLauncher *result; /* Composant à retourner */
- builder = gtk_builder_new_from_resource("/re/chrysalide/framework/gui/panels/binary-launch.ui");
-
- result = GTK_WIDGET(gtk_builder_get_object(builder, "launcher"));
- ref_object(result);
-
- unref_object(builder);
+ result = gtk_panel_launcher_new("binfile-symbolic",
+ _("Binary analysis"),
+ _("Load a binary content and parse its format if recognized"));
return result;
diff --git a/src/gui/panels/gresource.xml b/src/gui/panels/gresource.xml
index d00953d..2fecc8c 100644
--- a/src/gui/panels/gresource.xml
+++ b/src/gui/panels/gresource.xml
@@ -2,7 +2,6 @@
<gresources>
<gresource prefix="/re/chrysalide/framework/gui/panels">
<file compressed="true">binary.ui</file>
- <file compressed="true">binary-launch.ui</file>
<file compressed="true">binary-props.ui</file>
<file compressed="true">welcome.ui</file>
<file compressed="true">welcome-hints.txt</file>