[nautilus-actions] Restore tooltip display for the icon name depending on Gtk+ version



commit ff8e9d460057b770d89146c0d3786f0f0e2bfb9b
Author: Pierre Wieser <pwieser trychlos org>
Date:   Thu May 28 19:08:07 2009 +0200

    Restore tooltip display for the icon name depending on Gtk+ version
---
 ChangeLog                 |    4 ++++
 nact/nact-action-editor.c |   13 +++++++++----
 nact/nact-editor.c        |   13 +++++++++----
 3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca860f1..ea82c84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,10 @@
 	* nact/nautilus-actions-config.glade:
 	Remove (useless) 'field_changed_cb' handler from the menu icon.
 
+	* nact/nact-editor.c:
+	* nact/nact-action-editor.c:
+	Restore tooltip display for the icon name depending on Gtk+ version.
+
 2009-05-25 Pierre Wieser <pwieser trychlos org>
 
 	* configure.ac:
diff --git a/nact/nact-action-editor.c b/nact/nact-action-editor.c
index 61bc434..2765db4 100644
--- a/nact/nact-action-editor.c
+++ b/nact/nact-action-editor.c
@@ -140,7 +140,7 @@ open_action_editor( NautilusActionsConfigAction *action, const gchar* profile_na
 	GtkSizeGroup* label_size_group;
 	GtkSizeGroup* button_size_group;
 	GtkWidget *scheme_listview;
-	GtkWidget *menu_label, *menu_tooltip, *menu_icon;
+	GtkWidget *menu_label, *menu_tooltip, *menu_icon, *menu_icon_name;
 	GtkWidget *command_path, *command_params, *test_patterns, *match_case, *test_mimetypes;
 	GtkWidget *only_files, *only_folders, *both, *accept_multiple;
 	gint width, height /*, x, y*/;
@@ -176,9 +176,14 @@ open_action_editor( NautilusActionsConfigAction *action, const gchar* profile_na
 
 		nact_fill_menu_icon_combo_list_of (GTK_COMBO_BOX_ENTRY (menu_icon));
 
-		/* TODO: replace deprecated gtk_tooltips_set_tip by its equivalent */
-		/*gtk_tooltips_set_tip (gtk_tooltips_new (), GTK_WIDGET (GTK_BIN (menu_icon)->child),
-									 _("Icon of the menu item in the Nautilus popup menu"), "");*/
+		menu_icon_name = GTK_WIDGET( GTK_BIN( menu_icon )->child );
+#if  ((GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION < 12))
+		gtk_tooltips_set_tip (gtk_tooltips_new (),
+				menu_icon_name, _( "Icon of the menu item in the Nautilus popup menu" );, "");
+#else
+		gtk_widget_set_tooltip_text(
+				menu_icon_name, _( "Icon of the menu item in the Nautilus popup menu" ));
+#endif /* Gtk+ 2.12 */
 
 		aligned_widgets = nact_get_glade_widget_prefix_from ("LabelAlign", GLADE_EDIT_ACTION_DIALOG_WIDGET);
 		label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
diff --git a/nact/nact-editor.c b/nact/nact-editor.c
index 9202ed8..a121852 100644
--- a/nact/nact-editor.c
+++ b/nact/nact-editor.c
@@ -647,7 +647,7 @@ open_editor (NautilusActionsConfigAction *action, gboolean is_new)
 	/*GSList* list;*/
 	GtkSizeGroup* label_size_group;
 	/*GtkSizeGroup* button_size_group;*/
-	GtkWidget *menu_icon /*, *scheme_listview*/;
+	GtkWidget *menu_icon, *menu_icon_name;
 	GtkWidget *menu_label, *menu_tooltip, *menu_profiles_list;
 	/*GtkWidget *command_path, *command_params, *test_patterns, *match_case, *test_mimetypes;*/
 	/*GtkWidget *only_files, *only_folders, *both, *accept_multiple;*/
@@ -674,9 +674,14 @@ open_editor (NautilusActionsConfigAction *action, gboolean is_new)
 
 		nact_fill_menu_icon_combo_list_of (GTK_COMBO_BOX_ENTRY (menu_icon));
 
-		/* TODO: replace deprecated gtk_tooltips_set_tip by its equivalent */
-		/*gtk_tooltips_set_tip (gtk_tooltips_new (), GTK_WIDGET (GTK_BIN (menu_icon)->child),
-									 _("Icon of the menu item in the Nautilus popup menu"), "");*/
+		menu_icon_name = GTK_WIDGET( GTK_BIN( menu_icon )->child );
+#if  ((GTK_MAJOR_VERSION == 2) && (GTK_MINOR_VERSION < 12))
+		gtk_tooltips_set_tip (gtk_tooltips_new (),
+				menu_icon_name, _( "Icon of the menu item in the Nautilus popup menu" );, "");
+#else
+		gtk_widget_set_tooltip_text(
+				menu_icon_name, _( "Icon of the menu item in the Nautilus popup menu" ));
+#endif /* Gtk+ 2.12 */
 
 		aligned_widgets = nact_get_glade_widget_prefix_from ("LabelAlign", GLADE_EDIT_DIALOG_WIDGET);
 		label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]