[gnome-panel/features/modernize-for-gnome-3-12: 9/11] applet.[c/h]: fix deprecated warnings * Don't use deprecated GtkImageMenuItem. * Don't use deprecate
- From: Philipp Kaluza <phk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/features/modernize-for-gnome-3-12: 9/11] applet.[c/h]: fix deprecated warnings * Don't use deprecated GtkImageMenuItem. * Don't use deprecate
- Date: Sun, 24 Aug 2014 11:20:18 +0000 (UTC)
commit 6c8a2b622f7a1b444819783aebb78062f158bdf7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Jun 4 20:54:47 2014 +0300
applet.[c/h]: fix deprecated warnings * Don't use deprecated GtkImageMenuItem. * Don't use deprecated
GtkStock.
gnome-panel/applet.c | 21 ++-------------------
gnome-panel/applet.h | 2 --
gnome-panel/launcher.c | 2 --
gnome-panel/panel-action-button.c | 3 ---
gnome-panel/panel-menu-bar.c | 1 -
gnome-panel/panel-menu-button.c | 2 +-
6 files changed, 3 insertions(+), 28 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 77cb9f9..dc11a2e 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -245,7 +245,6 @@ panel_applet_get_callback (GList *user_menu,
void
panel_applet_add_callback (AppletInfo *info,
const char *callback_name,
- const char *stock_item,
const char *menuitem_text,
CallbackEnabledFunc is_enabled_func)
{
@@ -257,7 +256,6 @@ panel_applet_add_callback (AppletInfo *info,
menu = g_new0 (AppletUserMenu, 1);
menu->name = g_strdup (callback_name);
- menu->stock_item = g_strdup (stock_item);
menu->text = g_strdup (menuitem_text);
menu->is_enabled_func = is_enabled_func;
menu->sensitive = TRUE;
@@ -275,15 +273,7 @@ setup_an_item (AppletUserMenu *menu,
GtkWidget *submenu,
int is_submenu)
{
- GtkWidget *image = NULL;
-
- menu->menuitem = gtk_image_menu_item_new_with_mnemonic (menu->text);
- if (menu->stock_item && menu->stock_item [0]) {
- image = gtk_image_new_from_stock (menu->stock_item,
- GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu->menuitem),
- image);
- }
+ menu->menuitem = gtk_menu_item_new_with_mnemonic (menu->text);
gtk_widget_show (menu->menuitem);
g_signal_connect (G_OBJECT (menu->menuitem), "destroy",
@@ -355,7 +345,6 @@ add_to_submenus (AppletInfo *info,
if (s_menu == NULL) {
s_menu = g_new0 (AppletUserMenu,1);
s_menu->name = g_strdup (t);
- s_menu->stock_item = NULL;
s_menu->text = g_strdup (_("???"));
s_menu->sensitive = TRUE;
s_menu->info = info;
@@ -480,7 +469,6 @@ panel_applet_get_edit_menu (AppletInfo *info)
{
GtkWidget *menu;
GtkWidget *menuitem;
- GtkWidget *image;
gboolean movable;
gboolean removable;
@@ -502,11 +490,7 @@ panel_applet_get_edit_menu (AppletInfo *info)
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_set_sensitive (menuitem, movable);
- menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Remove From Panel"));
- image = gtk_image_new_from_stock (GTK_STOCK_REMOVE,
- GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem),
- image);
+ menuitem = gtk_menu_item_new_with_mnemonic (_("_Remove From Panel"));
g_signal_connect (menuitem, "activate",
G_CALLBACK (applet_remove_callback), info);
gtk_widget_show (menuitem);
@@ -769,7 +753,6 @@ panel_applet_destroy (GtkWidget *widget,
AppletUserMenu *umenu = l->data;
g_free (umenu->name);
- g_free (umenu->stock_item);
g_free (umenu->text);
g_free (umenu);
diff --git a/gnome-panel/applet.h b/gnome-panel/applet.h
index 2de0362..d9ccbe6 100644
--- a/gnome-panel/applet.h
+++ b/gnome-panel/applet.h
@@ -33,7 +33,6 @@ typedef gboolean (* CallbackEnabledFunc) (void);
typedef struct {
char *name;
- char *stock_item;
char *text;
CallbackEnabledFunc is_enabled_func;
@@ -64,7 +63,6 @@ void panel_applet_clean (AppletInfo *info);
void panel_applet_add_callback (AppletInfo *info,
const gchar *callback_name,
- const gchar *stock_item,
const gchar *menuitem_text,
CallbackEnabledFunc is_enabled_func);
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index 6e629e6..24f0e25 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -794,13 +794,11 @@ load_launcher_applet (const char *location,
panel_applet_add_callback (launcher->info,
"launch",
- GTK_STOCK_EXECUTE,
_("_Launch"),
NULL);
panel_applet_add_callback (launcher->info,
"properties",
- GTK_STOCK_PROPERTIES,
_("_Properties"),
lancher_properties_enabled);
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index fe7a9f6..b3b5384 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -121,19 +121,16 @@ panel_action_lock_setup_menu (PanelActionButton *button)
{
panel_applet_add_callback (button->priv->info,
"lock",
- NULL,
_("_Lock Screen"),
panel_action_lock_is_enabled);
panel_applet_add_callback (button->priv->info,
"activate",
- NULL,
_("_Activate Screensaver"),
NULL);
panel_applet_add_callback (button->priv->info,
"prefs",
- GTK_STOCK_PROPERTIES,
_("_Properties"),
screensaver_properties_enabled);
}
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index f633c8b..d0f8854 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -219,7 +219,6 @@ panel_menu_bar_load (PanelWidget *panel,
panel_is_program_in_path ("gmenu-simple-editor")) {
panel_applet_add_callback (menubar->priv->info,
"edit",
- NULL,
_("_Edit Menus"),
panel_lockdown_get_not_panels_locked_down_s);
}
diff --git a/gnome-panel/panel-menu-button.c b/gnome-panel/panel-menu-button.c
index 7846e5c..22c4f3a 100644
--- a/gnome-panel/panel-menu-button.c
+++ b/gnome-panel/panel-menu-button.c
@@ -555,7 +555,7 @@ panel_menu_button_load_helper (const char *menu_path,
if (panel_is_program_in_path ("alacarte") ||
panel_is_program_in_path ("gmenu-simple-editor"))
- panel_applet_add_callback (info, "edit", NULL,
+ panel_applet_add_callback (info, "edit",
_("_Edit Menus"),
panel_lockdown_get_not_panels_locked_down_s);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]