summaryrefslogtreecommitdiff
path: root/src/gui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/Makefile.am2
-rw-r--r--src/gui/dialogs/gresource.xml1
-rw-r--r--src/gui/dialogs/identity.c2
-rw-r--r--src/gui/dialogs/identity.h2
-rw-r--r--src/gui/dialogs/preferences.c93
-rw-r--r--src/gui/dialogs/preferences.h37
-rw-r--r--src/gui/dialogs/preferences.ui283
7 files changed, 418 insertions, 2 deletions
diff --git a/src/gui/dialogs/Makefile.am b/src/gui/dialogs/Makefile.am
index 35dfb0a..755ddbd 100644
--- a/src/gui/dialogs/Makefile.am
+++ b/src/gui/dialogs/Makefile.am
@@ -6,6 +6,7 @@ noinst_LTLIBRARIES = libguidialogs.la
UI_FILES = \
bookmark.ui \
identity.ui \
+ preferences.ui \
storage.ui
libguidialogs_la_SOURCES = \
@@ -16,6 +17,7 @@ libguidialogs_la_SOURCES = \
gotox.h gotox.c \
identity.h identity.c \
plugins.h plugins.c \
+ preferences.h preferences.c \
resources.h resources.c \
storage.h storage.c
diff --git a/src/gui/dialogs/gresource.xml b/src/gui/dialogs/gresource.xml
index e44045c..b6e3c32 100644
--- a/src/gui/dialogs/gresource.xml
+++ b/src/gui/dialogs/gresource.xml
@@ -3,6 +3,7 @@
<gresource prefix="/org/chrysalide/gui/dialogs">
<file compressed="true">bookmark.ui</file>
<file compressed="true">identity.ui</file>
+ <file compressed="true">preferences.ui</file>
<file compressed="true">storage.ui</file>
</gresource>
</gresources>
diff --git a/src/gui/dialogs/identity.c b/src/gui/dialogs/identity.c
index 9e3cfd7..5f51bc0 100644
--- a/src/gui/dialogs/identity.c
+++ b/src/gui/dialogs/identity.c
@@ -45,7 +45,7 @@ static void update_identity(GtkButton *button, GtkBuilder *);
* Paramètres : parent = fenêtre principale de l'éditeur. *
* outb = constructeur à détruire après usage. [OUT] *
* *
-* Description : Propose une édition des informations conernant l'utilisateur.*
+* Description : Propose une édition d'informations concernant l'utilisateur. *
* *
* Retour : Adresse de la fenêtre mise en place. *
* *
diff --git a/src/gui/dialogs/identity.h b/src/gui/dialogs/identity.h
index 99c0ca6..8d51c4d 100644
--- a/src/gui/dialogs/identity.h
+++ b/src/gui/dialogs/identity.h
@@ -29,7 +29,7 @@
-/* Propose une édition des informations conernant l'utilisateur. */
+/* Propose une édition d'informations concernant l'utilisateur. */
GtkWidget *create_identity_dialog(GtkWindow *, GtkBuilder **);
diff --git a/src/gui/dialogs/preferences.c b/src/gui/dialogs/preferences.c
new file mode 100644
index 0000000..dcb4cc7
--- /dev/null
+++ b/src/gui/dialogs/preferences.c
@@ -0,0 +1,93 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * preferences.c - (re)définition de l'identité de l'utilisateur
+ *
+ * Copyright (C) 2017 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Chrysalide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "preferences.h"
+
+
+#include <i18n.h>
+
+
+
+/* Eléments de la liste de sections */
+typedef enum _PrefListItem
+{
+ PLI_TITLE, /* Etiquette de la section */
+ PLI_PANEL, /* Panneau graphique associé */
+
+} PrefListItem;
+
+
+
+/******************************************************************************
+* *
+* Paramètres : parent = fenêtre principale de l'éditeur. *
+* outb = constructeur à détruire après usage. [OUT] *
+* *
+* Description : Propose une boîte de dialogue pour la configuration générale.*
+* *
+* Retour : Adresse de la fenêtre mise en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GtkWidget *create_preferences_dialog(GtkWindow *parent, GtkBuilder **outb)
+{
+ GtkWidget *result; /* Fenêtre à renvoyer */
+ GtkBuilder *builder; /* Constructeur utilisé */
+ GtkTreeStore *store; /* Arborescence des sections */
+ GtkTreeIter iter; /* Point d'insertion */
+
+ builder = gtk_builder_new_from_resource("/org/chrysalide/gui/dialogs/preferences.ui");
+ *outb = builder;
+
+ result = GTK_WIDGET(gtk_builder_get_object(builder, "window"));
+
+ gtk_window_set_transient_for(GTK_WINDOW(result), parent);
+
+ /* Intégration des différentes sections */
+
+ store = GTK_TREE_STORE(gtk_builder_get_object(builder, "pref_list"));
+
+ gtk_tree_store_append(store, &iter, NULL);
+
+ gtk_tree_store_set(store, &iter,
+ PLI_TITLE, _("Colored labels"),
+ PLI_PANEL, gtk_builder_get_object(builder, "colored_labels_panel"),
+ -1);
+
+ /* Mise à jour de l'interface */
+
+ /* Connexion des signaux */
+
+ /*
+ gtk_builder_add_callback_symbols(builder,
+ "update_preferences", G_CALLBACK(update_preferences),
+ NULL);
+ */
+
+ gtk_builder_connect_signals(builder, builder);
+
+ return result;
+
+}
diff --git a/src/gui/dialogs/preferences.h b/src/gui/dialogs/preferences.h
new file mode 100644
index 0000000..a608dc3
--- /dev/null
+++ b/src/gui/dialogs/preferences.h
@@ -0,0 +1,37 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * preferences.h - prototypes pour la (re)définition de l'identité de l'utilisateur
+ *
+ * Copyright (C) 2017 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Chrysalide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _GUI_DIALOGS_PREFERENCES_H
+#define _GUI_DIALOGS_PREFERENCES_H
+
+
+#include <gtk/gtk.h>
+
+
+
+/* Propose une boîte de dialogue pour la configuration générale. */
+GtkWidget *create_preferences_dialog(GtkWindow *, GtkBuilder **);
+
+
+
+#endif /* _GUI_DIALOGS_PREFERENCES_H */
diff --git a/src/gui/dialogs/preferences.ui b/src/gui/dialogs/preferences.ui
new file mode 100644
index 0000000..2760399
--- /dev/null
+++ b/src/gui/dialogs/preferences.ui
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.21.0 -->
+<interface>
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkListStore" id="colored_label_types">
+ <columns>
+ <!-- column-name name -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">global colored labels</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">colored labels for symbols</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">colored labels for basic blocks</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkTreeStore" id="pref_list">
+ <columns>
+ <!-- column-name title -->
+ <column type="gchararray"/>
+ <!-- column-name panel -->
+ <column type="GObject"/>
+ </columns>
+ </object>
+ <object class="GtkDialog" id="window">
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">General preferences</property>
+ <property name="modal">True</property>
+ <property name="default_width">800</property>
+ <property name="default_height">500</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ <property name="margin_left">8</property>
+ <property name="margin_right">8</property>
+ <property name="margin_top">8</property>
+ <property name="margin_bottom">8</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button2">
+ <property name="label">gtk-apply</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkPaned">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="position">200</property>
+ <property name="wide_handle">True</property>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_left">8</property>
+ <property name="margin_right">8</property>
+ <property name="margin_top">8</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="model">pref_list</property>
+ <property name="headers_visible">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn">
+ <property name="title" translatable="yes">column</property>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkStack">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">8</property>
+ <property name="margin_right">8</property>
+ <property name="margin_top">8</property>
+ <child>
+ <object class="GtkBox" id="colored_labels_panel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">8</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Specify:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="colored_labels_combo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">colored_label_types</property>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <property name="icon_size">4</property>
+ <child>
+ <object class="GtkToolButton" id="colored_label_add">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">list-add</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="colored_label_remove">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">list-remove</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="name">page0</property>
+ <property name="title" translatable="yes">page0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">button1</action-widget>
+ <action-widget response="-10">button2</action-widget>
+ </action-widgets>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+</interface>