[Goodies-commits] r7679 - in xfce4-clipman-plugin/trunk: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Sun Jul 5 08:22:17 CEST 2009


Author: mmassonnet
Date: 2009-07-05 06:22:16 +0000 (Sun, 05 Jul 2009)
New Revision: 7679

Modified:
   xfce4-clipman-plugin/trunk/ChangeLog
   xfce4-clipman-plugin/trunk/panel-plugin/menu.c
   xfce4-clipman-plugin/trunk/panel-plugin/plugin.c
Log:
Add reverse-order property to the menu

Modified: xfce4-clipman-plugin/trunk/ChangeLog
===================================================================
--- xfce4-clipman-plugin/trunk/ChangeLog	2009-07-05 04:38:15 UTC (rev 7678)
+++ xfce4-clipman-plugin/trunk/ChangeLog	2009-07-05 06:22:16 UTC (rev 7679)
@@ -1,4 +1,15 @@
 2009-07-05	Mike Massonnet
+Add reverse-order property to the menu
+
+	- panel-plugin/menu.c:
+		Install a new property reverse-order and when set to TRUE it
+		reverses the order the clipboard history inside the menu (bug
+		#5502).
+	- panel-plugin/plugin.c:
+		Bind the new menu property reverse-order to the Xfconf
+		property /tweaks/reverse-menu-order.
+
+2009-07-05	Mike Massonnet
 Add French documentation
 
 2009-07-04	Mike Massonnet

Modified: xfce4-clipman-plugin/trunk/panel-plugin/menu.c
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/menu.c	2009-07-05 04:38:15 UTC (rev 7678)
+++ xfce4-clipman-plugin/trunk/panel-plugin/menu.c	2009-07-05 06:22:16 UTC (rev 7679)
@@ -43,11 +43,25 @@
   GtkWidget            *mi_clear_history;
   ClipmanHistory       *history;
   GSList               *list;
+  gboolean              reverse_order;
 };
 
+enum
+{
+  REVERSE_ORDER = 1,
+};
+
 static void             clipman_menu_class_init         (ClipmanMenuClass *klass);
 static void             clipman_menu_init               (ClipmanMenu *menu);
 static void             clipman_menu_finalize           (GObject *object);
+static void             clipman_menu_set_property       (GObject *object,
+                                                         guint property_id,
+                                                         const GValue *value,
+                                                         GParamSpec *pspec);
+static void             clipman_collector_get_property  (GObject *object,
+                                                         guint property_id,
+                                                         GValue *value,
+                                                         GParamSpec *pspec);
 
 /*
  * Private methods declarations
@@ -146,6 +160,8 @@
 
   /* Insert an updated list of menu items */
   list = clipman_history_get_list (menu->priv->history);
+  if (menu->priv->reverse_order)
+    list = g_list_reverse (list);
   for (l = list; l != NULL; l = l->next)
     {
       item = l->data;
@@ -229,6 +245,13 @@
 
   object_class = G_OBJECT_CLASS (klass);
   object_class->finalize = clipman_menu_finalize;
+
+  g_object_class_install_property (object_class, ENABLE_ACTIONS,
+                                   g_param_spec_boolean ("reverse-order",
+                                                         "ReverseOrder",
+                                                         "Set to TRUE to display the menu in the reverse order",
+                                                         FALSE,
+                                                         G_PARAM_CONSTRUCT|G_PARAM_READWRITE));
 }
 
 static void
@@ -264,3 +287,40 @@
   G_OBJECT_CLASS (clipman_menu_parent_class)->finalize (object);
 }
 
+static void
+clipman_menu_set_property (GObject *object,
+                           guint property_id,
+                           const GValue *value,
+                           GParamSpec *pspec)
+{
+  ClipmanCollectorPrivate *priv = CLIPMAN_COLLECTOR (object)->priv;
+
+  switch (property_id)
+    {
+    case REVERSE_ORDER:
+      priv->reverse_order = g_value_get_boolean (value);
+      break;
+
+    default:
+      break;
+    }
+}
+
+static void
+clipman_collector_get_property (GObject *object,
+                                guint property_id,
+                                GValue *value,
+                                GParamSpec *pspec)
+{
+  ClipmanCollectorPrivate *priv = CLIPMAN_COLLECTOR (object)->priv;
+
+  switch (property_id)
+    {
+    case REVERSE_ORDER:
+      g_value_set_boolean (value, priv->reverse_order);
+      break;
+
+    default:
+      break;
+    }
+}

Modified: xfce4-clipman-plugin/trunk/panel-plugin/plugin.c
===================================================================
--- xfce4-clipman-plugin/trunk/panel-plugin/plugin.c	2009-07-05 04:38:15 UTC (rev 7678)
+++ xfce4-clipman-plugin/trunk/panel-plugin/plugin.c	2009-07-05 06:22:16 UTC (rev 7679)
@@ -104,6 +104,8 @@
 
   /* ClipmanMenu */
   plugin->menu = clipman_menu_new ();
+  xfconf_g_property_bind (plugin->channel, "/tweaks/reverse-menu-order",
+                          G_TYPE_BOOLEAN, plugin->menu, "reverse-order");
 
   /* Load the data */
   plugin_load (plugin);




More information about the Goodies-commits mailing list