[Xfce4-commits] <xfce4-panel:devel> * Move xfce_panel_plugin_menu_show_configure() from _construct() to _init(). * Strip trailing spaces.

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


Updating branch refs/heads/devel
         to c0d95c7e525a77cbb5dfa7d1c0398d300e468c64 (commit)
       from f582c3b55bb4f7b9921357a7b380d72ef25dac81 (commit)

commit c0d95c7e525a77cbb5dfa7d1c0398d300e468c64
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Nov 7 23:00:51 2008 +0100

    * Move xfce_panel_plugin_menu_show_configure() from
      _construct() to _init().
    * Strip trailing spaces.

 common/panel-dbus.h                        |    2 +-
 libxfce4panel/xfce-panel-plugin-provider.c |   16 ++++++++--------
 libxfce4panel/xfce-panel-plugin.c          |    4 ++--
 panel/panel-dbus-service.c                 |    6 +++---
 panel/panel-itembar.c                      |    4 ++--
 panel/panel-itembar.h                      |    2 +-
 panel/panel-preferences-dialog.c           |   28 ++++++++++++++--------------
 plugins/clock/clock-fuzzy.c                |    6 +++---
 plugins/clock/clock.c                      |   12 ++++++------
 plugins/launcher/launcher.c                |    6 +++---
 plugins/separator/separator.c              |    6 +++---
 plugins/tasklist/tasklist-widget.c         |   28 ++++++++++++++--------------
 plugins/tasklist/tasklist.c                |    7 +++++--
 wrapper/main.c                             |    4 ++--
 14 files changed, 67 insertions(+), 64 deletions(-)

diff --git a/common/panel-dbus.h b/common/panel-dbus.h
index 832ba97..ed6cb9a 100644
--- a/common/panel-dbus.h
+++ b/common/panel-dbus.h
@@ -36,7 +36,7 @@ enum _DBusPropertyChanged
   PROPERTY_CHANGED_PROVIDER_EMIT_SAVE,
   PROPERTY_CHANGED_PROVIDER_EMIT_SHOW_CONFIGURE,
   PROPERTY_CHANGED_PROVIDER_EMIT_SHOW_ABOUT,
-  
+
   /* wrapper plug */
   PROPERTY_CHANGED_WRAPPER_BACKGROUND_ALPHA,
   PROPERTY_CHANGED_WRAPPER_SET_SELECTED,
diff --git a/libxfce4panel/xfce-panel-plugin-provider.c b/libxfce4panel/xfce-panel-plugin-provider.c
index 06ca40b..ef55467 100644
--- a/libxfce4panel/xfce-panel-plugin-provider.c
+++ b/libxfce4panel/xfce-panel-plugin-provider.c
@@ -152,40 +152,40 @@ xfce_panel_plugin_provider_send_signal (XfcePanelPluginProvider       *provider,
 
 
 
-PANEL_SYMBOL_EXPORT gboolean     
+PANEL_SYMBOL_EXPORT gboolean
 xfce_panel_plugin_provider_get_show_configure (XfcePanelPluginProvider *provider)
 {
   panel_return_val_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (provider), FALSE);
-  
+
   return (*XFCE_PANEL_PLUGIN_PROVIDER_GET_IFACE (provider)->get_show_configure) (provider);
 }
 
 
 
-PANEL_SYMBOL_EXPORT void     
+PANEL_SYMBOL_EXPORT void
 xfce_panel_plugin_provider_show_configure (XfcePanelPluginProvider *provider)
 {
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (provider));
-  
+
   return (*XFCE_PANEL_PLUGIN_PROVIDER_GET_IFACE (provider)->show_configure) (provider);
 }
 
 
 
-PANEL_SYMBOL_EXPORT gboolean     
+PANEL_SYMBOL_EXPORT gboolean
 xfce_panel_plugin_provider_get_show_about (XfcePanelPluginProvider *provider)
 {
   panel_return_val_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (provider), FALSE);
-  
+
   return (*XFCE_PANEL_PLUGIN_PROVIDER_GET_IFACE (provider)->get_show_about) (provider);
 }
 
 
 
-PANEL_SYMBOL_EXPORT void     
+PANEL_SYMBOL_EXPORT void
 xfce_panel_plugin_provider_show_about (XfcePanelPluginProvider *provider)
 {
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (provider));
-  
+
   return (*XFCE_PANEL_PLUGIN_PROVIDER_GET_IFACE (provider)->show_about) (provider);
 }
diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index 6526ac8..4178024 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -900,7 +900,7 @@ static void
 xfce_panel_plugin_show_configure (XfcePanelPluginProvider *provider)
 {
   XfcePanelPlugin *plugin = XFCE_PANEL_PLUGIN (provider);
-  
+
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (provider));
 
   /* emit configure-plugin signal */
@@ -927,7 +927,7 @@ static void
 xfce_panel_plugin_show_about (XfcePanelPluginProvider *provider)
 {
   XfcePanelPlugin *plugin = XFCE_PANEL_PLUGIN (provider);
-  
+
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (provider));
 
   /* emit about signal */
diff --git a/panel/panel-dbus-service.c b/panel/panel-dbus-service.c
index 86a1ead..0253f1b 100644
--- a/panel/panel-dbus-service.c
+++ b/panel/panel-dbus-service.c
@@ -114,7 +114,7 @@ static void
 panel_dbus_service_init (PanelDBusService *service)
 {
   GError *error = NULL;
-  
+
   /* TODO implement derror handing in the dbus_bus_request_name functions */
 
   /* try to connect to the session bus */
@@ -125,13 +125,13 @@ panel_dbus_service_init (PanelDBusService *service)
       /* request the org.xfce.Panel name */
       dbus_bus_request_name (dbus_g_connection_get_connection (service->connection),
                              PANEL_DBUS_PANEL_INTERFACE, 0, NULL);
-                             
+
       /* request the org.xfce.PanelPlugin name */
       dbus_bus_request_name (dbus_g_connection_get_connection (service->connection),
                              PANEL_DBUS_PLUGIN_INTERFACE, 0, NULL);
 
       /* register the /org/xfce/Panel object */
-      dbus_g_connection_register_g_object (service->connection, PANEL_DBUS_PATH, 
+      dbus_g_connection_register_g_object (service->connection, PANEL_DBUS_PATH,
                                            G_OBJECT (service));
     }
   else
diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c
index 341975c..ce6c89f 100644
--- a/panel/panel-itembar.c
+++ b/panel/panel-itembar.c
@@ -921,11 +921,11 @@ panel_itembar_get_nth_child (PanelItembar *itembar,
 
 
 
-guint           
+guint
 panel_itembar_get_n_children (PanelItembar *itembar)
 {
   panel_return_val_if_fail (PANEL_IS_ITEMBAR (itembar), 0);
-  
+
   return g_slist_length (itembar->children);
 }
 
diff --git a/panel/panel-itembar.h b/panel/panel-itembar.h
index 073d103..ed09634 100644
--- a/panel/panel-itembar.h
+++ b/panel/panel-itembar.h
@@ -71,7 +71,7 @@ gint            panel_itembar_get_child_index       (PanelItembar   *itembar,
 
 GtkWidget      *panel_itembar_get_nth_child         (PanelItembar   *itembar,
                                                      guint           idx);
-                                                     
+
 guint           panel_itembar_get_n_children        (PanelItembar   *itembar);
 
 guint           panel_itembar_get_drop_index        (PanelItembar   *itembar,
diff --git a/panel/panel-preferences-dialog.c b/panel/panel-preferences-dialog.c
index 9edbd6c..04604ba 100644
--- a/panel/panel-preferences-dialog.c
+++ b/panel/panel-preferences-dialog.c
@@ -459,7 +459,7 @@ panel_preferences_dialog_item_get_selected (PanelPreferencesDialog *dialog,
       /* get the selected provider */
       gtk_tree_model_get (model, &iter, COLUMN_PROVIDER, &provider, -1);
       panel_return_val_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (provider), NULL);
-      
+
       if (return_iter)
         *return_iter = iter;
     }
@@ -522,11 +522,11 @@ panel_preferences_dialog_item_move (GtkWidget              *button,
   GtkTreePath             *path;
 
   panel_return_if_fail (PANEL_IS_PREFERENCES_DIALOG (dialog));
-  
+
   /* direction */
   object = gtk_builder_get_object (GTK_BUILDER (dialog), "item-up");
   direction = G_OBJECT (button) == object ? -1 : 1;
-  
+
   /* get the selected item */
   provider = panel_preferences_dialog_item_get_selected (dialog, &iter_a);
 
@@ -535,25 +535,25 @@ panel_preferences_dialog_item_move (GtkWidget              *button,
     {
       /* get the itembar */
       itembar = gtk_bin_get_child (GTK_BIN (dialog->active));
-      
+
       /* get the provider position on the panel */
-      position = panel_itembar_get_child_index (PANEL_ITEMBAR (itembar), 
+      position = panel_itembar_get_child_index (PANEL_ITEMBAR (itembar),
                                                 GTK_WIDGET (provider));
-      
+
       if (G_LIKELY (position != -1))
         {
           /* move the item on the panel */
           panel_itembar_reorder_child (PANEL_ITEMBAR (itembar),
                                        GTK_WIDGET (provider),
                                        position + direction);
-                                       
-          
+
+
           /* most the item up or down in the list */
           if (direction == 1)
             {
               /* init the 2nd iter */
               iter_b = iter_a;
-              
+
               /* swap the items in the list */
               if (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->store), &iter_b))
                 gtk_list_store_swap (dialog->store, &iter_a, &iter_b);
@@ -566,15 +566,15 @@ panel_preferences_dialog_item_move (GtkWidget              *button,
                 {
                   /* determine the iter for the previous item */
                   gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->store), &iter_b, path);
-                  
+
                   /* swap the items in the list */
                   gtk_list_store_swap (dialog->store, &iter_a, &iter_b);
                 }
-                
+
               /* release the path */
               gtk_tree_path_free (path);
             }
-            
+
           /* fake update the selection */
           treeview = gtk_builder_get_object (GTK_BUILDER (dialog), "item-treeview");
           selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
@@ -601,7 +601,7 @@ panel_preferences_dialog_item_remove (GtkWidget              *button,
 
   /* send signal */
   xfce_panel_plugin_provider_send_signal (provider, PROVIDER_SIGNAL_REMOVE_PLUGIN);
-  
+
   /* remove from treeview */
   gtk_list_store_remove (dialog->store, &iter);
 }
@@ -613,7 +613,7 @@ panel_preferences_dialog_item_add (GtkWidget              *button,
                                    PanelPreferencesDialog *dialog)
 {
   panel_return_if_fail (PANEL_IS_PREFERENCES_DIALOG (dialog));
-  
+
   /* TODO */
 }
 
diff --git a/plugins/clock/clock-fuzzy.c b/plugins/clock/clock-fuzzy.c
index f5cda83..846fc17 100644
--- a/plugins/clock/clock-fuzzy.c
+++ b/plugins/clock/clock-fuzzy.c
@@ -50,7 +50,7 @@ enum
   FUZZINESS_15_MINS,
   FUZZINESS_DAY,
   FUZZINESS_WEEK,
-  
+
   FUZZINESS_MIN = FUZZINESS_5_MINS,
   FUZZINESS_MAX = FUZZINESS_WEEK,
   FUZZINESS_DEFAULT = FUZZINESS_15_MINS
@@ -180,7 +180,7 @@ xfce_clock_fuzzy_update (gpointer user_data)
 
   /* get the local time */
   clock_plugin_get_localtime (&tm);
-  
+
   switch (clock->fuzziness)
     {
       case FUZZINESS_5_MINS:
@@ -189,7 +189,7 @@ xfce_clock_fuzzy_update (gpointer user_data)
       case FUZZINESS_WEEK:
         gtk_label_set_text (GTK_LABEL (clock), _(strings_day[tm.tm_hour / 3]));
         break;
-    }; 
+    };
 
   return TRUE;
 }
diff --git a/plugins/clock/clock.c b/plugins/clock/clock.c
index acfb19e..33cc6e2 100644
--- a/plugins/clock/clock.c
+++ b/plugins/clock/clock.c
@@ -138,6 +138,9 @@ clock_plugin_init (ClockPlugin *plugin)
   /* initialize xfconf */
   xfconf_init (NULL);
 
+  /* show configure */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* create frame widget */
   plugin->frame = gtk_frame_new (NULL);
   gtk_container_add (GTK_CONTAINER (plugin), plugin->frame);
@@ -153,9 +156,6 @@ clock_plugin_construct (XfcePanelPlugin *panel_plugin)
   gboolean       show_frame;
   guint          mode;
 
-  /* show configure */
-  xfce_panel_plugin_menu_show_configure (panel_plugin);
-
   /* set the xfconf channel */
   plugin->channel = xfce_panel_plugin_xfconf_channel_new (panel_plugin);
   g_signal_connect (G_OBJECT (plugin->channel), "property-changed",
@@ -392,12 +392,12 @@ clock_plugin_set_child (ClockPlugin *plugin)
         /* get update interval */
         plugin->clock_interval = xfce_clock_digital_interval (XFCE_CLOCK_DIGITAL (plugin->clock));
         break;
-        
+
       case CLOCK_PLUGIN_MODE_FUZZY:
         /* create widget */
         plugin->clock = xfce_clock_fuzzy_new ();
         plugin->clock_func = xfce_clock_fuzzy_update;
-        
+
         /* connect binding */
         xfconf_g_property_bind (plugin->channel, "/fuzziness",
                                 G_TYPE_UINT, plugin->clock, "fuzziness");
@@ -429,7 +429,7 @@ clock_plugin_set_child (ClockPlugin *plugin)
   /* add the widget to the plugin frame */
   gtk_container_add (GTK_CONTAINER (plugin->frame), plugin->clock);
   gtk_widget_show (plugin->clock);
-  
+
   /* update the clock once */
   (plugin->clock_func) (plugin->clock);
 }
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 9cc3a94..749d40b 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -125,6 +125,9 @@ launcher_plugin_init (LauncherPlugin *plugin)
   plugin->show_labels = FALSE; /* TODO */
   plugin->arrow_position = ARROW_POS_DEFAULT;
 
+  /* show the configure menu item */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* create the dialog widgets */
   plugin->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
   gtk_container_add (GTK_CONTAINER (plugin), plugin->box);
@@ -270,9 +273,6 @@ launcher_plugin_construct (XfcePanelPlugin *panel_plugin)
   g_signal_connect (G_OBJECT (plugin->channel), "property-changed",
                     G_CALLBACK (launcher_plugin_property_changed), plugin);
 
-  /* show the configure menu item */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
-
   /* read the plugin configuration */
   if (launcher_plugin_read (plugin) == FALSE)
     {
diff --git a/plugins/separator/separator.c b/plugins/separator/separator.c
index 60c9507..e6b2d8b 100644
--- a/plugins/separator/separator.c
+++ b/plugins/separator/separator.c
@@ -121,6 +121,9 @@ separator_plugin_init (SeparatorPlugin *plugin)
   /* init, draw nothing */
   plugin->style = SEPARATOR_PLUGIN_STYLE_TRANSPARENT;
 
+  /* show the properties dialog */
+  xfce_panel_plugin_menu_show_configure (panel_plugin);
+
   /* initialize xfconf */
   xfconf_init (NULL);
 }
@@ -203,9 +206,6 @@ separator_plugin_construct (XfcePanelPlugin *panel_plugin)
   g_signal_connect (G_OBJECT (plugin->channel), "property-changed",
                     G_CALLBACK (separator_plugin_property_changed), plugin);
 
-  /* show the properties dialog */
-  xfce_panel_plugin_menu_show_configure (panel_plugin);
-
   /* read the style */
   style = xfconf_channel_get_uint (plugin->channel, "/style", SEPARATOR_PLUGIN_STYLE_DEFAULT);
   plugin->style = CLAMP (style, SEPARATOR_PLUGIN_STYLE_MIN, SEPARATOR_PLUGIN_STYLE_MAX);
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index dafc129..4ea67cf 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -95,7 +95,7 @@ struct _XfceTasklist
   /* whether we show wireframes when hovering a button in
    * the tasklist */
   guint              show_wireframes : 1;
-  
+
   /* wireframe window */
   Window             wireframe_window;
 };
@@ -358,7 +358,7 @@ xfce_tasklist_finalize (GObject *object)
 
   panel_return_if_fail (tasklist->children == NULL);
   /* panel_return_if_fail (tasklist->class_groups == NULL); */
-  
+
   /* destroy the wireframe window */
   if (tasklist->wireframe_window != 0)
     xfce_tasklist_wireframe_destroy (tasklist);
@@ -945,7 +945,7 @@ xfce_tasklist_wireframe_hide (XfceTasklist *tasklist)
 {
   panel_return_if_fail (XFCE_IS_TASKLIST (tasklist));
   panel_return_if_fail (tasklist->wireframe_window != 0);
-  
+
   /* unmap the window */
   XUnmapWindow (GDK_DISPLAY (), tasklist->wireframe_window);
 }
@@ -956,14 +956,14 @@ static void
 xfce_tasklist_wireframe_destroy (XfceTasklist *tasklist)
 {
   Display *dpy = GDK_DISPLAY ();
-  
+
   panel_return_if_fail (XFCE_IS_TASKLIST (tasklist));
   panel_return_if_fail (tasklist->wireframe_window != 0);
-  
+
   /* unmap and destroy the window */
   XUnmapWindow (dpy, tasklist->wireframe_window);
   XDestroyWindow (dpy, tasklist->wireframe_window);
-  
+
   /* set to nul */
   tasklist->wireframe_window = 0;
 }
@@ -979,7 +979,7 @@ xfce_tasklist_wireframe_update (XfceTasklist      *tasklist,
   XSetWindowAttributes  attrs;
   GC                    gc;
   XRectangle            xrect;
-  
+
   panel_return_if_fail (XFCE_IS_TASKLIST (tasklist));
   panel_return_if_fail (tasklist->show_wireframes == TRUE);
   panel_return_if_fail (WNCK_IS_WINDOW (child->window));
@@ -991,13 +991,13 @@ xfce_tasklist_wireframe_update (XfceTasklist      *tasklist,
     {
       /* reposition the wireframe */
       XMoveResizeWindow (dpy, tasklist->wireframe_window, x, y, width, height);
-      
+
       /* full window rectangle */
       xrect.x = 0;
       xrect.y = 0;
       xrect.width = width;
       xrect.height = height;
-  
+
       /* we need to restore the window first */
       XShapeCombineRectangles (dpy, tasklist->wireframe_window, ShapeBounding,
                                0, 0, &xrect, 1, ShapeSet, Unsorted);
@@ -1016,7 +1016,7 @@ xfce_tasklist_wireframe_update (XfceTasklist      *tasklist,
                                                   CWOverrideRedirect | CWBackPixel,
                                                   &attrs);
     }
-  
+
   /* create rectangle what will be 'transparent' in the window */
   xrect.x = WIREFRAME_SIZE;
   xrect.y = WIREFRAME_SIZE;
@@ -1249,14 +1249,14 @@ tasklist_button_enter_notify_event (GtkWidget         *button,
   /* leave when there is nothing to do */
   if (child->tasklist->show_wireframes == FALSE)
     return FALSE;
-  
+
   /* create wireframe */
   xfce_tasklist_wireframe_update (child->tasklist, child);
 
   /* connect signal to destroy the window when the user leaves the button */
   g_signal_connect (G_OBJECT (button), "leave-notify-event",
                     G_CALLBACK (tasklist_button_leave_notify_event), child);
-                    
+
   /* monitor geometry changes */
   g_signal_connect (G_OBJECT (child->window), "geometry-changed",
                     G_CALLBACK (tasklist_button_geometry_changed), child);
@@ -1466,10 +1466,10 @@ xfce_tasklist_set_show_wireframes (XfceTasklist *tasklist,
                                    gboolean      show_wireframes)
 {
   panel_return_if_fail (XFCE_IS_TASKLIST (tasklist));
-  
+
   /* set new value */
   tasklist->show_wireframes = !!show_wireframes;
-  
+
   /* destroy the window if needed */
   if (show_wireframes == FALSE && tasklist->wireframe_window != 0)
     xfce_tasklist_wireframe_destroy (tasklist);
diff --git a/plugins/tasklist/tasklist.c b/plugins/tasklist/tasklist.c
index 99adcae..dc1ed86 100644
--- a/plugins/tasklist/tasklist.c
+++ b/plugins/tasklist/tasklist.c
@@ -94,6 +94,10 @@ tasklist_plugin_init (TasklistPlugin *plugin)
   /* initialize xfconf */
   xfconf_init (NULL);
 
+  /* show configure */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
+  /* create the tasklist */
   plugin->tasklist = g_object_new (XFCE_TYPE_TASKLIST, NULL);
   gtk_container_add (GTK_CONTAINER (plugin), plugin->tasklist);
 }
@@ -106,8 +110,7 @@ tasklist_plugin_construct (XfcePanelPlugin *panel_plugin)
   TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
 
   /* expand the plugin */
-  xfce_panel_plugin_set_expand (XFCE_PANEL_PLUGIN (plugin), TRUE);
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+  xfce_panel_plugin_set_expand (panel_plugin, TRUE);
 
   /* open the xfconf channel */
   plugin->channel = xfce_panel_plugin_xfconf_channel_new (panel_plugin);
diff --git a/wrapper/main.c b/wrapper/main.c
index 79dc8b3..2be4cbc 100644
--- a/wrapper/main.c
+++ b/wrapper/main.c
@@ -109,11 +109,11 @@ dbus_gproxy_property_changed (DBusGProxy              *dbus_gproxy,
       case PROPERTY_CHANGED_PROVIDER_EMIT_SAVE:
         xfce_panel_plugin_provider_save (provider);
         break;
-        
+
       case PROPERTY_CHANGED_PROVIDER_EMIT_SHOW_CONFIGURE:
         xfce_panel_plugin_provider_show_configure (provider);
         break;
-        
+
       case PROPERTY_CHANGED_PROVIDER_EMIT_SHOW_ABOUT:
         xfce_panel_plugin_provider_show_about (provider);
         break;



More information about the Xfce4-commits mailing list