[Xfce4-commits] <xfce4-panel:master> Show the desktop file in the tooltip (bug #8536).
Nick Schermer
noreply at xfce.org
Sat Mar 10 15:12:01 CET 2012
Updating branch refs/heads/master
to bbc68f68cee387e2e05cf3f305434057e734f407 (commit)
from bb5a8410815fd7aa8cff1213bfe2fb3710631cd9 (commit)
commit bbc68f68cee387e2e05cf3f305434057e734f407
Author: Nick Schermer <nick at xfce.org>
Date: Sat Mar 10 15:10:33 2012 +0100
Show the desktop file in the tooltip (bug #8536).
plugins/launcher/launcher-dialog.c | 21 ++++++++++-----------
plugins/launcher/launcher-dialog.glade | 9 ++++++---
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
index bc099d3..b454433 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -69,8 +69,8 @@ enum
COL_ICON,
COL_NAME,
COL_ITEM,
- COL_SEARCH,
- COL_TOOLTIP
+ COL_TOOLTIP,
+ COL_SEARCH /* only in add-store */
};
@@ -185,8 +185,6 @@ launcher_dialog_add_store_insert (gpointer key,
gpointer user_data)
{
GtkTreeIter iter;
- gchar *tooltip;
- GFile *gfile;
GarconMenuItem *item = GARCON_MENU_ITEM (value);
GtkTreeModel *model = GTK_TREE_MODEL (user_data);
@@ -195,13 +193,6 @@ launcher_dialog_add_store_insert (gpointer key,
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
launcher_dialog_items_set_item (model, &iter, item, NULL);
-
- gfile = garcon_menu_item_get_file (item);
- tooltip = g_file_get_parse_name (gfile);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- COL_TOOLTIP, tooltip, -1);
- g_object_unref (G_OBJECT (gfile));
- g_free (tooltip);
}
@@ -1050,6 +1041,8 @@ launcher_dialog_items_set_item (GtkTreeModel *model,
GdkPixbuf *icon = NULL;
const gchar *icon_name;
gint w, h;
+ gchar *tooltip;
+ GFile *gfile;
panel_return_if_fail (GTK_IS_LIST_STORE (model));
panel_return_if_fail (GARCON_IS_MENU_ITEM (item));
@@ -1075,10 +1068,15 @@ launcher_dialog_items_set_item (GtkTreeModel *model,
g_signal_handlers_block_by_func (G_OBJECT (model),
G_CALLBACK (launcher_dialog_tree_row_changed), dialog);
+ gfile = garcon_menu_item_get_file (item);
+ tooltip = g_file_get_parse_name (gfile);
+ g_object_unref (G_OBJECT (gfile));
+
gtk_list_store_set (GTK_LIST_STORE (model), iter,
COL_ICON, icon,
COL_NAME, markup,
COL_ITEM, item,
+ COL_TOOLTIP, tooltip,
-1);
if (dialog != NULL)
@@ -1088,6 +1086,7 @@ launcher_dialog_items_set_item (GtkTreeModel *model,
if (G_LIKELY (icon != NULL))
g_object_unref (G_OBJECT (icon));
g_free (markup);
+ g_free (tooltip);
}
diff --git a/plugins/launcher/launcher-dialog.glade b/plugins/launcher/launcher-dialog.glade
index 06e4f9b..8a64158 100644
--- a/plugins/launcher/launcher-dialog.glade
+++ b/plugins/launcher/launcher-dialog.glade
@@ -37,10 +37,10 @@
<column type="gchararray"/>
<!-- column-name item -->
<column type="GObject"/>
- <!-- column-name search -->
- <column type="gchararray"/>
<!-- column-name tooltip -->
<column type="gchararray"/>
+ <!-- column-name search -->
+ <column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="item-store">
@@ -51,6 +51,8 @@
<column type="gchararray"/>
<!-- column-name item -->
<column type="GObject"/>
+ <!-- column-name tooltip -->
+ <column type="gchararray"/>
</columns>
</object>
<object class="GtkTreeModelFilter" id="add-store-filter">
@@ -214,6 +216,7 @@
<property name="headers_visible">False</property>
<property name="rules_hint">True</property>
<property name="enable_search">False</property>
+ <property name="tooltip_column">3</property>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="spacing">2</property>
@@ -597,7 +600,7 @@
<property name="headers_visible">False</property>
<property name="rules_hint">True</property>
<property name="enable_search">False</property>
- <property name="tooltip_column">4</property>
+ <property name="tooltip_column">3</property>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="spacing">2</property>
More information about the Xfce4-commits
mailing list