[gnote] Fix Search All Notes tray menu item



commit 4a06dbc60fb73f26bc609690221683782c0ebb20
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sat Dec 1 16:19:07 2012 +0200

    Fix Search All Notes tray menu item
    
    Display search, rather than only a main window with last opened note.

 src/gnote.cpp         |    4 +++-
 src/recentchanges.cpp |    4 ++--
 src/recentchanges.hpp |    2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/gnote.cpp b/src/gnote.cpp
index cee2478..406639d 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -429,7 +429,9 @@ namespace gnote {
 
   void Gnote::open_search_all()
   {
-    get_main_window()->present();
+    NoteRecentChanges *main_window = get_main_window();
+    main_window->present_search();
+    main_window->present();
   }
 
   void Gnote::open_note_sync_window(const Glib::VariantBase&)
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 5eab0ac..1954545 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -91,7 +91,7 @@ namespace gnote {
     m_all_notes_button = manage(new Gtk::ToolButton(
       *manage(new Gtk::Image(Gtk::Stock::FIND, Gtk::IconSize(24))), _("All Notes")));
     m_all_notes_button->set_is_important();
-    m_all_notes_button->signal_clicked().connect(sigc::mem_fun(*this, &NoteRecentChanges::on_all_notes_clicked));
+    m_all_notes_button->signal_clicked().connect(sigc::mem_fun(*this, &NoteRecentChanges::present_search));
     m_all_notes_button->show_all();
     toolbar->append(*m_all_notes_button);
 
@@ -107,7 +107,7 @@ namespace gnote {
     return toolbar;
   }
 
-  void NoteRecentChanges::on_all_notes_clicked()
+  void NoteRecentChanges::present_search()
   {
     utils::EmbeddableWidget *current = currently_embedded();
     if(&m_search_notes_widget == dynamic_cast<SearchNotesWidget*>(current)) {
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index ed748d3..c67f42a 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -50,6 +50,7 @@ public:
   void set_search_text(const std::string & value);
   void present_note(const Note::Ptr & note);
   void new_note();
+  void present_search();
 
   virtual void embed_widget(utils::EmbeddableWidget &);
   virtual void unembed_widget(utils::EmbeddableWidget &);
@@ -72,7 +73,6 @@ private:
   bool is_foreground(utils::EmbeddableWidget &);
   utils::EmbeddableWidget *currently_embedded();
   Gtk::Toolbar *make_toolbar();
-  void on_all_notes_clicked();
   void on_embedded_name_changed(const std::string & name);
 
   NoteManager        &m_note_manager;



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