summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dialogs/binparts.c10
-rw-r--r--src/dialogs/export.c4
-rw-r--r--src/dialogs/goto.c4
-rw-r--r--src/dialogs/plugins.c12
-rw-r--r--src/dialogs/shellcode.c4
-rw-r--r--src/dialogs/storage.c6
-rw-r--r--src/editor.c6
-rw-r--r--src/gtkext/easygtk.c81
-rw-r--r--src/gtkext/easygtk.h6
-rw-r--r--src/gtkext/gtkdockstation.c4
-rw-r--r--src/gui/menus/file.c8
-rw-r--r--src/gui/menus/project.c8
-rw-r--r--src/gui/panels/strings.c6
13 files changed, 37 insertions, 122 deletions
diff --git a/src/dialogs/binparts.c b/src/dialogs/binparts.c
index 708f364..2d86432 100644
--- a/src/dialogs/binparts.c
+++ b/src/dialogs/binparts.c
@@ -24,6 +24,9 @@
#include "binparts.h"
+#include <i18n.h>
+
+
#include <stdio.h>
@@ -32,9 +35,6 @@
-#define _(str) str
-
-
/* Colonnes de la liste des symboles */
typedef enum _PartsColumn
@@ -269,10 +269,10 @@ GtkWidget *create_sections_dialog(GLoadedBinary *binary, GtkWindow *parent)
/* Boutons de contrôle principaux */
- button = qck_create_button_from_stock(NULL, NULL, "gtk-ok", G_CALLBACK(save_current_selection), ref);
+ button = qck_create_button(NULL, NULL, _("_Ok"), G_CALLBACK(save_current_selection), ref);
gtk_container_add(GTK_CONTAINER(hbuttonbox1), button);
- button = qck_create_button_from_stock(NULL, NULL, "gtk-cancel", G_CALLBACK(close_editor), result);
+ button = qck_create_button(NULL, NULL, _("_Cancel"), G_CALLBACK(close_editor), result);
gtk_container_add(GTK_CONTAINER(hbuttonbox1), button);
/* Actualisation de l'interface */
diff --git a/src/dialogs/export.c b/src/dialogs/export.c
index 67a3b7c..76cdcfd 100644
--- a/src/dialogs/export.c
+++ b/src/dialogs/export.c
@@ -388,8 +388,8 @@ static void on_filename_browsing_clicked(GtkButton *button, GObject *ref)
dialog = gtk_file_chooser_dialog_new(_("Choose an output filename"), GTK_WINDOW(ref),
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Save"), GTK_RESPONSE_ACCEPT,
NULL);
entry = GTK_ENTRY(g_object_get_data(ref, "filename"));
diff --git a/src/dialogs/goto.c b/src/dialogs/goto.c
index 1844712..537179e 100644
--- a/src/dialogs/goto.c
+++ b/src/dialogs/goto.c
@@ -208,10 +208,10 @@ GtkWidget *create_goto_dialog(GtkWindow *parent)
gtk_widget_show(action_area);
gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area), GTK_BUTTONBOX_END);
- button = qck_create_button_from_stock(NULL, NULL, "gtk-cancel", NULL, NULL);
+ button = qck_create_button(NULL, NULL, _("_Cancel"), NULL, NULL);
gtk_dialog_add_action_widget(GTK_DIALOG(result), button, GTK_RESPONSE_CANCEL);
- button = qck_create_button_from_stock(NULL, NULL, "gtk-ok", NULL, NULL);
+ button = qck_create_button(NULL, NULL, _("_Ok"), NULL, NULL);
gtk_dialog_add_action_widget(GTK_DIALOG(result), button, GTK_RESPONSE_OK);
gtk_entry_set_text(GTK_ENTRY(entry), "0x");
diff --git a/src/dialogs/plugins.c b/src/dialogs/plugins.c
index ea9c9e2..4e7bfaf 100644
--- a/src/dialogs/plugins.c
+++ b/src/dialogs/plugins.c
@@ -147,7 +147,7 @@ GtkWidget *create_plugins_selection_dialog(GLoadedBinary *binary, GtkWindow *par
gtk_widget_show(button7);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button7);
- image3 = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_BUTTON);
+ image3 = gtk_image_new_from_icon_name("gtk-add", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image3);
gtk_container_add(GTK_CONTAINER(button7), image3);
@@ -155,7 +155,7 @@ GtkWidget *create_plugins_selection_dialog(GLoadedBinary *binary, GtkWindow *par
gtk_widget_show(button8);
gtk_container_add(GTK_CONTAINER(vbuttonbox1), button8);
- image4 = gtk_image_new_from_stock("gtk-remove", GTK_ICON_SIZE_BUTTON);
+ image4 = gtk_image_new_from_icon_name("gtk-remove", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image4);
gtk_container_add(GTK_CONTAINER(button8), image4);
@@ -173,7 +173,7 @@ GtkWidget *create_plugins_selection_dialog(GLoadedBinary *binary, GtkWindow *par
gtk_widget_show(button9);
gtk_container_add(GTK_CONTAINER(vbuttonbox2), button9);
- image5 = gtk_image_new_from_stock("gtk-go-up", GTK_ICON_SIZE_BUTTON);
+ image5 = gtk_image_new_from_icon_name("gtk-go-up", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image5);
gtk_container_add(GTK_CONTAINER(button9), image5);
@@ -181,7 +181,7 @@ GtkWidget *create_plugins_selection_dialog(GLoadedBinary *binary, GtkWindow *par
gtk_widget_show(button10);
gtk_container_add(GTK_CONTAINER(vbuttonbox2), button10);
- image6 = gtk_image_new_from_stock("gtk-go-down", GTK_ICON_SIZE_BUTTON);
+ image6 = gtk_image_new_from_icon_name("gtk-go-down", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image6);
gtk_container_add(GTK_CONTAINER(button10), image6);
@@ -281,7 +281,7 @@ GtkWidget *create_plugins_selection_dialog(GLoadedBinary *binary, GtkWindow *par
gtk_widget_show(hbox1);
gtk_container_add(GTK_CONTAINER(alignment1), hbox1);
- image1 = gtk_image_new_from_stock("gtk-apply", GTK_ICON_SIZE_BUTTON);
+ image1 = gtk_image_new_from_icon_name("gtk-apply", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image1);
gtk_box_pack_start(GTK_BOX(hbox1), image1, FALSE, FALSE, 0);
@@ -301,7 +301,7 @@ GtkWidget *create_plugins_selection_dialog(GLoadedBinary *binary, GtkWindow *par
gtk_widget_show(hbox2);
gtk_container_add(GTK_CONTAINER(alignment2), hbox2);
- image2 = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON);
+ image2 = gtk_image_new_from_icon_name("gtk-cancel", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image2);
gtk_box_pack_start(GTK_BOX(hbox2), image2, FALSE, FALSE, 0);
diff --git a/src/dialogs/shellcode.c b/src/dialogs/shellcode.c
index c6087b8..514386f 100644
--- a/src/dialogs/shellcode.c
+++ b/src/dialogs/shellcode.c
@@ -694,8 +694,8 @@ static void on_filename_browsing_clicked(GtkButton *button, GObject *ref)
dialog = gtk_file_chooser_dialog_new(_("Choose an output filename"), GTK_WINDOW(ref),
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Save"), GTK_RESPONSE_ACCEPT,
NULL);
entry = GTK_ENTRY(g_object_get_data(ref, "filename"));
diff --git a/src/dialogs/storage.c b/src/dialogs/storage.c
index 9962d03..cffc2e2 100644
--- a/src/dialogs/storage.c
+++ b/src/dialogs/storage.c
@@ -283,12 +283,10 @@ GtkWidget *create_storage_dialog(GLoadedBinary *binary, GtkWindow *parent)
gtk_widget_show(action_area);
gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area), GTK_BUTTONBOX_END);
-
- button = qck_create_button_from_stock(NULL, NULL, "gtk-cancel", NULL, NULL);
+ button = qck_create_button(NULL, NULL, _("_Cancel"), NULL, NULL);
gtk_dialog_add_action_widget(GTK_DIALOG(result), button, GTK_RESPONSE_CANCEL);
- button = qck_create_button_from_stock(NULL, NULL, "gtk-ok",
- G_CALLBACK(save_storage_params), result);
+ button = qck_create_button(NULL, NULL, _("_Ok"), G_CALLBACK(save_storage_params), result);
gtk_dialog_add_action_widget(GTK_DIALOG(result), button, GTK_RESPONSE_OK);
/* Chargement des données actuelles */
diff --git a/src/editor.c b/src/editor.c
index ea5ecb3..d7b3ff9 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -269,9 +269,9 @@ static gboolean on_delete_editor(GtkWidget *widget, GdkEvent *event, gpointer da
GTK_BUTTONS_NONE,
_("The current project will be lost. Do you you want to save it ?"));
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_YES, GTK_RESPONSE_YES);
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_NO, GTK_RESPONSE_NO);
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Yes"), GTK_RESPONSE_YES);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), _("_No"), GTK_RESPONSE_NO);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
switch (gtk_dialog_run(GTK_DIALOG(dialog)))
{
diff --git a/src/gtkext/easygtk.c b/src/gtkext/easygtk.c
index d4f01e3..1350b72 100644
--- a/src/gtkext/easygtk.c
+++ b/src/gtkext/easygtk.c
@@ -333,46 +333,7 @@ GtkWidget *qck_create_button(GObject *object, const char *name, const char *capt
{
GtkWidget *result; /* Résultat à renvoyer */
- result = gtk_button_new_with_label(caption);
- gtk_widget_set_can_default(result, TRUE);
-
- if (G_IS_OBJECT(object) && name != NULL)
- {
- g_object_ref(G_OBJECT(result));
- g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref);
- }
-
- gtk_widget_show(result);
-
- if (handler != NULL)
- g_signal_connect(result, "clicked", handler, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : object = espace dédié à l'inscription de références. *
-* name = nom à donner au nouveau composant. *
-* stock = désignation du type de bouton GTK. *
-* handler = éventuelle fonction de sélection associée. *
-* data = données à transmettre avec l'événement si besoin. *
-* *
-* Description : Crée et enregistre un composant 'GtkButton'. *
-* *
-* Retour : Simple bouton mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GtkWidget *qck_create_button_from_stock(GObject *object, const char *name, const char *stock, GCallback handler, gpointer data)
-{
- GtkWidget *result; /* Résultat à renvoyer */
-
- result = gtk_button_new_from_stock(stock);
+ result = gtk_button_new_with_mnemonic(caption);
gtk_widget_set_can_default(result, TRUE);
if (G_IS_OBJECT(object) && name != NULL)
@@ -415,7 +376,7 @@ GtkWidget *qck_create_button_with_img(GObject *object, const char *name, const c
result = gtk_button_new();
gtk_widget_set_can_default(result, TRUE);
- render = gtk_image_new_from_stock(image, GTK_ICON_SIZE_BUTTON);
+ render = gtk_image_new_from_icon_name(image, GTK_ICON_SIZE_BUTTON);
gtk_widget_show(render);
gtk_container_add(GTK_CONTAINER(result), render);
@@ -665,44 +626,6 @@ GtkWidget *qck_create_menu_item(GObject *object, const char *name, const char *c
* *
* Paramètres : object = espace dédié à l'inscription de références. *
* name = nom à donner au nouveau composant. *
-* id = identifiant du menu prédéfini. *
-* handler = éventuelle fonction de sélection associée. *
-* data = données à transmettre avec l'événement si besoin. *
-* *
-* Description : Crée et enregistre un composant 'GtkImageMenuItem'. *
-* *
-* Retour : Simple élément de menu mis en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GtkWidget *qck_create_menu_item_with_stock_img(GObject *object, const char *name, const char *id, GCallback handler, gpointer data)
-{
- GtkWidget *result; /* Résultat à renvoyer */
-
- result = gtk_image_menu_item_new_from_stock(id, NULL);
-
- if (G_IS_OBJECT(object) && name != NULL)
- {
- g_object_ref(G_OBJECT(result));
- g_object_set_data_full(object, name, result, (GDestroyNotify)g_object_unref);
- }
-
- gtk_widget_show(result);
-
- if (handler != NULL)
- g_signal_connect(result, "activate", handler, data);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : object = espace dédié à l'inscription de références. *
-* name = nom à donner au nouveau composant. *
* caption = intitulé du menu à créer. *
* handler = éventuelle fonction de sélection associée. *
* data = données à transmettre avec l'événement si besoin. *
diff --git a/src/gtkext/easygtk.h b/src/gtkext/easygtk.h
index 12de4d3..5f8fb29 100644
--- a/src/gtkext/easygtk.h
+++ b/src/gtkext/easygtk.h
@@ -60,9 +60,6 @@ GtkWidget *qck_create_textview(GObject *, const char *, GCallback, gpointer);
GtkWidget *qck_create_button(GObject *, const char *, const char *, GCallback, gpointer);
/* Crée et enregistre un composant 'GtkButton'. */
-GtkWidget *qck_create_button_from_stock(GObject *, const char *, const char *, GCallback, gpointer);
-
-/* Crée et enregistre un composant 'GtkButton'. */
GtkWidget *qck_create_button_with_img(GObject *, const char *, const char *, GCallback, gpointer);
/* Crée et enregistre un composant 'GtkCheckButton'. */
@@ -83,9 +80,6 @@ GtkWidget *qck_create_combobox_with_entry(GObject *, const char *, GCallback, gp
/* Crée et enregistre un composant 'GtkMenuItem'. */
GtkWidget *qck_create_menu_item(GObject *, const char *, const char *, GCallback, gpointer);
-/* Crée et enregistre un composant 'GtkImageMenuItem'. */
-GtkWidget *qck_create_menu_item_with_stock_img(GObject *, const char *, const char *, GCallback, gpointer);
-
/* Crée et enregistre un composant 'GtkCheckMenuItem'. */
GtkWidget *qck_create_check_menu_item(GObject *, const char *, const char *, GCallback, gpointer);
diff --git a/src/gtkext/gtkdockstation.c b/src/gtkext/gtkdockstation.c
index b14e299..785ff42 100644
--- a/src/gtkext/gtkdockstation.c
+++ b/src/gtkext/gtkdockstation.c
@@ -131,7 +131,7 @@ static void gtk_dock_station_init(GtkDockStation *station)
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
- image = gtk_image_new_from_stock("gtk-media-play", GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_icon_name("gtk-media-play", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_container_add(GTK_CONTAINER(button), image);
gtk_widget_set_size_request(image, 10, 10);
@@ -141,7 +141,7 @@ static void gtk_dock_station_init(GtkDockStation *station)
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
- image = gtk_image_new_from_stock("gtk-close", GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_icon_name("gtk-close", GTK_ICON_SIZE_MENU);
gtk_widget_show(image);
gtk_container_add(GTK_CONTAINER(button), image);
gtk_widget_set_size_request(image, 10, 10);
diff --git a/src/gui/menus/file.c b/src/gui/menus/file.c
index f52d0e2..e343788 100644
--- a/src/gui/menus/file.c
+++ b/src/gui/menus/file.c
@@ -174,8 +174,8 @@ static void mcb_file_open_project(GtkMenuItem *menuitem, GObject *ref)
dialog = gtk_file_chooser_dialog_new(_("Open a project"), GTK_WINDOW(ref),
GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
project = get_current_project();
@@ -258,8 +258,8 @@ static void mcb_file_save_project_as(GtkMenuItem *menuitem, gpointer data)
dialog = gtk_file_chooser_dialog_new(_("Save the project as..."), GTK_WINDOW(data),
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Save"), GTK_RESPONSE_ACCEPT,
NULL);
project = get_current_project();
diff --git a/src/gui/menus/project.c b/src/gui/menus/project.c
index 3c85cd8..caf3f64 100644
--- a/src/gui/menus/project.c
+++ b/src/gui/menus/project.c
@@ -183,12 +183,12 @@ static void mcb_project_add_shellcode(GtkMenuItem *menuitem, GMenuBar *bar)
{
GStudyProject *project; /* Projet courant */
GtkWindow *parent; /* Respect de la hiérarchie */
- GtkWidget *dialog; /* Boîte à afficher */
+ //GtkWidget *dialog; /* Boîte à afficher */
project = get_current_project();
parent = GTK_WINDOW(G_EDITOR_ITEM(bar)->ref);
- dialog = NULL;
+ //dialog = NULL;
run_shellcode_assistant(project, parent);
@@ -275,8 +275,8 @@ static void mcb_project_add_binary_file(GtkMenuItem *menuitem, GMenuBar *bar)
dialog = gtk_file_chooser_dialog_new(_("Open a binary file"),
GTK_WINDOW(G_EDITOR_ITEM(bar)->ref),
GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
if (g_study_project_get_filename(get_current_project()) != NULL)
diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c
index 8706151..b68a0e8 100644
--- a/src/gui/panels/strings.c
+++ b/src/gui/panels/strings.c
@@ -206,11 +206,11 @@ static void g_strings_panel_init(GStringsPanel *panel)
panel->menubar = gtk_menu_new();
- submenuitem = qck_create_menu_item_with_stock_img(NULL, NULL, GTK_STOCK_COPY,
- G_CALLBACK(mcb_strings_copy), treeview);
+ submenuitem = qck_create_menu_item(NULL, NULL, _("_Copy"),
+ G_CALLBACK(mcb_strings_copy), treeview);
gtk_container_add(GTK_CONTAINER(panel->menubar), submenuitem);
- submenuitem = qck_create_menu_item(NULL, NULL, _("Find references..."), NULL, NULL);
+ submenuitem = qck_create_menu_item(NULL, NULL, _("_Find references..."), NULL, NULL);
gtk_container_add(GTK_CONTAINER(panel->menubar), submenuitem);
g_signal_connect(G_OBJECT(treeview), "button_release_event",