[gnote] Make possible to know, whether main window is in search mode



commit 4e202fc3f8311d98de2002d648381aadca39a562
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Wed Aug 17 22:46:32 2016 +0300

    Make possible to know, whether main window is in search mode

 src/mainwindow.hpp    |    1 +
 src/recentchanges.cpp |    6 ++++++
 src/recentchanges.hpp |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp
index 23ef758..95a4fe8 100644
--- a/src/mainwindow.hpp
+++ b/src/mainwindow.hpp
@@ -47,6 +47,7 @@ public:
   virtual void present_search() = 0;
   virtual void new_note() = 0;
   virtual void close_window() = 0;
+  virtual bool is_search() = 0;
 
   void close_on_escape(bool close_win)
     {
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 5cd56ae..5120f97 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -387,6 +387,12 @@ namespace gnote {
   }
 
 
+  bool NoteRecentChanges::is_search()
+  {
+    return &m_search_notes_widget == currently_embedded();
+  }
+
+
   void NoteRecentChanges::on_close_window(const Glib::VariantBase&)
   {
     close_window();
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 4de439b..18db48f 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -51,6 +51,7 @@ public:
   virtual void new_note() override;
   virtual void present_search() override;
   virtual void close_window() override;
+  virtual bool is_search() override;
 
   virtual void embed_widget(EmbeddableWidget &) override;
   virtual void unembed_widget(EmbeddableWidget &) override;


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