[gtk+/gtk-2-16] Update tooltip if no removable one is selected
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-16] Update tooltip if no removable one is selected
- Date: Sat, 29 Aug 2009 02:43:02 +0000 (UTC)
commit 2e06769e896733f74acd800353b47e96a0e5b555
Author: Pascal Terjan <pterjan mandriva com>
Date: Fri Jul 31 18:27:51 2009 +0200
Update tooltip if no removable one is selected
gtk/gtkfilechooserdefault.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 4409ad9..4553f8b 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -3006,24 +3006,27 @@ bookmarks_check_remove_sensitivity (GtkFileChooserDefault *impl)
GtkTreeIter iter;
gboolean removable = FALSE;
gchar *name = NULL;
+ gchar *tip;
if (shortcuts_get_selected (impl, &iter))
- gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter,
- SHORTCUTS_COL_REMOVABLE, &removable,
- SHORTCUTS_COL_NAME, &name,
- -1);
-
- gtk_widget_set_sensitive (impl->browse_shortcuts_remove_button, removable);
-
- if (removable)
{
- gchar *tip;
+ gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter,
+ SHORTCUTS_COL_REMOVABLE, &removable,
+ SHORTCUTS_COL_NAME, &name,
+ -1);
+ gtk_widget_set_sensitive (impl->browse_shortcuts_remove_button, removable);
+
+ if (removable)
+ tip = g_strdup_printf (_("Remove the bookmark '%s'"), name);
+ else
+ tip = g_strdup_printf (_("Bookmark '%s' cannot be removed"), name);
- tip = g_strdup_printf (_("Remove the bookmark '%s'"), name);
gtk_widget_set_tooltip_text (impl->browse_shortcuts_remove_button, tip);
g_free (tip);
}
-
+ else
+ gtk_widget_set_tooltip_text (impl->browse_shortcuts_remove_button,
+ _("Remove the selected bookmark"));
g_free (name);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]