[gtk+] Update tooltip if no removable one is selected
- From: Pascal Terjan <pterjan src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Update tooltip if no removable one is selected
- Date: Thu, 6 Aug 2009 21:29:57 +0000 (UTC)
commit f8171ce092ccc1308e9d31996d2ce9d8cce6caeb
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 abcc010..1c0e5e3 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -3008,24 +3008,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]