[gtk+] settings: add a gtk-recent-files-enabled GtkSetting



commit c896adc9e915afd1ed29f5f2e726a5955205dfa6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Feb 13 11:05:07 2013 -0500

    settings: add a gtk-recent-files-enabled GtkSetting
    
    Backed by an XSetting, so g-s-d can set it according to the GSettings
    value.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693724

 gdk/x11/gdksettings.c |    3 ++-
 gtk/gtksettings.c     |   20 +++++++++++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdksettings.c b/gdk/x11/gdksettings.c
index 943e84b..e2fdcf2 100644
--- a/gdk/x11/gdksettings.c
+++ b/gdk/x11/gdksettings.c
@@ -75,7 +75,8 @@ static const struct {
   {"Gtk/ShellShowsAppMenu",   "gtk-shell-shows-app-menu"},
   {"Gtk/ShellShowsMenubar",   "gtk-shell-shows-menubar"},
   {"Gtk/EnablePrimaryPaste",  "gtk-enable-primary-paste"},
-  {"Gtk/RecentFilesMaxAge",   "gtk-recent-files-max-age"}
+  {"Gtk/RecentFilesMaxAge",   "gtk-recent-files-max-age"},
+  {"Gtk/RecentFilesEnabled",  "gtk-recent-files-enabled"}
 };
 
 static const char *
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 0fc7dd0..3c9036c 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -211,7 +211,8 @@ enum {
   PROP_IM_STATUS_STYLE,
   PROP_SHELL_SHOWS_APP_MENU,
   PROP_SHELL_SHOWS_MENUBAR,
-  PROP_ENABLE_PRIMARY_PASTE
+  PROP_ENABLE_PRIMARY_PASTE,
+  PROP_RECENT_FILES_ENABLED
 };
 
 /* --- prototypes --- */
@@ -1406,6 +1407,23 @@ gtk_settings_class_init (GtkSettingsClass *class)
                                              NULL);
   g_assert (result == PROP_ENABLE_PRIMARY_PASTE);
 
+  /**
+   * GtkSettings:gtk-recent-files-enabled:
+   *
+   * Whether GTK+ should keep track of items inside the recently used
+   * resources list. If set to %FALSE, the list will always be empty.
+   *
+   * Since: 3.8
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-recent-files-enabled",
+                                                                   P_("Recent Files Enabled"),
+                                                                   P_("Whether GTK+ remembers recent files"),
+                                                                   TRUE,
+                                                                   GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_RECENT_FILES_ENABLED);
+
   g_type_class_add_private (class, sizeof (GtkSettingsPrivate));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]