diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2009-01-11 19:49:17 +0000 |
|---|---|---|
| committer | JucaBlues <JucaBlues@users.sourceforge.net> | 2009-01-11 19:49:17 +0000 |
| commit | 2f1426a721ca6983397441e94d35d577fa7b8f6a (patch) | |
| tree | 8d211c7e46c4dc1cc90e17c70a1789c758035bb4 /src | |
| parent | Add CMakeLists for the filters directory. (diff) | |
| download | inkscape-2f1426a721ca6983397441e94d35d577fa7b8f6a.tar.gz inkscape-2f1426a721ca6983397441e94d35d577fa7b8f6a.zip | |
Now it is possible to clear the list of documents in
File -> Open recent
Button added to the Interface page in Inkscape preferences dialog.
(bzr r7115)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 28 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 1 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 0d97c0b77..b4d5ee82e 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1069,7 +1069,14 @@ void InkscapePreferences::initPageUI() _("Set the size for the main tools to use (requires restart)"), false); _misc_recent.init("/options/maxrecentdocuments/value", 0.0, 1000.0, 1.0, 1.0, 1.0, true, false); - _page_ui.add_line( false, _("Maximum documents in Open Recent:"), _misc_recent, "", + + Gtk::HBox* recent_hbox = Gtk::manage(new Gtk::HBox()); + Gtk::Button* reset_recent = Gtk::manage(new Gtk::Button(_("Reset list of recently opened files"))); + reset_recent->signal_clicked().connect(sigc::mem_fun(*this, &InkscapePreferences::on_reset_open_recent_clicked)); + recent_hbox->pack_start(_misc_recent, false, false); + recent_hbox->pack_start(*reset_recent, false, false); + + _page_ui.add_line( false, _("Maximum documents in Open Recent:"), *recent_hbox, "", _("The maximum length of the Open Recent list in the File menu"), false); _ui_zoom_correction.init(300, 30, 1.00, 200.0, 1.0, 10.0, 1.0); @@ -1204,6 +1211,25 @@ bool InkscapePreferences::PresentPage(const Gtk::TreeModel::iterator& iter) return false; } +void InkscapePreferences::on_reset_open_recent_clicked() +{ + GtkRecentManager* manager = gtk_recent_manager_get_default(); + GList* recent_list = gtk_recent_manager_get_items(manager); + GList* element; + GError* error; + + //Remove only elements that were added by Inkscape + for (element = g_list_first(recent_list); element; element = g_list_next(element)){ + error = NULL; + GtkRecentInfo* info = (GtkRecentInfo*) element->data; + if (gtk_recent_info_has_application(info, g_get_prgname())){ + gtk_recent_manager_remove_item(manager, gtk_recent_info_get_uri(info), &error); + } + gtk_recent_info_unref (info); + } + g_list_free(recent_list); +} + void InkscapePreferences::on_pagelist_selection_changed() { // show new selection diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 57b1da09e..0a90ad3d0 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -265,6 +265,7 @@ protected: static void AddNewObjectsStyle(DialogPage& p, Glib::ustring const &prefs_path, const gchar* banner = NULL); void on_pagelist_selection_changed(); + void on_reset_open_recent_clicked(); void initPageMouse(); void initPageScrolling(); void initPageSnapping(); |
