[ekiga/ds-gtk-application] MenuBuilderGtk: Removed deprecated GTK+3 functions.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gtk-application] MenuBuilderGtk: Removed deprecated GTK+3 functions.
- Date: Sat, 20 Dec 2014 12:47:52 +0000 (UTC)
commit f14b9c5678ff6056cf540b746f9694b440313d82
Author: Damien Sandras <dsandras seconix com>
Date: Sat Dec 20 13:44:21 2014 +0100
MenuBuilderGtk: Removed deprecated GTK+3 functions.
lib/engine/gui/gtk-core/menu-builder-gtk.cpp | 35 +++-----------------------
1 files changed, 4 insertions(+), 31 deletions(-)
---
diff --git a/lib/engine/gui/gtk-core/menu-builder-gtk.cpp b/lib/engine/gui/gtk-core/menu-builder-gtk.cpp
index d69184a..8e79f81 100644
--- a/lib/engine/gui/gtk-core/menu-builder-gtk.cpp
+++ b/lib/engine/gui/gtk-core/menu-builder-gtk.cpp
@@ -45,24 +45,6 @@ struct Action
boost::function0<void> callback;
};
-static const std::string
-convert_icon_to_gtk (const std::string icon)
-{
- std::string result = icon;
-
- if (icon == "add")
- result = "gtk-add";
- if (icon == "edit")
- result = "gtk-edit";
- if (icon == "clear")
- result = "gtk-clear";
- if (icon == "remove")
- result = "gtk-remove";
- if (icon == "refresh")
- result = "gtk-refresh";
-
- return result;
-}
static void
delete_action_with_item (gpointer data)
@@ -88,23 +70,18 @@ on_item_activate (GtkMenuItem *item,
void
-MenuBuilderGtk::add_action (const std::string icon,
+MenuBuilderGtk::add_action (G_GNUC_UNUSED const std::string icon,
const std::string label,
const boost::function0<void> callback)
{
GtkWidget *item = NULL;
- GtkWidget *image = NULL;
- const std::string gtk_icon = convert_icon_to_gtk (icon);
Action *action = new Action (callback);
nbr_elements++;
last_was_separator = false;
- item = gtk_image_menu_item_new_with_mnemonic (label.c_str ());
- image = gtk_image_new_from_icon_name (gtk_icon.c_str (), GTK_ICON_SIZE_MENU);
- if (image)
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ item = gtk_menu_item_new_with_mnemonic (label.c_str ());
g_object_set_data_full (G_OBJECT (item),
"menu-builder-gtk-action",
@@ -132,19 +109,15 @@ MenuBuilderGtk::add_separator ()
}
void
-MenuBuilderGtk::add_ghost (const std::string icon,
+MenuBuilderGtk::add_ghost (G_GNUC_UNUSED const std::string icon,
const std::string label)
{
GtkWidget *item = NULL;
- GtkWidget *image = NULL;
nbr_elements++;
last_was_separator = false;
- item = gtk_image_menu_item_new_with_mnemonic (label.c_str ());
- image = gtk_image_new_from_icon_name (icon.c_str (), GTK_ICON_SIZE_MENU);
- if (image)
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ item = gtk_menu_item_new_with_mnemonic (label.c_str ());
gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]