[Xfce4-commits] <xfce4-panel:devel> Show comments in the treeview too

Nick Schermer nick at xfce.org
Tue Aug 11 20:26:44 CEST 2009


Updating branch refs/heads/devel
         to ddd472fcb8d9f0fb965c6c97cfba3c7cc271599d (commit)
       from cf5ffb883c9c6d238b34e0b1e14b9b678979902e (commit)

commit ddd472fcb8d9f0fb965c6c97cfba3c7cc271599d
Author: Nick Schermer <nick at xfce.org>
Date:   Wed Feb 11 19:25:42 2009 +0100

    Show comments in the treeview too
    
    This makes items easier to recognize, also cache the
    generated search text when searching a launcher to
    speed it up a bit.
    Minor cleanups.

 plugins/launcher/launcher-dialog.c     |  206 ++++++++++++++++++++++----------
 plugins/launcher/launcher-dialog.glade |    6 +-
 plugins/launcher/launcher.c            |   49 +++++---
 3 files changed, 179 insertions(+), 82 deletions(-)

diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
index 080e826..05fca3c 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -46,9 +46,10 @@ LauncherPluginDialog;
 
 enum
 {
-  COL_ADD_ICON,
-  COL_ADD_NAME,
-  COL_ADD_FILENAME
+  COL_ICON,
+  COL_NAME,
+  COL_FILENAME,
+  COL_SEARCH
 };
 
 
@@ -63,7 +64,7 @@ launcher_dialog_add_visible_function (GtkTreeModel *model,
                                       GtkTreeIter  *iter,
                                       gpointer      user_data)
 {
-  gchar       *name;
+  gchar       *string, *escaped;
   gboolean     visible = FALSE;
   const gchar *text;
   gchar       *normalized;
@@ -80,24 +81,41 @@ launcher_dialog_add_visible_function (GtkTreeModel *model,
   text_casefolded = g_utf8_casefold (normalized, -1);
   g_free (normalized);
 
-  gtk_tree_model_get (model, iter, COL_ADD_NAME, &name, -1);
-  if (G_LIKELY (name != NULL))
+  /* try the pre-build search string first */
+  gtk_tree_model_get (model, iter, COL_SEARCH, &string, -1);
+  if (IS_STRING (string))
     {
-      /* casefold the name */
-      normalized = g_utf8_normalize (name, -1, G_NORMALIZE_ALL);
-      name_casefolded = g_utf8_casefold (normalized, -1);
-      g_free (normalized);
-
       /* search */
-      visible = (strstr (name_casefolded, text_casefolded) != NULL);
+      visible = (strstr (string, text_casefolded) != NULL);
+    }
+  else
+    {
+      /* get the name */
+      gtk_tree_model_get (model, iter, COL_NAME, &string, -1);
+      if (IS_STRING (string))
+        {
+          /* escape and casefold the name */
+          escaped = g_markup_escape_text (string, -1);
+          normalized = g_utf8_normalize (escaped, -1, G_NORMALIZE_ALL);
+          name_casefolded = g_utf8_casefold (normalized, -1);
+          g_free (normalized);
+          g_free (escaped);
 
-      /* cleanup */
-      g_free (name);
-      g_free (name_casefolded);
+          /* search */
+          visible = (strstr (name_casefolded, text_casefolded) != NULL);
+
+          /* store the generated search string */
+          gtk_list_store_set (GTK_LIST_STORE (model), iter, COL_SEARCH,
+                              name_casefolded, -1);
+
+          /* cleanup */
+          g_free (name_casefolded);
+        }
     }
 
   /* cleanup */
   g_free (text_casefolded);
+  g_free (string);
 
   return visible;
 }
@@ -111,10 +129,13 @@ launcher_dialog_add_store_insert (gpointer filename,
 {
   GtkListStore *store = GTK_LIST_STORE (user_data);
   GtkTreeIter   iter;
-  const gchar  *icon_name;
+  const gchar  *icon_name, *name, *comment;
+  gchar        *markup;
 
   panel_return_if_fail (XFCE_IS_MENU_ITEM (item));
   panel_return_if_fail (GTK_IS_LIST_STORE (user_data));
+  panel_return_if_fail (exo_str_is_equal (xfce_menu_item_get_filename (item),
+                        (gchar *) filename));
 
   /* TODO get rid of this and support absolute paths too */
   icon_name = xfce_menu_item_get_icon_name (item);
@@ -123,13 +144,23 @@ launcher_dialog_add_store_insert (gpointer filename,
           || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), icon_name)))
     icon_name = NULL;
 
+  /* create a good looking name */
+  comment = xfce_menu_item_get_comment (item);
+  name = xfce_menu_item_get_name (item);
+  if (IS_STRING (comment))
+    markup = g_strdup_printf ("<b>%s</b>\n%s", name, comment);
+  else
+    markup = g_strdup_printf ("<b>%s</b>", name);
+
   /* insert the item */
   gtk_list_store_append (store, &iter);
   gtk_list_store_set (store, &iter,
-                      COL_ADD_ICON, icon_name,
-                      COL_ADD_NAME, xfce_menu_item_get_name (item),
-                      COL_ADD_FILENAME, xfce_menu_item_get_filename (item),
+                      COL_ICON, icon_name,
+                      COL_NAME, markup,
+                      COL_FILENAME, (gchar *) filename,
                       -1);
+
+  g_free (markup);
 }
 
 
@@ -159,7 +190,8 @@ launcher_dialog_add_populate_model_idle (gpointer user_data)
 
       /* get the item cache and insert everything in the store */
       cache = xfce_menu_item_cache_get_default ();
-      xfce_menu_item_cache_foreach (cache, launcher_dialog_add_store_insert, store);
+      xfce_menu_item_cache_foreach (cache,
+          launcher_dialog_add_store_insert, store);
 
       /* release the root menu and cache */
       g_object_unref (G_OBJECT (root));
@@ -203,8 +235,10 @@ launcher_dialog_add_populate_model (LauncherPluginDialog *dialog)
 
   /* fire an idle menu system load */
   if (G_LIKELY (dialog->idle_populate_id == 0))
-    dialog->idle_populate_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, launcher_dialog_add_populate_model_idle,
-                                                dialog, launcher_dialog_add_populate_model_idle_destroyed);
+    dialog->idle_populate_id = g_idle_add_full (
+        G_PRIORITY_DEFAULT_IDLE,
+        launcher_dialog_add_populate_model_idle,
+        dialog, launcher_dialog_add_populate_model_idle_destroyed);
 }
 
 
@@ -220,7 +254,7 @@ launcher_dialog_tree_save_foreach (GtkTreeModel *model,
   gchar     *filename;
 
   /* get the filename of the entry from the store */
-  gtk_tree_model_get (model, iter, COL_ADD_FILENAME, &filename, -1);
+  gtk_tree_model_get (model, iter, COL_FILENAME, &filename, -1);
 
   /* create a value with the filename */
   value = g_new0 (GValue, 1);
@@ -244,7 +278,8 @@ launcher_dialog_tree_save (LauncherPluginDialog *dialog)
   store = gtk_builder_get_object (dialog->builder, "entry-store");
 
   array = g_ptr_array_new ();
-  gtk_tree_model_foreach (GTK_TREE_MODEL (store), launcher_dialog_tree_save_foreach, array);
+  gtk_tree_model_foreach (GTK_TREE_MODEL (store),
+                          launcher_dialog_tree_save_foreach, array);
   xfconf_channel_set_arrayv (dialog->channel, "/entries", array);
   xfconf_array_free (array);
 }
@@ -260,6 +295,7 @@ launcher_dialog_tree_selection_changed (GtkTreeSelection     *selection,
   GtkTreeIter   iter;
   gint          n_children = -1, position = 0;
   GtkTreePath  *path;
+  gboolean      sensitive;
 
   panel_return_if_fail (GTK_IS_TREE_SELECTION (selection));
   panel_return_if_fail (GTK_IS_BUILDER (dialog->builder));
@@ -280,13 +316,16 @@ launcher_dialog_tree_selection_changed (GtkTreeSelection     *selection,
   gtk_widget_set_sensitive (GTK_WIDGET (object), !!(n_children > 0));
 
   object = gtk_builder_get_object (dialog->builder, "entry-move-up");
-  gtk_widget_set_sensitive (GTK_WIDGET (object), !!(position > 0 && position <= n_children));
+  sensitive = !!(position > 0 && position <= n_children);
+  gtk_widget_set_sensitive (GTK_WIDGET (object), sensitive);
 
   object = gtk_builder_get_object (dialog->builder, "entry-move-down");
-  gtk_widget_set_sensitive (GTK_WIDGET (object), !!(position >= 0 && position < n_children - 1));
+  sensitive = !!(position >= 0 && position < n_children - 1);
+  gtk_widget_set_sensitive (GTK_WIDGET (object), sensitive);
 
   object = gtk_builder_get_object (dialog->builder, "entry-edit");
-  gtk_widget_set_sensitive (GTK_WIDGET (object), !!(position >= 0 && n_children > 0) /* TODO custom only */);
+  sensitive = !!(position >= 0 && n_children > 0); /* TODO custom entries only */
+  gtk_widget_set_sensitive (GTK_WIDGET (object), sensitive);
 }
 
 
@@ -309,7 +348,6 @@ launcher_dialog_entry_button_clicked (GtkWidget            *button,
 
   /* name of the button */
   name = gtk_buildable_get_name (GTK_BUILDABLE (button));
-
   if (exo_str_is_equal (name, "entry-add"))
     {
       object = gtk_builder_get_object (dialog->builder, "dialog-add");
@@ -327,12 +365,17 @@ launcher_dialog_entry_button_clicked (GtkWidget            *button,
       if (exo_str_is_equal (name, "entry-remove"))
         {
           /* create question dialog */
-          window = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (button)),
-                                           GTK_DIALOG_DESTROY_WITH_PARENT,
-                                           GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
-                                           _("Are you sure you want to remove \"%s\"?"), "TODO");
-          gtk_dialog_add_buttons (GTK_DIALOG (window), GTK_STOCK_REMOVE, GTK_RESPONSE_ACCEPT,
-                                  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
+          window = gtk_message_dialog_new (
+              GTK_WINDOW (gtk_widget_get_toplevel (button)),
+              GTK_DIALOG_DESTROY_WITH_PARENT,
+              GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
+              _("Are you sure you want to remove\nthe selected item?"));
+          gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (window),
+              _("If you delete an item, it is permanently removed from the launcher."));
+          gtk_dialog_add_buttons (GTK_DIALOG (window),
+                                  GTK_STOCK_REMOVE, GTK_RESPONSE_ACCEPT,
+                                  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                  NULL);
           gtk_dialog_set_default_response (GTK_DIALOG (window), GTK_RESPONSE_ACCEPT);
 
           /* run the dialog */
@@ -447,18 +490,24 @@ launcher_dialog_add_response (GtkWidget            *widget,
       if (gtk_tree_selection_get_selected (selection, &model, &iter))
         {
           /* get the selected file in the add dialog */
-          gtk_tree_model_get (model, &iter, COL_ADD_FILENAME, &filename, -1);
+          gtk_tree_model_get (model, &iter, COL_FILENAME, &filename, -1);
 
           /* get the selected item in the entry treeview */
           treeview = gtk_builder_get_object (dialog->builder, "entry-treeview");
           selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
           if (gtk_tree_selection_get_selected (selection, &model, &sibling))
-            gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, &sibling);
+            {
+              gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, &sibling);
+            }
           else
-            gtk_list_store_append (GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (treeview))), &iter);
+            {
+              model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview));
+              gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+            }
 
           /* insert the item */
-          launcher_dialog_entries_insert_item (GTK_LIST_STORE (model), &iter, filename);
+          launcher_dialog_entries_insert_item (GTK_LIST_STORE (model),
+                                               &iter, filename);
 
           /* cleanup */
           g_free (filename);
