[gnote] Add close_window() to MainWindow
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Add close_window() to MainWindow
- Date: Thu, 20 Jun 2013 13:28:14 +0000 (UTC)
commit cf0dffe3c2fc1ff4c0928728aa66bd4b3597210e
Author: Aurimas Černius <aurisc4 gmail com>
Date: Thu Jun 20 16:15:13 2013 +0300
Add close_window() to MainWindow
src/mainwindow.hpp | 1 +
src/recentchanges.cpp | 14 +++++++-------
src/recentchanges.hpp | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp
index 9b7fea6..a273146 100644
--- a/src/mainwindow.hpp
+++ b/src/mainwindow.hpp
@@ -42,6 +42,7 @@ public:
virtual void show_search_bar() = 0;
virtual void present_search() = 0;
virtual void new_note() = 0;
+ virtual void close_window() = 0;
};
}
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index a240964..49763a3 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -86,8 +86,8 @@ namespace gnote {
signal_key_press_event()
.connect(sigc::mem_fun(*this, &NoteRecentChanges::on_key_pressed));
IGnote::obj().signal_quit
- .connect(sigc::mem_fun(*this, &NoteRecentChanges::on_close_window));// to save size/pos
- m_keybinder.add_accelerator(sigc::mem_fun(*this, &NoteRecentChanges::on_close_window),
+ .connect(sigc::mem_fun(*this, &NoteRecentChanges::close_window));// to save size/pos
+ m_keybinder.add_accelerator(sigc::mem_fun(*this, &NoteRecentChanges::close_window),
GDK_KEY_W, Gdk::CONTROL_MASK, (Gtk::AccelFlags)0);
m_window_menu_default = make_window_menu(m_window_actions_button, std::vector<Gtk::MenuItem*>());
@@ -336,7 +336,7 @@ namespace gnote {
- void NoteRecentChanges::on_close_window()
+ void NoteRecentChanges::close_window()
{
Glib::RefPtr<Gdk::Window> win = get_window();
// background window (for tray to work) might not have GDK window
@@ -360,7 +360,7 @@ namespace gnote {
bool NoteRecentChanges::on_delete(GdkEventAny *)
{
- on_close_window();
+ close_window();
return true;
}
@@ -374,7 +374,7 @@ namespace gnote {
}
// Allow Escape to close the window
else if(&m_search_notes_widget == dynamic_cast<SearchNotesWidget*>(currently_embedded())) {
- on_close_window();
+ close_window();
}
else {
EmbeddableWidget *current_item = currently_embedded();
@@ -458,7 +458,7 @@ namespace gnote {
foreground_embedded(**m_embedded_widgets.rbegin());
}
else if(get_visible()) {
- on_close_window();
+ close_window();
}
}
}
@@ -680,7 +680,7 @@ namespace gnote {
}
Gtk::MenuItem *item = manage(new Gtk::MenuItem(_("_Close"), true));
item->add_accelerator("activate", get_accel_group(), GDK_KEY_W, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE);
- item->signal_activate().connect(sigc::mem_fun(*this, &NoteRecentChanges::on_close_window));
+ item->signal_activate().connect(sigc::mem_fun(*this, &NoteRecentChanges::close_window));
menu->append(*item);
menu->property_attach_widget() = button;
menu->show_all();
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 2b75a2f..cbd54c2 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -48,6 +48,7 @@ public:
virtual void present_note(const Note::Ptr & note);
virtual void new_note();
virtual void present_search();
+ virtual void close_window();
virtual void embed_widget(EmbeddableWidget &);
virtual void unembed_widget(EmbeddableWidget &);
@@ -64,7 +65,6 @@ private:
void on_open_note(const Note::Ptr &);
void on_open_note_new_window(const Note::Ptr &);
void on_delete_note();
- void on_close_window();
bool on_delete(GdkEventAny *);
bool on_key_pressed(GdkEventKey *);
bool is_foreground(EmbeddableWidget &);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]