[Goodies-commits] r6425 - in xfce4-clipman-plugin/branches/xfce-4-6: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Fri Jan 9 18:43:28 CET 2009


Author: mmassonnet
Date: 2009-01-09 17:43:28 +0000 (Fri, 09 Jan 2009)
New Revision: 6425

Modified:
   xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog
   xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c
   xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c
   xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/menu.c
Log:
Some small fixes.

Modified: xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog
===================================================================
--- xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog	2009-01-09 13:37:27 UTC (rev 6424)
+++ xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog	2009-01-09 17:43:28 UTC (rev 6425)
@@ -1,4 +1,19 @@
 2009-01-09	Mike Massonnet
+Some small fixes.
+
+	- panel-plugin/history.c(clipman_history_add_text):
+		Don't escape the text for markups as the preview is displayed
+		as a label, and not as a markup.
+	- panel-plugin/history.c(clipman_history_finalize):
+		Clear the GSLists stored inside ClipmanHistory on finalize.
+	- panel-plugin/menu.c(_clipman_menu_update_list):
+		Set the clear history menu item sensitive/insensitive given the
+		status of the history.  For that store a pointer of the menu
+		item inside the private data.
+	- panel-plugin/collector.c(cb_clipboard_owner_change):
+		Make sure the image is not NULL before adding it to the history
+
+2009-01-09	Mike Massonnet
 Major rewrite of the plugin using GObjects and Xfconf.
 
 	- The plugin now uses GObjects with properties binded to Xfconf for easy

Modified: xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c
===================================================================
--- xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c	2009-01-09 13:37:27 UTC (rev 6424)
+++ xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c	2009-01-09 17:43:28 UTC (rev 6425)
@@ -140,7 +140,8 @@
       else if (has_image)
         {
           image = gtk_clipboard_wait_for_image (collector->priv->default_clipboard);
-          clipman_history_add_image (collector->priv->history, image, collector->priv->default_clipboard);
+          if (image != NULL)
+            clipman_history_add_image (collector->priv->history, image, collector->priv->default_clipboard);
           g_object_unref (image);
         }
     }

Modified: xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c
===================================================================
--- xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c	2009-01-09 13:37:27 UTC (rev 6424)
+++ xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c	2009-01-09 17:43:28 UTC (rev 6425)
@@ -228,9 +228,7 @@
     }
 
   /* Cleanup special characters from preview */
-  tmp2 = g_strdelimit (tmp1, "\n\r\t", ' ');
-  tmp1 = g_markup_escape_text (tmp2, -1);
-  g_free (tmp2);
+  tmp1 = g_strdelimit (tmp1, "\n\r\t", ' ');
 
   /* Set preview */
   item->preview.text = tmp1;
@@ -394,7 +392,7 @@
 static void
 clipman_history_finalize (GObject *object)
 {
-  /* TODO Free the GSLists */
+  clipman_history_clear (CLIPMAN_HISTORY (object));
   G_OBJECT_CLASS (clipman_history_parent_class)->finalize (object);
 }
 

Modified: xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/menu.c
===================================================================
--- xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/menu.c	2009-01-09 13:37:27 UTC (rev 6424)
+++ xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/menu.c	2009-01-09 17:43:28 UTC (rev 6425)
@@ -39,6 +39,7 @@
 
 struct _ClipmanMenuPrivate
 {
+  GtkWidget            *mi_clear_history;
   ClipmanHistory       *history;
   GSList               *list;
 };
@@ -139,6 +140,9 @@
   /* Clear the previous menu items */
   _clipman_menu_free_list (menu);
 
+  /* Set the clear history item sensitive */
+  gtk_widget_set_sensitive (menu->priv->mi_clear_history, TRUE);
+
   /* Insert an updated list of menu items */
   for (i = 0; i < 2; i++)
     {
@@ -183,11 +187,15 @@
 
   if (pos == 0)
     {
+      /* Insert empty menu item */
       mi = gtk_menu_item_new_with_label (_("Clipboard is empty"));
       menu->priv->list = g_slist_prepend (menu->priv->list, mi);
       gtk_menu_shell_insert (GTK_MENU_SHELL (menu), mi, 0);
       gtk_widget_set_sensitive (mi, FALSE);
       gtk_widget_show (mi);
+
+      /* Set the clear history item insensitive */
+      gtk_widget_set_sensitive (menu->priv->mi_clear_history, FALSE);
     }
 }
 
@@ -245,7 +253,7 @@
   mi = gtk_separator_menu_item_new ();
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
 
-  mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_CLEAR, NULL);
+  menu->priv->mi_clear_history = mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_CLEAR, NULL);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
   g_signal_connect_swapped (mi, "activate",
                             G_CALLBACK (cb_clear_history), menu);




More information about the Goodies-commits mailing list