@@ -486,7 +535,9 @@ launcher_dialog_entries_insert_item (GtkListStore *store,
                                      GtkTreeIter  *iter,
                                      const gchar  *filename)
 {
-  XfceRc *rc;
+  XfceRc      *rc;
+  const gchar *icon, *name, *comment;
+  gchar       *markup;
 
   panel_return_if_fail (GTK_IS_LIST_STORE (store));
   panel_return_if_fail (IS_STRING (filename));
@@ -495,13 +546,22 @@ launcher_dialog_entries_insert_item (GtkListStore *store,
   if (G_LIKELY (rc != NULL))
     {
       xfce_rc_set_group (rc, "Desktop Entry");
+      icon = xfce_rc_read_entry_untranslated (rc, "Icon", NULL);
+      name = xfce_rc_read_entry (rc, "Name", NULL);
+      comment = xfce_rc_read_entry (rc, "Comment", NULL);
+
+      if (IS_STRING (comment))
+        markup = g_strdup_printf ("<b>%s</b>\n%s", name, comment);
+      else
+        markup = g_strdup_printf ("<b>%s</b>", name);
 
       gtk_list_store_set (GTK_LIST_STORE (store), iter,
-                          COL_ADD_ICON, xfce_rc_read_entry_untranslated (rc, "Icon", NULL),
-                          COL_ADD_NAME, xfce_rc_read_entry (rc, "Name", NULL),
-                          COL_ADD_FILENAME, filename,
+                          COL_ICON, icon,
+                          COL_NAME, markup,
+                          COL_FILENAME, filename,
                           -1);
       xfce_rc_close (rc);
+      g_free (markup);
     }
 }
 
@@ -540,7 +600,8 @@ launcher_dialog_entries_changed (XfconfChannel        *channel,
         {
           for (i = 0; filenames[i] != NULL; i++)
             {
-              gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, COL_ADD_FILENAME, &filename, -1);
+              gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
+                                  COL_FILENAME, &filename, -1);
               update = !exo_str_is_equal (filenames[i], filename);
               if (G_UNLIKELY (update))
                 break;
@@ -556,7 +617,8 @@ launcher_dialog_entries_changed (XfconfChannel        *channel,
           for (i = 0; update && filenames[i] != NULL; i++)
             {
               gtk_list_store_append (GTK_LIST_STORE (store), &iter);
-              launcher_dialog_entries_insert_item (GTK_LIST_STORE (store), &iter, filenames[i]);
+              launcher_dialog_entries_insert_item (GTK_LIST_STORE (store),
+                                                   &iter, filenames[i]);
             }
         }
 
@@ -578,13 +640,16 @@ launcher_dialog_show (LauncherPlugin *plugin)
   GObject              *window, *object, *entry;
   guint                 i;
   GtkTreeSelection     *selection;
-  const gchar          *entry_names[] = { "entry-add", "entry-remove", "entry-move-up", "entry-move-down", "entry-edit" };
+  const gchar          *entry_names[] = { "entry-add", "entry-remove",
+                                          "entry-move-up", "entry-move-down",
+                                          "entry-edit" };
   LauncherPluginDialog *dialog;
 
   panel_return_if_fail (XFCE_IS_LAUNCHER_PLUGIN (plugin));
 
   builder = gtk_builder_new ();
-  if (gtk_builder_add_from_string (builder, launcher_dialog_glade, launcher_dialog_glade_length, NULL))
+  if (gtk_builder_add_from_string (builder, launcher_dialog_glade,
+                                   launcher_dialog_glade_length, NULL))
     {
       /* create structure */
       dialog = g_slice_new0 (LauncherPluginDialog);
@@ -593,7 +658,8 @@ launcher_dialog_show (LauncherPlugin *plugin)
       dialog->channel = launcher_plugin_get_channel (plugin);
 
       /* monitor the channel for any changes */
-      g_signal_connect (G_OBJECT (dialog->channel), "property-changed", G_CALLBACK (launcher_dialog_entries_changed), dialog);
+      g_signal_connect (G_OBJECT (dialog->channel), "property-changed",
+                        G_CALLBACK (launcher_dialog_entries_changed), dialog);
 
       /* block plugin menu */
       xfce_panel_plugin_block_menu (XFCE_PANEL_PLUGIN (plugin));
@@ -601,58 +667,70 @@ launcher_dialog_show (LauncherPlugin *plugin)
       /* get dialog from builder, release builder when dialog is destroyed */
       window = gtk_builder_get_object (builder, "dialog");
       xfce_panel_plugin_take_window (XFCE_PANEL_PLUGIN (plugin), GTK_WINDOW (window));
-      g_signal_connect (G_OBJECT (window), "response", G_CALLBACK (launcher_dialog_response), dialog);
+      g_signal_connect (G_OBJECT (window), "response",
+                        G_CALLBACK (launcher_dialog_response), dialog);
 
       /* connect entry buttons */
       for (i = 0; i < G_N_ELEMENTS (entry_names); i++)
         {
           object = gtk_builder_get_object (builder, entry_names[i]);
-          g_signal_connect (G_OBJECT (object), "clicked", G_CALLBACK (launcher_dialog_entry_button_clicked), dialog);
+          g_signal_connect (G_OBJECT (object), "clicked",
+                            G_CALLBACK (launcher_dialog_entry_button_clicked), dialog);
         }
 
       /* setup treeview selection */
       object = gtk_builder_get_object (builder, "entry-treeview");
       selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (object));
       gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-      g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (launcher_dialog_tree_selection_changed), dialog);
+      g_signal_connect (G_OBJECT (selection), "changed",
+                        G_CALLBACK (launcher_dialog_tree_selection_changed), dialog);
       launcher_dialog_tree_selection_changed (selection, dialog);
 
       /* connect binding to the advanced properties */
       object = gtk_builder_get_object (builder, "disable-tooltips");
-      //TODOxfconf_g_property_bind (plugin->channel, "/disable-tooltips", G_TYPE_BOOLEAN, object, "active");
+      xfconf_g_property_bind (dialog->channel, "/disable-tooltips",
+                              G_TYPE_BOOLEAN, object, "active");
 
       object = gtk_builder_get_object (builder, "show-labels");
-      //xfconf_g_property_bind (plugin->channel, "/show-labels", G_TYPE_BOOLEAN, object, "active");
+      xfconf_g_property_bind (dialog->channel, "/show-labels",
+                              G_TYPE_BOOLEAN, object, "active");
 
       object = gtk_builder_get_object (builder, "move-first");
-      //xfconf_g_property_bind (plugin->channel, "/move-first", G_TYPE_BOOLEAN, object, "active");
+      xfconf_g_property_bind (dialog->channel, "/move-first",
+                              G_TYPE_BOOLEAN, object, "active");
 
       object = gtk_builder_get_object (builder, "arrow-position");
-      //xfconf_g_property_bind (plugin->channel, "/arrow-position", G_TYPE_UINT, object, "active");
+      xfconf_g_property_bind (dialog->channel, "/arrow-position",
+                              G_TYPE_UINT, object, "active");
 
       /* setup responses for the other dialogs */
       object = gtk_builder_get_object (builder, "dialog-editor");
-      g_signal_connect (G_OBJECT (object), "response", G_CALLBACK (launcher_dialog_editor_response), dialog);
-      g_signal_connect (G_OBJECT (object), "delete-event", G_CALLBACK (exo_noop_true), NULL);
+      g_signal_connect (G_OBJECT (object), "response",
+                        G_CALLBACK (launcher_dialog_editor_response), dialog);
+      g_signal_connect (G_OBJECT (object), "delete-event",
+                        G_CALLBACK (exo_noop_true), NULL);
 
       object = gtk_builder_get_object (builder, "dialog-add");
-      g_signal_connect (G_OBJECT (object), "response", G_CALLBACK (launcher_dialog_add_response), dialog);
-      g_signal_connect (G_OBJECT (object), "delete-event", G_CALLBACK (exo_noop_true), NULL);
+      g_signal_connect (G_OBJECT (object), "response",
+                        G_CALLBACK (launcher_dialog_add_response), dialog);
+      g_signal_connect (G_OBJECT (object), "delete-event",
+                        G_CALLBACK (exo_noop_true), NULL);
 
       object = gtk_builder_get_object (builder, "add-store");
-      gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (object), COL_ADD_NAME, GTK_SORT_ASCENDING);
+      gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (object),
+                                            COL_NAME, GTK_SORT_ASCENDING);
 
       /* setup search filter in the add dialog */
       object = gtk_builder_get_object (builder, "add-store-filter");
       entry = gtk_builder_get_object (builder, "add-search");
