[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi
From:       Jarosław Staniek <staniek () kde ! org>
Date:       2010-09-27 22:40:26
Message-ID: 20100927224026.3BD8AAC88E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1180417 by staniek:

Forms
*Widgets Tree:
**fix delete widget action in context menu (and possibly other actions)



 M  +10 -2     core/kexisharedactionhost.cpp  
 M  +7 -0      core/kexisharedactionhost.h  
 M  +1 -1      doc/dev/CHANGELOG-Kexi-js  
 M  +4 -1      main/KexiMainWindow.cpp  
 M  +1 -1      main/KexiMainWindow.h  


--- trunk/koffice/kexi/core/kexisharedactionhost.cpp #1180416:1180417
@@ -211,11 +211,18 @@
     return 0;
 }
 
+#if 0 // 2.x
 bool KexiSharedActionHost::acceptsSharedActions(QObject *)
 {
     return false;
 }
+#endif
 
+QWidget* KexiSharedActionHost::findWindow(QWidget *w)
+{
+    return 0;
+}
+
 QWidget* KexiSharedActionHost::focusWindow()
 {
 #if 0 //sebsauer 20061120: KDE3
@@ -235,9 +242,10 @@
     if (!aw)
         aw = dynamic_cast<QWidget*>(d->mainWin);
     QWidget *fw = aw->focusWidget();
-    while (fw && !acceptsSharedActions(fw))
+    return findWindow(fw);
+/*2.x    while (fw && !acceptsSharedActions(fw))
         fw = fw->parentWidget();
-    return fw;
+    return fw;*/
 #endif
 }
 
--- trunk/koffice/kexi/core/kexisharedactionhost.h #1180416:1180417
@@ -62,6 +62,7 @@
 
     virtual ~KexiSharedActionHost();
 
+#if 0
     /*! \return true if \a w can accept shared actions.
      This method is used by focusWindow() to look up widgets hierarchy
      for widget that can accept shared actions.
@@ -72,7 +73,13 @@
      \endcode
      */
     virtual bool acceptsSharedActions(QObject *o);
+#endif
 
+    /*! Performs lookup like in KexiSharedActionHost::focusWindow()
+     but starting from \a w instead of a widget returned by QWidget::focusWidget().
+     \return NULL if no widget matches acceptsSharedActions() or if \a w is NULL. */
+    virtual QWidget* findWindow(QWidget *w);
+
     /*! \return window widget that is currently focused (using QWidget::focusWidget())
      and matches acceptsSharedActions(). If focused widget does not match,
      it's parent, grandparent, and so on is checked. If all this fails,
--- trunk/koffice/kexi/doc/dev/CHANGELOG-Kexi-js #1180416:1180417
@@ -135,7 +135,7 @@
 **indentation level reduced by 50%
 **fixed adding item when tab page is added
 **fix sorting
-TODO: fix delete widget action in context menu
+**fix delete widget action in context menu
 TODO: when undoing removing tab page, restore contents recursively
 
 *tab widget
--- trunk/koffice/kexi/main/KexiMainWindow.cpp #1180416:1180417
@@ -3942,8 +3942,11 @@
 
 QWidget* KexiMainWindow::findWindow(QWidget *w)
 {
-    while (w && !acceptsSharedActions(w))
+    while (w && !acceptsSharedActions(w)) {
+        if (w == d->propEditorDockWidget)
+            return currentWindow();
         w = w->parentWidget();
+    }
     return w;
 }
 
--- trunk/koffice/kexi/main/KexiMainWindow.h #1180416:1180417
@@ -445,7 +445,7 @@
     /*! Performs lookup like in KexiSharedActionHost::focusWindow()
      but starting from \a w instead of a widget returned by QWidget::focusWidget().
      \return NULL if no widget matches acceptsSharedActions() or if \a w is NULL. */
-    QWidget* findWindow(QWidget *w);
+    virtual QWidget* findWindow(QWidget *w);
 
     /*! Updates application's caption - also shows project's name. */
     void updateAppCaption();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic