[passepartout] moved the filters into the private field



commit bb30db811598fb57d98e77566c940fe341cae5c5
Author: Sven Herzberg <herzi lanedo com>
Date:   Fri May 1 18:49:50 2009 +0200

    moved the filters into the private field
    
    * src/pptout/window.cc: moved the filters so they are accessible later
---
 src/pptout/window.cc |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/pptout/window.cc b/src/pptout/window.cc
index c71f49f..58c966e 100644
--- a/src/pptout/window.cc
+++ b/src/pptout/window.cc
@@ -33,8 +33,23 @@ namespace{
 
 class FrameWindow::Private
 {
+public:
+  Private ();
+
+  Gtk::FileFilter pptout;
+  Gtk::FileFilter all;
 };
 
+FrameWindow::Private::Private()
+{
+  pptout.set_name(_("Passepartout Document files (.pp)"));
+  pptout.add_pattern("*.pp");
+
+  all.set_name(_("All files"));
+  all.add_pattern("*");
+}
+
+// FIXME: we should be able to get around without this
 FrameWindow *FrameWindow::active_window(0);
 
 FrameWindow::FrameWindow(const FrameWindow &original)
@@ -96,18 +111,10 @@ FrameWindow::constructor_common (void)
                                 Gtk::FILE_CHOOSER_ACTION_SAVE));
 
   // file filters
-  {
-    Gtk::FileFilter pfilter;
-    pfilter.set_name(_("Passepartout Document files (.pp)"));
-    pfilter.add_pattern("*.pp");
-    Gtk::FileFilter afilter;
-    afilter.set_name(_("All files"));
-    afilter.add_pattern("*");
-    open_dialog->add_filter(pfilter);
-    save_dialog->add_filter(pfilter);
-    open_dialog->add_filter(afilter);
-    save_dialog->add_filter(afilter);
-  }
+  open_dialog->add_filter(p->pptout);
+  save_dialog->add_filter(p->pptout);
+  open_dialog->add_filter(p->all);
+  save_dialog->add_filter(p->all);
 
   print_dialog.reset(new PrintDialog(*this, document_view));
   text_frame_dialog.reset(new TextFrameDialog(*this, document_view));



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