]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkrecentaction.c
add static function gtk_scale_button_set_orientation_private() and use it
[~andy/gtk] / gtk / gtkrecentaction.c
index 70c0e241501eedea77768e10712fc65d0636aa06..bf5c6d081e078a9c9bb40624ad7f5fc5a49e5e35 100644 (file)
@@ -19,7 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
+#include "config.h"
 
 #include "gtkintl.h"
 #include "gtkrecentaction.h"
@@ -42,7 +42,6 @@
 struct _GtkRecentActionPrivate
 {
   GtkRecentManager *manager;
-  guint manager_changed_id;
 
   guint show_numbers   : 1;
 
@@ -57,8 +56,8 @@ struct _GtkRecentActionPrivate
 
   GtkRecentSortType sort_type;
   GtkRecentSortFunc sort_func;
-  gpointer sort_data;
-  GDestroyNotify data_destroy;
+  gpointer          sort_data;
+  GDestroyNotify    data_destroy;
 
   GtkRecentFilter *current_filter;
 
@@ -192,6 +191,7 @@ gtk_recent_action_set_sort_func (GtkRecentChooser  *chooser,
 {
   GtkRecentAction *action = GTK_RECENT_ACTION (chooser);
   GtkRecentActionPrivate *priv = action->priv;
+  GSList *l;
   
   if (priv->data_destroy)
     {
@@ -208,6 +208,15 @@ gtk_recent_action_set_sort_func (GtkRecentChooser  *chooser,
       priv->sort_data = sort_data;
       priv->data_destroy = data_destroy;
     }
+
+  for (l = priv->choosers; l; l = l->next)
+    {
+      GtkRecentChooser *chooser_menu = l->data;
+      
+      gtk_recent_chooser_set_sort_func (chooser_menu, priv->sort_func,
+                                        priv->sort_data,
+                                        priv->data_destroy);
+    }
 }
 
 static void
@@ -320,19 +329,10 @@ gtk_recent_action_connect_proxy (GtkAction *action,
   GtkRecentAction *recent_action = GTK_RECENT_ACTION (action);
   GtkRecentActionPrivate *priv = recent_action->priv;
 
+  /* it can only be a recent chooser implementor anyway... */
   if (GTK_IS_RECENT_CHOOSER (widget) &&
       !g_slist_find (priv->choosers, widget))
     {
-      g_object_set (G_OBJECT (widget),
-                    "show-private", priv->show_private,
-                    "show-not-found", priv->show_not_found,
-                    "show-tips", priv->show_tips,
-                    "show-icons", priv->show_icons,
-                    "show-numbers", priv->show_numbers,
-                    "limit", priv->limit,
-                    "sort-type", priv->sort_type,
-                    NULL);
-  
       if (priv->sort_func)
         {
           gtk_recent_chooser_set_sort_func (GTK_RECENT_CHOOSER (widget),
@@ -349,7 +349,8 @@ gtk_recent_action_connect_proxy (GtkAction *action,
                                 action);
     }
 
-  GTK_ACTION_CLASS (gtk_recent_action_parent_class)->connect_proxy (action, widget);
+  if (GTK_ACTION_CLASS (gtk_recent_action_parent_class)->connect_proxy)
+    GTK_ACTION_CLASS (gtk_recent_action_parent_class)->connect_proxy (action, widget);
 }
 
 static void
@@ -365,7 +366,8 @@ gtk_recent_action_disconnect_proxy (GtkAction *action,
   if (g_slist_find (priv->choosers, widget))
     priv->choosers = g_slist_remove (priv->choosers, widget);
 
-  GTK_ACTION_CLASS (gtk_recent_action_parent_class)->disconnect_proxy (action, widget);
+  if (GTK_ACTION_CLASS (gtk_recent_action_parent_class)->disconnect_proxy)
+    GTK_ACTION_CLASS (gtk_recent_action_parent_class)->disconnect_proxy (action, widget);
 }
 
 static GtkWidget *
@@ -384,6 +386,8 @@ gtk_recent_action_create_menu (GtkAction *action)
                          "limit", priv->limit,
                          "sort-type", priv->sort_type,
                          "recent-manager", priv->manager,
+                         "filter", priv->current_filter,
+                         "local-only", priv->local_only,
                          NULL);
   
   if (priv->sort_func)
@@ -435,39 +439,16 @@ gtk_recent_action_create_tool_item (GtkAction *action)
   return toolitem;
 }
 
-static void
-manager_changed_cb (GtkRecentManager *manager,
-                    gpointer          user_data)
-{
-  /* do we need to propagate the signal to all the proxies? guess not */
-}
-
 static void
 set_recent_manager (GtkRecentAction  *action,
                     GtkRecentManager *manager)
 {
   GtkRecentActionPrivate *priv = action->priv;
 
-  if (priv->manager)
-    {
-      if (priv->manager_changed_id)
-        {
-          g_signal_handler_disconnect (priv->manager, priv->manager_changed_id);
-          priv->manager_changed_id = 0;
-        }
-
-      priv->manager = NULL;
-    }
-
   if (manager)
     priv->manager = NULL;
   else
     priv->manager = gtk_recent_manager_get_default ();
-
-  if (priv->manager)
-    priv->manager_changed_id = g_signal_connect (priv->manager, "changed",
-                                                 G_CALLBACK (manager_changed_cb),
-                                                 action);
 }
 
 static void
@@ -498,14 +479,6 @@ gtk_recent_action_dispose (GObject *gobject)
   GtkRecentAction *action = GTK_RECENT_ACTION (gobject);
   GtkRecentActionPrivate *priv = action->priv;
 
-  if (priv->manager_changed_id)
-    {
-      if (priv->manager)
-        g_signal_handler_disconnect (priv->manager, priv->manager_changed_id);
-
-      priv->manager_changed_id = 0;
-    }
-
   if (priv->current_filter)
     {
       g_object_unref (priv->current_filter);
@@ -523,7 +496,6 @@ gtk_recent_action_set_property (GObject      *gobject,
 {
   GtkRecentAction *action = GTK_RECENT_ACTION (gobject);
   GtkRecentActionPrivate *priv = action->priv;
-  GSList *l;
 
   switch (prop_id)
     {
@@ -558,7 +530,7 @@ gtk_recent_action_set_property (GObject      *gobject,
       g_warning ("%s: Choosers of type `%s' do not support selecting multiple items.",
                  G_STRFUNC,
                  G_OBJECT_TYPE_NAME (gobject));
-      break;
+      return;
     case GTK_RECENT_CHOOSER_PROP_RECENT_MANAGER:
       set_recent_manager (action, g_value_get_object (value));
       break;
@@ -566,14 +538,6 @@ gtk_recent_action_set_property (GObject      *gobject,
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
       return;
     }
-
-  /* propagate the properties to the proxies we have created */
-  for (l = priv->choosers; l != NULL; l = l->next)
-    {
-      GObject *proxy = l->data;
-
-      g_object_set_property (proxy, pspec->name, value);
-    }
 }
 
 static void
@@ -680,7 +644,6 @@ gtk_recent_action_init (GtkRecentAction *action)
   priv->current_filter = NULL;
 
   priv->manager = NULL;
-  priv->manager_changed_id = 0;
 }
 
 /**