-      gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (object), launcher_dialog_add_visible_function, entry, NULL);
-      g_signal_connect_swapped (G_OBJECT (entry), "changed", G_CALLBACK (gtk_tree_model_filter_refilter), object);
+      gtk_tree_model_filter_set_visible_func (GTK_TREE_MODEL_FILTER (object),
+          launcher_dialog_add_visible_function, entry, NULL);
+      g_signal_connect_swapped (G_OBJECT (entry), "changed",
+                                G_CALLBACK (gtk_tree_model_filter_refilter), object);
 
-      /* setup the icon size */
+      /* setup the icon size in the icon renderers */
       object = gtk_builder_get_object (builder, "addrenderericon");
       g_object_set (G_OBJECT (object), "stock-size", GTK_ICON_SIZE_DND, NULL);
-
-      /* setup the icon size */
       object = gtk_builder_get_object (builder, "entryrenderericon");
       g_object_set (G_OBJECT (object), "stock-size", GTK_ICON_SIZE_DND, NULL);
 
diff --git a/plugins/launcher/launcher-dialog.glade b/plugins/launcher/launcher-dialog.glade
index 7b28bf2..2433b5e 100644
--- a/plugins/launcher/launcher-dialog.glade
+++ b/plugins/launcher/launcher-dialog.glade
@@ -37,6 +37,8 @@
       <column type="gchararray"/>
       <!-- column-name filename -->
       <column type="gchararray"/>
