[gnote] Embed note window to main window
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Embed note window to main window
- Date: Sat, 6 Oct 2012 13:20:46 +0000 (UTC)
commit 995c6b0463693323af1a801b99ab710d6194e357
Author: Aurimas Äernius <aurisc4 gmail com>
Date: Sat Oct 6 14:51:47 2012 +0300
Embed note window to main window
* Derive NoteWindow from Gtk::VBox and EmbedableWidget
* Embed note window to main window
* Adapt the rest to changes
src/addins/exporttohtml/exporttohtmlnoteaddin.cpp | 4 +-
src/addins/fixedwidth/fixedwidthmenuitem.cpp | 30 ++-
src/addins/fixedwidth/fixedwidthmenuitem.hpp | 3 +
src/addins/printnotes/printnotesnoteaddin.cpp | 27 ++-
src/addins/printnotes/printnotesnoteaddin.hpp | 5 +-
src/addins/replacetitle/replacetitlenoteaddin.cpp | 37 ++-
src/addins/replacetitle/replacetitlenoteaddin.hpp | 7 +-
src/addins/underline/underlinemenuitem.cpp | 30 ++-
src/addins/underline/underlinemenuitem.hpp | 3 +
src/note.cpp | 40 ++-
src/note.hpp | 2 +
src/noteaddin.cpp | 12 +
src/noteaddin.hpp | 2 +
src/notebooks/notebooknoteaddin.cpp | 6 +-
src/noterenamedialog.cpp | 2 +-
src/notewindow.cpp | 304 ++++++++++-----------
src/notewindow.hpp | 26 +-
src/recentchanges.cpp | 21 ++-
src/recentchanges.hpp | 9 +-
src/watchers.cpp | 8 +-
20 files changed, 350 insertions(+), 228 deletions(-)
---
diff --git a/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp b/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp
index 7801006..d96f8b5 100644
--- a/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp
+++ b/src/addins/exporttohtml/exporttohtmlnoteaddin.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010-2011 Aurimas Cernius
+ * Copyright (C) 2010-2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -148,7 +148,7 @@ void ExportToHtmlNoteAddin::export_button_clicked()
// Let the user know the note was saved successfully
// even though showing the note in a web browser failed.
gnote::utils::HIGMessageDialog msg_dialog(
- get_window(),
+ get_host_window(),
GTK_DIALOG_DESTROY_WITH_PARENT,
Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK,
_("Note exported successfully"),
diff --git a/src/addins/fixedwidth/fixedwidthmenuitem.cpp b/src/addins/fixedwidth/fixedwidthmenuitem.cpp
index 503beb3..e702d2c 100644
--- a/src/addins/fixedwidth/fixedwidthmenuitem.cpp
+++ b/src/addins/fixedwidth/fixedwidthmenuitem.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010-2011 Aurimas Cernius
+ * Copyright (C) 2010-2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -40,11 +40,11 @@ namespace fixedwidth {
m_note_addin->get_window()->text_menu()->signal_show().connect(
sigc::mem_fun(*this, &FixedWidthMenuItem::menu_shown));
- add_accelerator ("activate",
- addin->get_window()->get_accel_group(),
- GDK_KEY_T,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
+ gnote::NoteWindow *note_window = addin->get_window();
+ note_window->signal_foregrounded.connect(
+ sigc::mem_fun(*this, &FixedWidthMenuItem::on_note_foregrounded));
+ note_window->signal_backgrounded.connect(
+ sigc::mem_fun(*this, &FixedWidthMenuItem::on_note_backgrounded));
show_all();
}
@@ -66,4 +66,22 @@ namespace fixedwidth {
}
+ void FixedWidthMenuItem::on_note_foregrounded()
+ {
+ add_accelerator("activate",
+ m_note_addin->get_window()->get_accel_group(),
+ GDK_KEY_T,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ }
+
+
+ void FixedWidthMenuItem::on_note_backgrounded()
+ {
+ remove_accelerator(m_note_addin->get_window()->get_accel_group(),
+ GDK_KEY_T,
+ Gdk::CONTROL_MASK);
+ }
+
+
}
diff --git a/src/addins/fixedwidth/fixedwidthmenuitem.hpp b/src/addins/fixedwidth/fixedwidthmenuitem.hpp
index 620f69a..4256889 100644
--- a/src/addins/fixedwidth/fixedwidthmenuitem.hpp
+++ b/src/addins/fixedwidth/fixedwidthmenuitem.hpp
@@ -1,6 +1,7 @@
/*
* gnote
*
+ * Copyright (C) 2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -43,6 +44,8 @@ protected:
private:
void menu_shown();
+ void on_note_foregrounded();
+ void on_note_backgrounded();
gnote::NoteAddin * m_note_addin;
bool m_event_freeze;
diff --git a/src/addins/printnotes/printnotesnoteaddin.cpp b/src/addins/printnotes/printnotesnoteaddin.cpp
index d72b1cc..43a7789 100644
--- a/src/addins/printnotes/printnotesnoteaddin.cpp
+++ b/src/addins/printnotes/printnotesnoteaddin.cpp
@@ -83,14 +83,31 @@ namespace printnotes {
Gtk::ICON_SIZE_MENU)));
m_item->signal_activate().connect(
sigc::mem_fun(*this, &PrintNotesNoteAddin::print_button_clicked));
- m_item->add_accelerator ("activate", get_window()->get_accel_group(),
- GDK_KEY_P, Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
+ gnote::NoteWindow *note_window = get_window();
+ note_window->signal_foregrounded.connect(
+ sigc::mem_fun(*this, &PrintNotesNoteAddin::on_note_foregrounded));
+ note_window->signal_backgrounded.connect(
+ sigc::mem_fun(*this, &PrintNotesNoteAddin::on_note_backgrounded));
m_item->show ();
add_plugin_menu_item (m_item);
}
+ void PrintNotesNoteAddin::on_note_foregrounded()
+ {
+ m_item->add_accelerator("activate", get_window()->get_accel_group(),
+ GDK_KEY_P, Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ }
+
+
+ void PrintNotesNoteAddin::on_note_backgrounded()
+ {
+ m_item->remove_accelerator(get_window()->get_accel_group(),
+ GDK_KEY_P, Gdk::CONTROL_MASK);
+ }
+
+
void PrintNotesNoteAddin::print_button_clicked()
{
try {
@@ -123,13 +140,13 @@ namespace printnotes {
m_print_op->signal_end_print().connect(
sigc::mem_fun(*this, &PrintNotesNoteAddin::on_end_print));
- m_print_op->run(Gtk::PRINT_OPERATION_ACTION_PRINT_DIALOG, *get_window());
+ m_print_op->run(Gtk::PRINT_OPERATION_ACTION_PRINT_DIALOG, *get_host_window());
}
catch (const sharp::Exception & e)
{
DBG_OUT("Exception while printing %s: %s", get_note()->get_title().c_str(),
e.what());
- gnote::utils::HIGMessageDialog dlg(get_note()->get_window(),
+ gnote::utils::HIGMessageDialog dlg(get_host_window(),
GTK_DIALOG_MODAL,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK,
diff --git a/src/addins/printnotes/printnotesnoteaddin.hpp b/src/addins/printnotes/printnotesnoteaddin.hpp
index 49e63b6..11f5f2f 100644
--- a/src/addins/printnotes/printnotesnoteaddin.hpp
+++ b/src/addins/printnotes/printnotesnoteaddin.hpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010 Aurimas Cernius
+ * Copyright (C) 2010,2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -121,6 +121,9 @@ private:
void on_end_print(const Glib::RefPtr<Gtk::PrintContext>&);
/////
void print_button_clicked();
+ void on_note_foregrounded();
+ void on_note_backgrounded();
+
Gtk::ImageMenuItem * m_item;
int m_margin_top;
int m_margin_left;
diff --git a/src/addins/replacetitle/replacetitlenoteaddin.cpp b/src/addins/replacetitle/replacetitlenoteaddin.cpp
index de2ff6a..e941eed 100644
--- a/src/addins/replacetitle/replacetitlenoteaddin.cpp
+++ b/src/addins/replacetitle/replacetitlenoteaddin.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2011 Aurimas Cernius
+ * Copyright (C) 2011-2012 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
@@ -74,19 +74,34 @@ void ReplaceTitleNoteAddin::shutdown()
void ReplaceTitleNoteAddin::on_note_opened()
{
- Gtk::ImageMenuItem *item = manage(new Gtk::ImageMenuItem(_("Replace title")));
- item->set_image(*manage(new Gtk::Image(Gtk::Stock::FIND_AND_REPLACE, Gtk::ICON_SIZE_MENU)));
- item->signal_activate().connect(
+ m_menu_item = manage(new Gtk::ImageMenuItem(_("Replace title")));
+ m_menu_item->set_image(*manage(new Gtk::Image(Gtk::Stock::FIND_AND_REPLACE, Gtk::ICON_SIZE_MENU)));
+ m_menu_item->signal_activate().connect(
sigc::mem_fun(*this, &ReplaceTitleNoteAddin::replacetitle_button_clicked));
- item->add_accelerator("activate",
- get_window()->get_accel_group(),
- GDK_KEY_R,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
+ gnote::NoteWindow *note_window = get_window();
+ note_window->signal_foregrounded.connect(
+ sigc::mem_fun(*this, &ReplaceTitleNoteAddin::on_note_foregrounded));
+ note_window->signal_backgrounded.connect(
+ sigc::mem_fun(*this, &ReplaceTitleNoteAddin::on_note_backgrounded));
- item->show() ;
- add_plugin_menu_item(item);
+ m_menu_item->show() ;
+ add_plugin_menu_item(m_menu_item);
+}
+
+void ReplaceTitleNoteAddin::on_note_foregrounded()
+{
+ m_menu_item->add_accelerator("activate",
+ get_window()->get_accel_group(),
+ GDK_KEY_R,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+}
+
+void ReplaceTitleNoteAddin::on_note_backgrounded()
+{
+ m_menu_item->remove_accelerator(get_window()->get_accel_group(),
+ GDK_KEY_R, Gdk::CONTROL_MASK);
}
void ReplaceTitleNoteAddin::replacetitle_button_clicked()
diff --git a/src/addins/replacetitle/replacetitlenoteaddin.hpp b/src/addins/replacetitle/replacetitlenoteaddin.hpp
index 685c851..8bfb5d8 100644
--- a/src/addins/replacetitle/replacetitlenoteaddin.hpp
+++ b/src/addins/replacetitle/replacetitlenoteaddin.hpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2011 Aurimas Cernius
+ * Copyright (C) 2011-2012 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
@@ -57,7 +57,10 @@ public:
virtual void on_note_opened();
private:
void replacetitle_button_clicked();
- Gtk::ImageMenuItem * m_item ;
+ void on_note_foregrounded();
+ void on_note_backgrounded();
+
+ Gtk::ImageMenuItem *m_menu_item;
};
diff --git a/src/addins/underline/underlinemenuitem.cpp b/src/addins/underline/underlinemenuitem.cpp
index 7d18670..b98e7de 100644
--- a/src/addins/underline/underlinemenuitem.cpp
+++ b/src/addins/underline/underlinemenuitem.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010-2011 Aurimas Cernius
+ * Copyright (C) 2010-2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -40,11 +40,11 @@ namespace underline {
m_note_addin->get_window()->text_menu()->signal_show().connect(
sigc::mem_fun(*this, &UnderlineMenuItem::menu_shown));
- add_accelerator ("activate",
- addin->get_window()->get_accel_group(),
- GDK_KEY_U,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
+ gnote::NoteWindow *note_window = addin->get_window();
+ note_window->signal_foregrounded.connect(
+ sigc::mem_fun(*this, &UnderlineMenuItem::on_note_foregrounded));
+ note_window->signal_backgrounded.connect(
+ sigc::mem_fun(*this, &UnderlineMenuItem::on_note_backgrounded));
show_all();
}
@@ -66,4 +66,22 @@ namespace underline {
}
+ void UnderlineMenuItem::on_note_foregrounded()
+ {
+ add_accelerator("activate",
+ m_note_addin->get_window()->get_accel_group(),
+ GDK_KEY_U,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ }
+
+
+ void UnderlineMenuItem::on_note_backgrounded()
+ {
+ remove_accelerator(m_note_addin->get_window()->get_accel_group(),
+ GDK_KEY_U,
+ Gdk::CONTROL_MASK);
+ }
+
+
}
diff --git a/src/addins/underline/underlinemenuitem.hpp b/src/addins/underline/underlinemenuitem.hpp
index df8097f..7eed011 100644
--- a/src/addins/underline/underlinemenuitem.hpp
+++ b/src/addins/underline/underlinemenuitem.hpp
@@ -1,6 +1,7 @@
/*
* gnote
*
+ * Copyright (C) 2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -43,6 +44,8 @@ protected:
private:
void menu_shown();
+ void on_note_foregrounded();
+ void on_note_backgrounded();
gnote::NoteAddin * m_note_addin;
bool m_event_freeze;
diff --git a/src/note.cpp b/src/note.cpp
index b5c981b..1630343 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -278,6 +278,7 @@ namespace gnote {
, m_save_needed(false)
, m_is_deleting(false)
, m_enabled(true)
+ , m_note_window_embeded(false)
, m_focus_widget(NULL)
, m_manager(_manager)
, m_window(NULL)
@@ -377,7 +378,9 @@ namespace gnote {
}
if (m_window) {
- m_window->hide ();
+ if(m_window->host()) {
+ m_window->host()->unembed_widget(*m_window);
+ }
delete m_window;
m_window = NULL;
}
@@ -414,7 +417,7 @@ namespace gnote {
catch (const sharp::Exception & e) {
// Probably IOException or UnauthorizedAccessException?
ERR_OUT("Exception while saving note: %s", e.what());
- show_io_error_dialog(m_window);
+ show_io_error_dialog(dynamic_cast<Gtk::Window*>(m_window->host()));
}
m_signal_saved(shared_from_this());
@@ -467,6 +470,7 @@ namespace gnote {
bool Note::on_window_configure(GdkEventConfigure * /*ev*/)
{
+#if 0
int cur_x, cur_y, cur_width, cur_height;
// Ignore events when maximized. We don't want notes
@@ -487,6 +491,7 @@ namespace gnote {
DBG_OUT("WindowConfigureEvent queueing save");
queue_save(NO_CHANGE);
+#endif
return false;
}
@@ -654,7 +659,7 @@ namespace gnote {
{
if (m_data.data().title() != new_title) {
if (m_window) {
- m_window->set_title(new_title);
+ m_window->set_name(new_title);
}
std::string old_title = m_data.data().title();
@@ -802,7 +807,7 @@ namespace gnote {
{
if (m_data.data().title() != newTitle) {
if (m_window) {
- m_window->set_title(newTitle);
+ m_window->set_name(newTitle);
}
m_data.data().title() = newTitle;
@@ -1030,13 +1035,23 @@ namespace gnote {
sigc::mem_fun(*this, &Note::on_window_configure), false);
m_window->editor()->set_sensitive(enabled());
+#if 0
if (m_data.data().has_extent())
m_window->set_default_size(m_data.data().width(),
m_data.data().height());
if (m_data.data().has_position())
m_window->move(m_data.data().x(), m_data.data().y());
+#endif
+
+ m_window->signal_embeded.connect(sigc::mem_fun(*this, &Note::on_note_window_embeded));
+ }
+ return m_window;
+ }
+ void Note::on_note_window_embeded()
+ {
+ if(!m_note_window_embeded) {
// This is here because emiting inside
// OnRealized causes segfaults.
m_signal_opened(*this);
@@ -1044,8 +1059,8 @@ namespace gnote {
// Add any child widgets if any exist now that
// the window is showing.
process_child_widget_queue();
+ m_note_window_embeded = true;
}
- return m_window;
}
bool Note::is_special() const
@@ -1118,12 +1133,15 @@ namespace gnote {
{
m_enabled = is_enabled;
if(m_window) {
- if(!m_enabled) {
- m_focus_widget = m_window->get_focus();
- }
- m_window->set_sensitive(m_enabled);
- if(m_enabled) {
- m_window->set_focus(*m_focus_widget);
+ Gtk::Window *window = dynamic_cast<Gtk::Window*>(m_window->host());
+ if(window) {
+ if(!m_enabled) {
+ m_focus_widget = window->get_focus();
+ }
+ window->set_sensitive(m_enabled);
+ if(m_enabled) {
+ window->set_focus(*m_focus_widget);
+ }
}
}
}
diff --git a/src/note.hpp b/src/note.hpp
index 424e010..00a4a4c 100644
--- a/src/note.hpp
+++ b/src/note.hpp
@@ -385,6 +385,7 @@ private:
const Ptr & renamed);
void remove_links(const std::string & old_title,
const Ptr & renamed);
+ void on_note_window_embeded();
Note(NoteData * data, const std::string & filepath, NoteManager & manager);
@@ -405,6 +406,7 @@ private:
bool m_save_needed;
bool m_is_deleting;
bool m_enabled;
+ bool m_note_window_embeded;
Gtk::Widget *m_focus_widget;
NoteManager &m_manager;
diff --git a/src/noteaddin.cpp b/src/noteaddin.cpp
index 35d46e4..2e1e699 100644
--- a/src/noteaddin.cpp
+++ b/src/noteaddin.cpp
@@ -1,6 +1,7 @@
/*
* gnote
*
+ * Copyright (C) 2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -134,5 +135,16 @@ namespace gnote {
}
}
+ Gtk::Window *NoteAddin::get_host_window() const
+ {
+ if(is_disposing() && !has_buffer()) {
+ throw sharp::Exception("Plugin is disposing already");
+ }
+ NoteWindow *note_window = m_note->get_window();
+ if(!note_window->host()) {
+ throw std::runtime_error("Window is not hosted!");
+ }
+ return dynamic_cast<Gtk::Window*>(note_window->host());
+ }
}
diff --git a/src/noteaddin.hpp b/src/noteaddin.hpp
index 8f94094..1be014b 100644
--- a/src/noteaddin.hpp
+++ b/src/noteaddin.hpp
@@ -1,6 +1,7 @@
/*
* gnote
*
+ * Copyright (C) 2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -98,6 +99,7 @@ public:
}
return m_note->get_window();
}
+ Gtk::Window *get_host_window() const;
NoteManager & manager() const
{
return m_note->manager();
diff --git a/src/notebooks/notebooknoteaddin.cpp b/src/notebooks/notebooknoteaddin.cpp
index 250edbf..0b22307 100644
--- a/src/notebooks/notebooknoteaddin.cpp
+++ b/src/notebooks/notebooknoteaddin.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010-2011 Aurimas Cernius
+ * Copyright (C) 2010-2012 Aurimas Cernius
* Copyright (C) 2009 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
@@ -179,8 +179,8 @@ namespace notebooks {
{
Note::List noteList;
noteList.push_back(get_note());
- NotebookManager::instance().prompt_create_new_notebook(get_note()->get_window(),
- noteList);
+ NotebookManager::instance().prompt_create_new_notebook(
+ dynamic_cast<Gtk::Window*>(get_note()->get_window()->host()), noteList);
}
diff --git a/src/noterenamedialog.cpp b/src/noterenamedialog.cpp
index 4d13c86..d0405cd 100644
--- a/src/noterenamedialog.cpp
+++ b/src/noterenamedialog.cpp
@@ -121,7 +121,7 @@ NoteRenameDialog::NoteRenameDialog(const Note::List & notes,
const std::string & old_title,
const Note::Ptr & renamed_note)
: Gtk::Dialog(_("Rename Note Links?"),
- *renamed_note->get_window(),
+ *dynamic_cast<Gtk::Window*>(renamed_note->get_window()->host()),
false)
, m_notes_model(Gtk::ListStore::create(m_model_column_record))
, m_dont_rename_button(_("_Don't Rename Links"), true)
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index ac45e59..368a0f7 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -52,8 +52,9 @@
namespace gnote {
NoteWindow::NoteWindow(Note & note)
- : ForcedPresentWindow<Gtk::Window>(note.get_title())
+ : Gtk::VBox(false, 2)
, m_note(note)
+ , m_name(note.get_title())
, m_global_keys(NULL)
{
m_template_tag = TagManager::obj().get_or_create_system_tag(TagManager::TEMPLATE_NOTE_SYSTEM_TAG);
@@ -61,16 +62,12 @@ namespace gnote {
m_template_save_selection_tag = TagManager::obj().get_or_create_system_tag(TagManager::TEMPLATE_NOTE_SAVE_SELECTION_SYSTEM_TAG);
m_template_save_title_tag = TagManager::obj().get_or_create_system_tag(TagManager::TEMPLATE_NOTE_SAVE_TITLE_SYSTEM_TAG);
-// get_window()->set_icon_name("gnote");
+#if 0
set_default_size(450, 360);
set_resizable(true);
+#endif
- m_accel_group = Gtk::AccelGroup::create();
- add_accel_group(m_accel_group);
-
- m_text_menu
- = Gtk::manage(new NoteTextMenu(m_accel_group,
- note.get_buffer(), note.get_buffer()->undoer()));
+ m_text_menu = Gtk::manage(new NoteTextMenu(note.get_buffer(), note.get_buffer()->undoer()));
// Add the Find menu item to the toolbar Text menu. It
// should only show up in the toplevel Text menu, since
@@ -80,17 +77,11 @@ namespace gnote {
spacer->show ();
m_text_menu->append(*spacer);
- Gtk::ImageMenuItem *find_item =
- manage(new Gtk::ImageMenuItem (_("Find in This Note")));
- find_item->set_image(*manage(new Gtk::Image (Gtk::Stock::FIND, Gtk::ICON_SIZE_MENU)));
- find_item->signal_activate().connect(sigc::mem_fun(*this, &NoteWindow::find_button_clicked));
- find_item->add_accelerator ("activate",
- m_accel_group,
- GDK_KEY_F,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
- find_item->show ();
- m_text_menu->append(*find_item);
+ m_find_item = manage(new Gtk::ImageMenuItem(_("Find in This Note")));
+ m_find_item->set_image(*manage(new Gtk::Image (Gtk::Stock::FIND, Gtk::ICON_SIZE_MENU)));
+ m_find_item->signal_activate().connect(sigc::mem_fun(*this, &NoteWindow::find_button_clicked));
+ m_find_item->show ();
+ m_text_menu->append(*m_find_item);
m_plugin_menu = manage(make_plugin_menu());
@@ -127,51 +118,12 @@ namespace gnote {
m_find_bar->set_no_show_all(true);
m_find_bar->signal_hide().connect(sigc::mem_fun(*this, &NoteWindow::find_bar_hidden));
- Gtk::VBox *box = manage(new Gtk::VBox (false, 2));
- box->pack_start(*m_toolbar, false, false, 0);
- box->pack_start(*m_template_widget, false, false, 0);
- box->pack_start(*m_editor_window, true, true, 0);
- box->pack_start(*m_find_bar, false, false, 0);
-
- box->show();
-
- // NOTE: Since some of our keybindings are only
- // available in the context menu, and the context menu
- // is created on demand, register them with the
- // global keybinder
- m_global_keys = new utils::GlobalKeybinder (m_accel_group);
-
- // Escape has been moved to be handled by a KeyPress Handler so that
- // Escape can be used to close the FindBar.
-
- // Find Next (Ctrl-G)
- m_global_keys->add_accelerator (sigc::mem_fun(*this, &NoteWindow::find_next_activate),
- GDK_KEY_G,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
-
- // Find Previous (Ctrl-Shift-G)
- m_global_keys->add_accelerator (sigc::mem_fun(*this, &NoteWindow::find_previous_activate),
- GDK_KEY_G, (Gdk::CONTROL_MASK | Gdk::SHIFT_MASK),
- Gtk::ACCEL_VISIBLE);
-
- // Open Help (F1)
- m_global_keys->add_accelerator (sigc::mem_fun(*this, &NoteWindow::open_help_activate),
- GDK_KEY_F1, (Gdk::ModifierType)0, (Gtk::AccelFlags)0);
+ pack_start(*m_toolbar, false, false, 0);
+ pack_start(*m_template_widget, false, false, 0);
+ pack_start(*m_editor_window, true, true, 0);
+ pack_start(*m_find_bar, false, false, 0);
signal_key_press_event().connect(sigc::mem_fun(*this, &NoteWindow::on_key_pressed));
-
-
- // Increase Indent
- m_global_keys->add_accelerator (sigc::mem_fun(*this, &NoteWindow::change_depth_right_handler),
- GDK_KEY_Right, Gdk::MOD1_MASK,
- Gtk::ACCEL_VISIBLE);
-
- // Decrease Indent
- m_global_keys->add_accelerator (sigc::mem_fun(*this, &NoteWindow::change_depth_left_handler),
- GDK_KEY_Left, Gdk::MOD1_MASK,
- Gtk::ACCEL_VISIBLE);
- add(*box);
}
@@ -186,22 +138,90 @@ namespace gnote {
}
- bool NoteWindow::on_delete_event(GdkEventAny * /*ev*/)
+ std::string NoteWindow::get_name() const
{
- close_window_handler();
- return true;
+ return m_name;
}
- void NoteWindow::on_hide()
+ void NoteWindow::foreground()
{
- utils::ForcedPresentWindow<Gtk::Window>::on_hide();
+ //addins may add accelarators, so accel group must be there
+ Gtk::Window *parent = dynamic_cast<Gtk::Window*>(host());
+ if(parent) {
+ add_accel_group(*parent);
+ }
+
+ utils::EmbedableWidget::foreground();
+ m_editor->scroll_to(m_editor->get_buffer()->get_insert());
+ }
- // Workaround Gtk bug, where adding or changing Widgets
- // while the Window is hidden causes it to be reshown at
- // 0,0...
- int x, y;
- get_position(x, y);
- move(x, y);
+ void NoteWindow::background()
+ {
+ utils::EmbedableWidget::background();
+ Gtk::Window *parent = dynamic_cast<Gtk::Window*>(host());
+ if(!parent) {
+ return;
+ }
+ remove_accel_group(*parent);
+ }
+
+ void NoteWindow::add_accel_group(Gtk::Window & window)
+ {
+ if(!m_accel_group) {
+ m_accel_group = Gtk::AccelGroup::create();
+ window.add_accel_group(m_accel_group);
+ m_text_menu->set_accel_group(m_accel_group);
+ m_find_item->add_accelerator("activate", m_accel_group,
+ GDK_KEY_F,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_link_button->add_accelerator("clicked", m_accel_group,
+ GDK_KEY_L, Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+
+ if(!m_global_keys) {
+ // NOTE: Since some of our keybindings are only
+ // available in the context menu, and the context menu
+ // is created on demand, register them with the
+ // global keybinder
+ m_global_keys = new utils::GlobalKeybinder(m_accel_group);
+
+ // Find Next (Ctrl-G)
+ m_global_keys->add_accelerator(sigc::mem_fun(*this, &NoteWindow::find_next_activate),
+ GDK_KEY_G,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+
+ // Find Previous (Ctrl-Shift-G)
+ m_global_keys->add_accelerator(sigc::mem_fun(*this, &NoteWindow::find_previous_activate),
+ GDK_KEY_G, (Gdk::CONTROL_MASK | Gdk::SHIFT_MASK),
+ Gtk::ACCEL_VISIBLE);
+
+ // Open Help (F1)
+ m_global_keys->add_accelerator(sigc::mem_fun(*this, &NoteWindow::open_help_activate),
+ GDK_KEY_F1, (Gdk::ModifierType)0, (Gtk::AccelFlags)0);
+
+ // Increase Indent
+ m_global_keys->add_accelerator(sigc::mem_fun(*this, &NoteWindow::change_depth_right_handler),
+ GDK_KEY_Right, Gdk::MOD1_MASK,
+ Gtk::ACCEL_VISIBLE);
+
+ // Decrease Indent
+ m_global_keys->add_accelerator(sigc::mem_fun(*this, &NoteWindow::change_depth_left_handler),
+ GDK_KEY_Left, Gdk::MOD1_MASK,
+ Gtk::ACCEL_VISIBLE);
+ }
+ }
+ else {
+ window.add_accel_group(m_accel_group);
+ }
+ }
+
+ void NoteWindow::remove_accel_group(Gtk::Window & window)
+ {
+ if(m_accel_group) {
+ window.remove_accel_group(m_accel_group);
+ }
}
@@ -211,29 +231,11 @@ namespace gnote {
if (m_find_bar && m_find_bar->get_visible()) {
m_find_bar->hide();
}
- else if (Preferences::obj().get_schema_settings(Preferences::SCHEMA_GNOTE)->get_boolean(
- Preferences::ENABLE_CLOSE_NOTE_ON_ESCAPE)) {
- close_window_handler();
- }
return true;
}
return false;
}
- // FIXME: Need to just emit a delete event, and do this work in
- // the default delete handler, so that plugins can attach to
- // delete event and have it always work.
- void NoteWindow::close_window_handler()
- {
- // Unmaximize before hiding to avoid reopening
- // pseudo-maximized
- if ((get_window()->get_state() & Gdk::WINDOW_STATE_MAXIMIZED) != 0) {
- unmaximize();
- }
- hide();
- }
-
-
// Delete this Note.
//
@@ -242,7 +244,7 @@ namespace gnote {
// Prompt for note deletion
std::list<Note::Ptr> single_note_list;
single_note_list.push_back(m_note.shared_from_this());
- noteutils::show_deletion_dialog(single_note_list, this);
+ noteutils::show_deletion_dialog(single_note_list, dynamic_cast<Gtk::Window*>(host()));
}
void NoteWindow::on_selection_mark_set(const Gtk::TextIter&, const Glib::RefPtr<Gtk::TextMark>&)
@@ -287,8 +289,7 @@ namespace gnote {
text_item->set_image(*manage(new Gtk::Image(
Gtk::Stock::SELECT_FONT,
Gtk::ICON_SIZE_MENU)));
- text_item->set_submenu(*manage(new NoteTextMenu(m_accel_group,
- m_note.get_buffer(),
+ text_item->set_submenu(*manage(new NoteTextMenu(m_note.get_buffer(),
m_note.get_buffer()->undoer())));
text_item->show();
@@ -325,9 +326,6 @@ namespace gnote {
m_link_button->signal_clicked().connect(
sigc::mem_fun(*this, &NoteWindow::link_button_clicked));
m_link_button->set_tooltip_text(_("Link selected text to a new note (Ctrl-L)"));
- m_link_button->add_accelerator("clicked", m_accel_group,
- GDK_KEY_L, Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
m_link_button->show_all();
tb->insert(*m_link_button, -1);
@@ -591,7 +589,7 @@ namespace gnote {
match = m_note.manager().create(select);
}
catch (const sharp::Exception & e) {
- utils::HIGMessageDialog dialog(this,
+ utils::HIGMessageDialog dialog(dynamic_cast<Gtk::Window*>(host()),
GTK_DIALOG_DESTROY_WITH_PARENT,
Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK,
_("Cannot create note"), e.what());
@@ -606,12 +604,13 @@ namespace gnote {
m_note.get_buffer()->apply_tag(m_note.get_tag_table()->get_link_tag(), start, end);
}
- match->get_window()->present();
+ host()->embed_widget(*match->get_window());
}
void NoteWindow::open_help_activate()
{
- utils::show_help("gnote", "editing-notes", get_screen()->gobj(), this);
+ utils::show_help("gnote", "editing-notes", get_screen()->gobj(),
+ dynamic_cast<Gtk::Window*>(host()));
}
void NoteWindow::change_depth_right_handler()
@@ -624,14 +623,7 @@ namespace gnote {
Glib::RefPtr<NoteBuffer>::cast_static(m_editor->get_buffer())->change_cursor_depth_directional(false);
}
- void NoteWindow::on_show()
- {
- utils::ForcedPresentWindow<Gtk::Window>::on_show();
- // Make sure the cursor position is visible
- m_editor->scroll_to (m_editor->get_buffer()->get_insert());
- }
-
NoteFindBar::NoteFindBar(Note & note)
: Gtk::HBox(false, 0)
, m_note(note)
@@ -1086,8 +1078,7 @@ namespace gnote {
// Menu for font style and size, and set the active radio
// menuitem depending on the cursor poition.
//
- NoteTextMenu::NoteTextMenu(const Glib::RefPtr<Gtk::AccelGroup>& accel_group,
- const Glib::RefPtr<NoteBuffer> & buffer, UndoManager & undo_manager)
+ NoteTextMenu::NoteTextMenu(const Glib::RefPtr<NoteBuffer> & buffer, UndoManager & undo_manager)
: Gtk::Menu()
, m_buffer(buffer)
, m_undo_manager(undo_manager)
@@ -1112,22 +1103,12 @@ namespace gnote {
, m_decrease_font(_("Decrease Font Size"), true)
{
m_undo = manage(new Gtk::ImageMenuItem (Gtk::Stock::UNDO));
-// m_undo->set_accel_group(accel_group);
m_undo->signal_activate().connect(sigc::mem_fun(*this, &NoteTextMenu::undo_clicked));
- m_undo->add_accelerator ("activate", accel_group,
- GDK_KEY_Z,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
m_undo->show();
append(*m_undo);
m_redo = manage(new Gtk::ImageMenuItem (Gtk::Stock::REDO));
-// m_redo->set_accel_group(accel_group);
m_redo->signal_activate().connect(sigc::mem_fun(*this, &NoteTextMenu::redo_clicked));
- m_redo->add_accelerator ("activate", accel_group,
- GDK_KEY_Z, (Gdk::CONTROL_MASK |
- Gdk::SHIFT_MASK),
- Gtk::ACCEL_VISIBLE);
m_redo->show();
append(*m_redo);
@@ -1143,40 +1124,21 @@ namespace gnote {
m_bold.set_data(tag_quark, const_cast<char*>("bold"));
m_bold.signal_activate()
.connect(sigc::bind(sigc::mem_fun(*this, &NoteTextMenu::font_style_clicked), &m_bold));
- m_bold.add_accelerator ("activate", accel_group,
- GDK_KEY_B,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
markup_label (m_italic);
m_italic.set_data(tag_quark, const_cast<char*>("italic"));
m_italic.signal_activate()
.connect(sigc::bind(sigc::mem_fun(*this, &NoteTextMenu::font_style_clicked), &m_italic));
- m_italic.add_accelerator ("activate",
- accel_group,
- GDK_KEY_I,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
markup_label (m_strikeout);
m_strikeout.set_data(tag_quark, const_cast<char*>("strikethrough"));
m_strikeout.signal_activate()
.connect(sigc::bind(sigc::mem_fun(*this, &NoteTextMenu::font_style_clicked), &m_strikeout));
- m_strikeout.add_accelerator ("activate",
- accel_group,
- GDK_KEY_S,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
markup_label (m_highlight);
m_highlight.set_data(tag_quark, const_cast<char*>("highlight"));
m_highlight.signal_activate()
.connect(sigc::bind(sigc::mem_fun(*this, &NoteTextMenu::font_style_clicked), &m_highlight));
- m_highlight.add_accelerator ("activate",
- accel_group,
- GDK_KEY_H,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
Gtk::SeparatorMenuItem *spacer1 = manage(new Gtk::SeparatorMenuItem());
@@ -1205,19 +1167,9 @@ namespace gnote {
m_hidden_no_size.hide();
- m_increase_font.add_accelerator ("activate",
- accel_group,
- GDK_KEY_plus,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
m_increase_font.signal_activate()
.connect(sigc::mem_fun(*this, &NoteTextMenu::increase_font_clicked));
- m_decrease_font.add_accelerator ("activate",
- accel_group,
- GDK_KEY_minus,
- Gdk::CONTROL_MASK,
- Gtk::ACCEL_VISIBLE);
m_decrease_font.signal_activate()
.connect(sigc::mem_fun(*this, &NoteTextMenu::decrease_font_clicked));
@@ -1226,20 +1178,10 @@ namespace gnote {
m_bullets_clicked_cid = m_bullets.signal_activate()
.connect(sigc::mem_fun(*this, &NoteTextMenu::toggle_bullets_clicked));
-// m_increase_indent.set_accel_group(accel_group);
- m_increase_indent.add_accelerator ("activate", accel_group,
- GDK_KEY_Right,
- Gdk::MOD1_MASK,
- Gtk::ACCEL_VISIBLE);
m_increase_indent.signal_activate()
.connect(sigc::mem_fun(*this, &NoteTextMenu::increase_indent_clicked));
m_increase_indent.show();
-// m_decrease_indent.set_accel_group(accel_group);
- m_decrease_indent.add_accelerator ("activate", accel_group,
- GDK_KEY_Left,
- Gdk::MOD1_MASK,
- Gtk::ACCEL_VISIBLE);
m_decrease_indent.signal_activate()
.connect(sigc::mem_fun(*this, &NoteTextMenu::decrease_indent_clicked));
m_decrease_indent.show();
@@ -1265,6 +1207,50 @@ namespace gnote {
show_all ();
}
+ void NoteTextMenu::set_accel_group(const Glib::RefPtr<Gtk::AccelGroup> & accel_group)
+ {
+ m_undo->add_accelerator("activate", accel_group,
+ GDK_KEY_Z,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_redo->add_accelerator("activate", accel_group,
+ GDK_KEY_Z,
+ Gdk::CONTROL_MASK | Gdk::SHIFT_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_bold.add_accelerator("activate", accel_group,
+ GDK_KEY_B,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_italic.add_accelerator("activate", accel_group,
+ GDK_KEY_I,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_strikeout.add_accelerator("activate", accel_group,
+ GDK_KEY_S,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_highlight.add_accelerator("activate", accel_group,
+ GDK_KEY_H,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_increase_font.add_accelerator("activate", accel_group,
+ GDK_KEY_plus,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_decrease_font.add_accelerator("activate", accel_group,
+ GDK_KEY_minus,
+ Gdk::CONTROL_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_increase_indent.add_accelerator("activate", accel_group,
+ GDK_KEY_Right,
+ Gdk::MOD1_MASK,
+ Gtk::ACCEL_VISIBLE);
+ m_decrease_indent.add_accelerator("activate", accel_group,
+ GDK_KEY_Left,
+ Gdk::MOD1_MASK,
+ Gtk::ACCEL_VISIBLE);
+ }
+
void NoteTextMenu::on_show()
{
refresh_state();
diff --git a/src/notewindow.hpp b/src/notewindow.hpp
index ef80464..0e1d110 100644
--- a/src/notewindow.hpp
+++ b/src/notewindow.hpp
@@ -51,11 +51,10 @@ class NoteTextMenu
: public Gtk::Menu
{
public:
- NoteTextMenu(const Glib::RefPtr<Gtk::AccelGroup>&,
- const Glib::RefPtr<NoteBuffer> & buffer, UndoManager& undo_manager);
+ NoteTextMenu(const Glib::RefPtr<NoteBuffer> & buffer, UndoManager& undo_manager);
+ void set_accel_group(const Glib::RefPtr<Gtk::AccelGroup> &);
static void markup_label (Gtk::MenuItem & item);
-
protected:
virtual void on_show();
@@ -100,12 +99,21 @@ private:
class NoteWindow
- : public utils::ForcedPresentWindow<Gtk::Window>
+ : public Gtk::VBox
+ , public utils::EmbedableWidget
{
public:
NoteWindow(Note &);
~NoteWindow();
+ virtual std::string get_name() const;
+ void set_name(const std::string & name)
+ {
+ m_name = name;
+ }
+ virtual void foreground();
+ virtual void background();
+
Gtk::TextView * editor() const
{
return m_editor;
@@ -134,14 +142,8 @@ public:
{
return *m_find_bar;
}
-
-protected:
- virtual bool on_delete_event(GdkEventAny *ev);
- virtual void on_hide();
- virtual void on_show();
private:
bool on_key_pressed(GdkEventKey*);
- void close_window_handler();
void on_delete_button_clicked();
void on_selection_mark_set(const Gtk::TextIter&, const Glib::RefPtr<Gtk::TextMark>&);
void update_link_button_sensitivity();
@@ -165,8 +167,11 @@ private:
void open_help_activate();
void change_depth_right_handler();
void change_depth_left_handler();
+ void add_accel_group(Gtk::Window &);
+ void remove_accel_group(Gtk::Window &);
Note & m_note;
+ std::string m_name;
Glib::RefPtr<Gtk::AccelGroup> m_accel_group;
Gtk::Toolbar *m_toolbar;
Gtk::ToolButton *m_link_button;
@@ -180,6 +185,7 @@ private:
Gtk::CheckButton *m_save_size_check_button;
Gtk::CheckButton *m_save_selection_check_button;
Gtk::CheckButton *m_save_title_check_button;
+ Gtk::ImageMenuItem *m_find_item;
utils::GlobalKeybinder *m_global_keys;
utils::InterruptableTimeout *m_mark_set_timeout;
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index ec2f0bd..0379d6e 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -90,7 +90,7 @@ namespace gnote {
void NoteRecentChanges::present_note(const Note::Ptr & note)
{
- note->get_window()->show();
+ embed_widget(*note->get_window());
}
@@ -152,7 +152,7 @@ namespace gnote {
}
}
- hide ();
+ hide();
}
@@ -214,16 +214,26 @@ namespace gnote {
void NoteRecentChanges::unembed_widget(utils::EmbedableWidget & widget)
{
+ bool show_other = false;
std::map<utils::EmbedableWidget*, Gtk::RadioMenuItem*>::iterator iter = m_embeded_widgets.find(&widget);
if(iter != m_embeded_widgets.end()) {
if(is_foreground(*iter->first)) {
background_embeded(widget);
+ show_other = true;
}
m_menu->remove(*iter->second);
delete iter->second;
m_embeded_widgets.erase(iter);
widget.unembed();
}
+ if(show_other) {
+ if(m_embeded_widgets.size()) {
+ foreground_embeded(*m_embeded_widgets.rbegin()->first);
+ }
+ else if(get_visible()) {
+ on_close_window();
+ }
+ }
}
void NoteRecentChanges::foreground_embeded(utils::EmbedableWidget & widget)
@@ -233,7 +243,12 @@ namespace gnote {
void NoteRecentChanges::background_embeded(utils::EmbedableWidget & widget)
{
- m_embeded_widgets[&widget]->set_active(false);
+ if(get_visible()) {
+ m_embeded_widgets[&widget]->set_active(false);
+ }
+ else {
+ widget.background();
+ }
}
bool NoteRecentChanges::is_foreground(utils::EmbedableWidget & widget)
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index f85934c..7a52d1f 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -57,6 +57,11 @@ public:
virtual ~NoteRecentChanges();
void set_search_text(const std::string & value);
void present_note(const Note::Ptr & note);
+
+ virtual void embed_widget(utils::EmbedableWidget &);
+ virtual void unembed_widget(utils::EmbedableWidget &);
+ virtual void foreground_embeded(utils::EmbedableWidget &);
+ virtual void background_embeded(utils::EmbedableWidget &);
protected:
NoteRecentChanges(NoteManager& m);
virtual void on_show();
@@ -67,10 +72,6 @@ private:
void on_close_window();
bool on_delete(GdkEventAny *);
bool on_key_pressed(GdkEventKey *);
- void embed_widget(utils::EmbedableWidget &);
- void unembed_widget(utils::EmbedableWidget &);
- void foreground_embeded(utils::EmbedableWidget &);
- void background_embeded(utils::EmbedableWidget &);
bool is_foreground(utils::EmbedableWidget &);
void on_embeded_widget_menu_item_toggled(utils::EmbedableWidget *);
diff --git a/src/watchers.cpp b/src/watchers.cpp
index 5afcbb8..13a4e3b 100644
--- a/src/watchers.cpp
+++ b/src/watchers.cpp
@@ -187,7 +187,7 @@ namespace gnote {
}
// Only set window title here, to give feedback that we
// are indeed changing the title.
- get_window()->set_title(title);
+ get_window()->set_name(title);
}
@@ -220,7 +220,7 @@ namespace gnote {
bool NoteRenameWatcher::update_note_title()
{
- std::string title = get_window()->get_title();
+ std::string title = get_window()->get_name();
Note::Ptr existing = manager().find (title);
if (existing && (existing != get_note())) {
@@ -250,7 +250,7 @@ namespace gnote {
/// Had to add this check because this method is being called twice.
if (m_title_taken_dialog == NULL) {
m_title_taken_dialog =
- new utils::HIGMessageDialog (get_window(),
+ new utils::HIGMessageDialog (get_host_window(),
GTK_DIALOG_DESTROY_WITH_PARENT,
Gtk::MESSAGE_WARNING,
Gtk::BUTTONS_OK,
@@ -489,7 +489,7 @@ namespace gnote {
utils::open_url (url);
}
catch (Glib::Error & e) {
- utils::show_opening_location_error (get_window(), url, e.what());
+ utils::show_opening_location_error (get_host_window(), url, e.what());
}
// Kill the middle button paste...
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]