[gnote/tabbed: 12/19] Remove close_on_escape from main window




commit 985b2f20aaee68beba24edf6531064aca8b68db0
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Oct 24 17:34:40 2021 +0300

    Remove close_on_escape from main window

 src/mainwindow.cpp                           |  5 ++---
 src/mainwindow.hpp                           | 11 +----------
 src/plugins/backlinks/backlinksnoteaddin.cpp |  5 ++---
 src/recentchanges.cpp                        | 13 +------------
 4 files changed, 6 insertions(+), 28 deletions(-)
---
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 31a6a7ec..675c28a9 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2013,2015-2017,2019-2020 Aurimas Cernius
+ * Copyright (C) 2013,2015-2017,2019-2021 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ void MainWindow::present_in(MainWindow & win, const Note::Ptr & note)
   win.present();
 }
 
-MainWindow *MainWindow::present_in_new_window(IGnote & g, const Note::Ptr & note, bool close_on_esc)
+MainWindow *MainWindow::present_in_new_window(IGnote & g, const Note::Ptr & note)
 {
   if(!note) {
     return NULL;
@@ -59,7 +59,6 @@ MainWindow *MainWindow::present_in_new_window(IGnote & g, const Note::Ptr & note
   MainWindow & window = g.new_main_window();
   window.present_note(note);
   window.present();
-  window.close_on_escape(close_on_esc);
   return &window;
 
   return NULL;
diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp
index f328b147..39616495 100644
--- a/src/mainwindow.hpp
+++ b/src/mainwindow.hpp
@@ -37,7 +37,7 @@ class MainWindow
 public:
   static MainWindow *get_owning(Gtk::Widget & widget);
   static void present_in(MainWindow & win, const Note::Ptr & note);
-  static MainWindow *present_in_new_window(IGnote & g, const Note::Ptr & note, bool close_on_esacpe);
+  static MainWindow *present_in_new_window(IGnote & g, const Note::Ptr & note);
   static MainWindow *present_default(IGnote & g, const Note::Ptr & note);
   static bool use_client_side_decorations(Preferences & prefs);
 
@@ -50,15 +50,6 @@ public:
   virtual void close_window() = 0;
   virtual bool is_search() = 0;
   virtual utils::GlobalKeybinder & keybinder() = 0;
-
-  void close_on_escape(bool close_win)
-    {
-      m_close_on_esc = close_win;
-    }
-  bool close_on_escape() const
-    {
-      return m_close_on_esc;
-    }
 protected:
   virtual void present_note(const Note::Ptr & note) = 0;
 private:
diff --git a/src/plugins/backlinks/backlinksnoteaddin.cpp b/src/plugins/backlinks/backlinksnoteaddin.cpp
index 51e8da77..4d4e1f0f 100644
--- a/src/plugins/backlinks/backlinksnoteaddin.cpp
+++ b/src/plugins/backlinks/backlinksnoteaddin.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2010-2011,2013-2014,2016-2017,2019-2020 Aurimas Cernius
+ * Copyright (C) 2010-2011,2013-2014,2016-2017,2019-2021 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -65,8 +65,7 @@ void BacklinksNoteAddin::on_open_note(const Glib::VariantBase & param)
   Glib::ustring uri = Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring>>(param).get();
   gnote::NoteBase::Ptr note = get_note()->manager().find_by_uri(uri);
   if(note) {
-    gnote::MainWindow::present_in_new_window(ignote(), std::static_pointer_cast<gnote::Note>(note),
-      ignote().preferences().enable_close_note_on_escape());
+    gnote::MainWindow::present_in_new_window(ignote(), std::static_pointer_cast<gnote::Note>(note));
   }
 }
 
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index f3f9aa9d..0061eda8 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -470,7 +470,7 @@ namespace gnote {
 
   void NoteRecentChanges::on_open_note_new_window(const Note::Ptr & note)
   {
-    present_in_new_window(m_gnote, note, m_preferences.enable_close_note_on_escape());
+    present_in_new_window(m_gnote, note);
   }
 
   void NoteRecentChanges::on_delete_note()
@@ -561,17 +561,6 @@ namespace gnote {
         m_search_entry->set_text("");
         m_search_button.set_active(false);
       }
-      // Allow Escape to close the window
-      else if(close_on_escape()) {
-        close_window();
-      }
-      else if(m_preferences.enable_close_note_on_escape()) {
-        EmbeddableWidget *current_item = currently_foreground();
-        if(current_item) {
-          background_embedded(*current_item);
-        }
-        foreground_embedded(*m_search_notes_widget);
-      }
       break;
     case GDK_KEY_F1:
       utils::show_help("gnote", "", *this);


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