+      <!-- column-name search -->
+      <column type="gchararray"/>
     </columns>
   </object>
   <object class="GtkListStore" id="entry-store">
@@ -100,7 +102,7 @@
                             <child>
                               <object class="GtkCellRendererText" id="entryrenderername"/>
                               <attributes>
-                                <attribute name="text">1</attribute>
+                                <attribute name="markup">1</attribute>
                               </attributes>
                             </child>
                           </object>
@@ -747,7 +749,7 @@
                         <child>
                           <object class="GtkCellRendererText" id="addrenderername"/>
                           <attributes>
-                            <attribute name="text">1</attribute>
+                            <attribute name="markup">1</attribute>
                           </attributes>
                         </child>
                       </object>
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 27833f0..af6763d 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -152,7 +152,8 @@ launcher_plugin_property_changed (XfconfChannel  *channel,
   else if (exo_str_is_equal (property_name, "/entries"))
     {
       /* free entries */
-      g_slist_foreach (plugin->entries, (GFunc) launcher_plugin_entry_free, NULL);
+      g_slist_foreach (plugin->entries, (GFunc)
+                       launcher_plugin_entry_free, NULL);
       g_slist_free (plugin->entries);
       plugin->entries = NULL;
 
@@ -188,13 +189,17 @@ launcher_plugin_construct (XfcePanelPlugin *panel_plugin)
   gtk_widget_set_has_tooltip (widget, TRUE);
   gtk_widget_show (widget);
   g_signal_connect (G_OBJECT (widget), "button-press-event",
-                    G_CALLBACK (launcher_plugin_button_press_event), plugin);
+                    G_CALLBACK (launcher_plugin_button_press_event),
+                    plugin);
   g_signal_connect (G_OBJECT (widget), "button-release-event",
-                    G_CALLBACK (launcher_plugin_button_release_event), plugin);
+                    G_CALLBACK (launcher_plugin_button_release_event),
+                    plugin);
   g_signal_connect (G_OBJECT (widget), "query-tooltip",
-                    G_CALLBACK (launcher_plugin_button_query_tooltip), plugin);
+                    G_CALLBACK (launcher_plugin_button_query_tooltip),
+                    plugin);
   g_signal_connect (G_OBJECT (widget), "drag-data-received",
-                    G_CALLBACK (launcher_plugin_button_drag_data_received), plugin);
+                    G_CALLBACK (launcher_plugin_button_drag_data_received),
+                    plugin);
 
   plugin->image = xfce_scaled_image_new ();
   gtk_container_add (GTK_CONTAINER (plugin->button), plugin->image);
