[gnote] Fix reembed note to other window



commit 0f9ec9791158b36cfcb30d44ecb4bae6e5f6ecf0
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sat Oct 6 22:45:27 2012 +0300

    Fix reembed note to other window

 src/notewindow.cpp |    9 +++++++++
 src/notewindow.hpp |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 0bcfad6..4b65850 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -140,6 +140,15 @@ namespace gnote {
     return m_name;
   }
 
+  void NoteWindow::embed(utils::EmbedableWidgetHost *h)
+  {
+    //remove from previous host, if any
+    if(host()) {
+      host()->unembed_widget(*this);
+    }
+    utils::EmbedableWidget::embed(h);
+  }
+
   void NoteWindow::foreground()
   {
     //addins may add accelarators, so accel group must be there
diff --git a/src/notewindow.hpp b/src/notewindow.hpp
index ec16355..a911eda 100644
--- a/src/notewindow.hpp
+++ b/src/notewindow.hpp
@@ -111,6 +111,7 @@ public:
     {
       m_name = name;
     }
+  virtual void embed(utils::EmbedableWidgetHost *h);
   virtual void foreground();
   virtual void background();
 



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