[gnote/stable-0.7] Make column record a member of NoteRenameDialog



commit 41068782cc39074348d835c60efacbf12504def9
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date:   Sun May 8 22:44:23 2011 +0300

    Make column record a member of NoteRenameDialog
    
    Required to build on OpenBSD and FreeBSD.
    Thanks Jasper Lievisse Adriaanse.
    Fixes bug 649481.

 src/noterenamedialog.cpp |   33 +--------------------------------
 src/noterenamedialog.hpp |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/src/noterenamedialog.cpp b/src/noterenamedialog.cpp
index 6d6abfb..7348dd6 100644
--- a/src/noterenamedialog.cpp
+++ b/src/noterenamedialog.cpp
@@ -33,37 +33,6 @@
 
 namespace gnote {
 
-class ModelColumnRecord
-  : public Gtk::TreeModelColumnRecord
-{
-public:
-
-  ModelColumnRecord();
-  virtual ~ModelColumnRecord();
-
-  const Gtk::TreeModelColumn<bool> & get_column_selected() const;
-  gint get_column_selected_num() const;
-
-  const Gtk::TreeModelColumn<std::string> & get_column_title() const;
-  gint get_column_title_num() const;
-
-  const Gtk::TreeModelColumn<Note::Ptr> & get_column_note() const;
-  gint get_column_note_num() const;
-
-private:
-
-  enum {
-    COLUMN_BOOL = 0,
-    COLUMN_TITLE,
-    COLUMN_NOTE,
-    COLUMN_COUNT
-  };
-
-  Gtk::TreeModelColumn<bool> m_column_selected;
-  Gtk::TreeModelColumn<std::string> m_column_title;
-  Gtk::TreeModelColumn<Note::Ptr> m_column_note;
-};
-
 ModelColumnRecord::ModelColumnRecord()
   : Gtk::TreeModelColumnRecord()
   , m_column_selected()
@@ -152,7 +121,7 @@ NoteRenameDialog::NoteRenameDialog(const Note::List & notes,
   : Gtk::Dialog(_("Rename Note Links?"),
                 *renamed_note->get_window(),
                 false)
-  , m_notes_model(Gtk::ListStore::create(ModelColumnRecord()))
+  , m_notes_model(Gtk::ListStore::create(m_model_column_record))
   , m_dont_rename_button(_("_Don't Rename Links"), true)
   , m_rename_button(_("_Rename Links"), true)
   , m_select_all_button(_("Select All"))
diff --git a/src/noterenamedialog.hpp b/src/noterenamedialog.hpp
index 1f2b19e..ccd4316 100644
--- a/src/noterenamedialog.hpp
+++ b/src/noterenamedialog.hpp
@@ -1,6 +1,7 @@
 /*
  * gnote
  *
+ * Copyright (C) 2011 Aurimas Cernius
  * Copyright (C) 2010 Debarshi Ray
  *
  * This program is free software: you can redistribute it and/or modify
@@ -38,6 +39,37 @@ enum NoteRenameBehavior {
   NOTE_RENAME_ALWAYS_RENAME_LINKS = 2
 };
 
+class ModelColumnRecord
+  : public Gtk::TreeModelColumnRecord
+{
+public:
+
+  ModelColumnRecord();
+  virtual ~ModelColumnRecord();
+
+  const Gtk::TreeModelColumn<bool> & get_column_selected() const;
+  gint get_column_selected_num() const;
+
+  const Gtk::TreeModelColumn<std::string> & get_column_title() const;
+  gint get_column_title_num() const;
+
+  const Gtk::TreeModelColumn<Note::Ptr> & get_column_note() const;
+  gint get_column_note_num() const;
+
+private:
+
+  enum {
+    COLUMN_BOOL = 0,
+    COLUMN_TITLE,
+    COLUMN_NOTE,
+    COLUMN_COUNT
+  };
+
+  Gtk::TreeModelColumn<bool> m_column_selected;
+  Gtk::TreeModelColumn<std::string> m_column_title;
+  Gtk::TreeModelColumn<Note::Ptr> m_column_note;
+};
+
 class NoteRenameDialog
   : public Gtk::Dialog
 {
@@ -68,6 +100,7 @@ private:
   void on_select_all_button_clicked(bool select);
   void on_toggle_cell_toggled(const std::string & p);
 
+  ModelColumnRecord m_model_column_record;
   Glib::RefPtr<Gtk::ListStore> m_notes_model;
   Gtk::Button m_dont_rename_button;
   Gtk::Button m_rename_button;



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