@@ -209,12 +214,16 @@ launcher_plugin_construct (XfcePanelPlugin *panel_plugin)
 
   /* sync button states */
   g_signal_connect (G_OBJECT (plugin->button), "state-changed",
-                    G_CALLBACK (launcher_plugin_button_state_changed), plugin->arrow);
+                    G_CALLBACK (launcher_plugin_button_state_changed),
+                    plugin->arrow);
   g_signal_connect (G_OBJECT (plugin->arrow), "state-changed",
-                    G_CALLBACK (launcher_plugin_button_state_changed), plugin->button);
+                    G_CALLBACK (launcher_plugin_button_state_changed),
+                    plugin->button);
 
   /* load global settings */
-  plugin->disable_tooltips = xfconf_channel_get_bool (plugin->channel, "/disable-tooltips", FALSE);
+  plugin->disable_tooltips = xfconf_channel_get_bool (plugin->channel,
+                                                      "/disable-tooltips",
+                                                      FALSE);
 
   /* load the entries */
   launcher_plugin_entries_load (plugin);
@@ -237,7 +246,8 @@ launcher_plugin_free_data (XfcePanelPlugin *panel_plugin)
   xfconf_shutdown ();
 
   /* free entries */
-  g_slist_foreach (plugin->entries, (GFunc) launcher_plugin_entry_free, NULL);
+  g_slist_foreach (plugin->entries, (GFunc)
+                   launcher_plugin_entry_free, NULL);
   g_slist_free (plugin->entries);
 }
 
@@ -273,7 +283,8 @@ launcher_plugin_save (XfcePanelPlugin *panel_plugin)
   LauncherEntry  *entry;
 
   /* save the global settings */
-  xfconf_channel_set_bool (plugin->channel, "/disable-tooltips", plugin->disable_tooltips);
+  xfconf_channel_set_bool (plugin->channel, "/disable-tooltips",
+                           plugin->disable_tooltips);
 
   length = g_slist_length (plugin->entries);
   if (G_LIKELY (length > 0))
@@ -574,8 +585,9 @@ launcher_plugin_entry_exec_on_screen (LauncherEntry *entry,
                                   NULL, &argv, &error))
     {
       /* launch the command on the screen */
-      succeed = xfce_execute_argv_on_screen (screen, entry->path, argv, NULL,
-                                             G_SPAWN_SEARCH_PATH, entry->startup_notify,
+      succeed = xfce_execute_argv_on_screen (screen, entry->path, argv,
+                                             NULL, G_SPAWN_SEARCH_PATH,
+                                             entry->startup_notify,
                                              event_time, entry->icon, &error);
 
       /* cleanup */
@@ -619,12 +631,15 @@ launcher_plugin_entry_exec (LauncherEntry *entry,
       for (li = uri_list; li != NULL && proceed; li = li->next)
         {
           fake.data = li->data;
-          proceed = launcher_plugin_entry_exec_on_screen (entry, event_time, screen, &fake);
+          proceed = launcher_plugin_entry_exec_on_screen (entry,
+                                                          event_time,
+                                                          screen, &fake);
         }
     }
   else
     {
-      launcher_plugin_entry_exec_on_screen (entry, event_time, screen, uri_list);
+      launcher_plugin_entry_exec_on_screen (entry, event_time, screen,
+                                            uri_list);
     }
 }
 
@@ -689,7 +704,8 @@ launcher_plugin_exec_parse (LauncherEntry   *entry,
               case 'F':
                 for (li = uri_list; li != NULL; li = li->next)
                   {
-                    filename = g_filename_from_uri ((const gchar *) li->data, NULL, NULL);
+                    filename = g_filename_from_uri ((const gchar *) li->data,
+                                                    NULL, NULL);
                     if (G_LIKELY (filename != NULL))
                       launcher_plugin_exec_append_quoted (string, filename);
                     g_free (filename);
@@ -705,7 +721,8 @@ launcher_plugin_exec_parse (LauncherEntry   *entry,
               case 'U':
                 for (li = uri_list; li != NULL; li = li->next)
                   {
-                    launcher_plugin_exec_append_quoted (string, (const gchar *) li->data);
+                    launcher_plugin_exec_append_quoted (string, (const gchar *)
+                                                        li->data);
 
                     if (*p == 'u')
                       break;



More information about the Xfce4-commits mailing list