[passepartout] use the passepartout filter for the recent files, too
- From: Sven Herzberg <herzi src gnome org>
- To: svn-commits-list gnome org
- Subject: [passepartout] use the passepartout filter for the recent files, too
- Date: Sat, 2 May 2009 09:32:58 -0400 (EDT)
commit bea8793b0dca84fa2a953433b6d7e64c71f9f5dc
Author: Sven Herzberg <herzi lanedo com>
Date: Sat May 2 00:02:39 2009 +0200
use the passepartout filter for the recent files, too
* src/pptout/filter.cc,
* src/pptout/filter.h: added the mime type (taken from windowmenus)
* src/pptout/window.cc,
* src/pptout/window.h,
* src/pptout/windowmenus.cc: changed the signature of create_menus() to receive
a recent manager
---
src/pptout/filter.cc | 14 +++++++++++---
src/pptout/filter.h | 5 +++--
src/pptout/window.cc | 2 +-
src/pptout/window.h | 2 +-
src/pptout/windowmenus.cc | 8 ++++----
5 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/src/pptout/filter.cc b/src/pptout/filter.cc
index d25c0b5..02d411b 100644
--- a/src/pptout/filter.cc
+++ b/src/pptout/filter.cc
@@ -42,6 +42,7 @@ Filter::Filter (void)
{
priv = new Private ();
set_name (_("Passepartout Document files (.pp)"));
+ add_mime_type ("application/x-passepartout");
add_pattern ("*.pp");
}
@@ -51,10 +52,10 @@ Filter::~Filter (void)
}
void
-Filter::set_name (const Glib::ustring& s)
+Filter::add_mime_type (const Glib::ustring& s)
{
- Gtk::FileFilter::set_name (s);
- priv->recent.set_name (s);
+ Gtk::FileFilter::add_mime_type (s);
+ priv->recent.add_mime_type (s);
}
void
@@ -70,4 +71,11 @@ Filter::recent ()
return priv->recent;
}
+void
+Filter::set_name (const Glib::ustring& s)
+{
+ Gtk::FileFilter::set_name (s);
+ priv->recent.set_name (s);
+}
+
}
diff --git a/src/pptout/filter.h b/src/pptout/filter.h
index 7ee7792..2f4a4fa 100644
--- a/src/pptout/filter.h
+++ b/src/pptout/filter.h
@@ -43,8 +43,9 @@ namespace Passepartout
Gtk::RecentFilter& recent ();
- void add_pattern (const Glib::ustring& str);
- void set_name (const Glib::ustring& str);
+ void add_mime_type (const Glib::ustring& str);
+ void add_pattern (const Glib::ustring& str);
+ void set_name (const Glib::ustring& str);
};
}
diff --git a/src/pptout/window.cc b/src/pptout/window.cc
index ba15c7f..3247df6 100644
--- a/src/pptout/window.cc
+++ b/src/pptout/window.cc
@@ -136,7 +136,7 @@ FrameWindow::constructor_common (void)
uimanager->insert_action_group(doc_group = Gtk::ActionGroup::create());
uimanager->insert_action_group(page_group = Gtk::ActionGroup::create());
uimanager->insert_action_group(selection_group = Gtk::ActionGroup::create());
- create_menus(); // defined in windowmenus.cc
+ create_menus (p->pptout.recent ());
add_accel_group(uimanager->get_accel_group());
set_default_size(500, 700);
diff --git a/src/pptout/window.h b/src/pptout/window.h
index 8e847e0..0275326 100644
--- a/src/pptout/window.h
+++ b/src/pptout/window.h
@@ -68,7 +68,7 @@ private:
void open_file (void);
- void create_menus();
+ void create_menus (Gtk::RecentFilter& filter);
void open_dialog_done();
void save_dialog_done();
void show_preferences ();
diff --git a/src/pptout/windowmenus.cc b/src/pptout/windowmenus.cc
index 2171e47..6ba1f1f 100644
--- a/src/pptout/windowmenus.cc
+++ b/src/pptout/windowmenus.cc
@@ -134,7 +134,9 @@ namespace {
}
}
-void FrameWindow::create_menus() {
+void
+FrameWindow::create_menus (Gtk::RecentFilter& f)
+{
using namespace Gtk;
using namespace sigc;
@@ -161,9 +163,7 @@ void FrameWindow::create_menus() {
action->set_show_numbers (true);
action->set_local_only ();
action->set_sort_type (RECENT_SORT_MRU); /* most recently used on top */
- RecentFilter* filter = Gtk::manage(new RecentFilter);
- filter->add_mime_type ("application/x-passepartout");
- action->add_filter (*filter);
+ action->add_filter (f);
main_group->add (action);
action->signal_item_activated ().connect (bind (mem_fun (*this, &FrameWindow::on_recent_file),
action));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]