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

List:       kde-commits
Subject:    koffice/kexi/main
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2009-03-18 21:04:11
Message-ID: 1237410251.040005.15637.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 941099 by staniek:

Forms
- fixed regression introduced today:
  display the property pane when entering into design view mode directly 
  (either by invoking "new" action or "design" action)



 M  +2 -2      KexiMainWindow.cpp  
 M  +13 -43    KexiMainWindow_p.h  


--- trunk/koffice/kexi/main/KexiMainWindow.cpp #941098:941099
@@ -2743,7 +2743,7 @@
 //   d->propBuffer = currentWindow()->propertyBuffer();
 //   d->propEditor->editor()->setBuffer( d->propBuffer );
 //  }
-        if (currentWindow() && currentWindow()->currentViewMode() != 0) //on opening \
new dialog it can be 0; we don't want this +        if (currentWindow() && \
currentWindow()->currentViewMode() != 0 && window) //on opening new dialog it can be \
                0; we don't want this
             d->updatePropEditorVisibility(currentWindow()->currentViewMode());
     }
 
@@ -4027,8 +4027,8 @@
         needsUpdateViewGUIClient = false;
         alreadyOpened = true;
     } else {
-        d->updatePropEditorVisibility(viewMode);
         KexiPart::Part *part = Kexi::partManager().partForClass(item->partClass());
+        d->updatePropEditorVisibility(viewMode, part ? part->info() : 0);
         //update tabs before opening
         updateCustomPropertyPanelTabs(currentWindow() ? currentWindow()->part() : 0,
                                       currentWindow() ? \
                currentWindow()->currentViewMode() : Kexi::NoViewMode,
--- trunk/koffice/kexi/main/KexiMainWindow_p.h #941098:941099
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
-   Copyright (C) 2003-2007 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2009 Jarosław Staniek <staniek@kde.org>
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -757,49 +757,19 @@
         }
       }*/
 
-    void updatePropEditorVisibility(Kexi::ViewMode viewMode) {
-        /// @note Q_UNUSED(viewMode)
-        Q_UNUSED(viewMode);
-        if (propEditorDockWidget) {
-            KexiWindow *currentWindow = wnd->currentWindow();
-            bool visible = currentWindow && viewMode == Kexi::DesignViewMode;
-            if (    currentWindow
-                 && !currentWindow->propertySet()
-                 && \
                !currentWindow->part()->info()->isPropertyEditorAlwaysVisibleInDesignMode() \
                )
-            {
-                visible = false;
-            }
-            kDebug() << "visible == " << visible;
-            propEditorDockWidget->setVisible(visible);
+    //! Updates Property Editor Pane's visibility for the current window and the @a \
viewMode view mode. +    /*! @a info can be provided to hadle cases when current \
window is not yet defined (in openObject()). */ +    void \
updatePropEditorVisibility(Kexi::ViewMode viewMode, KexiPart::Info *info = 0) { +     \
if (!propEditorDockWidget) +            return;
+        KexiWindow *currentWindow = wnd->currentWindow();
+        if (!info && currentWindow) {
+            info = currentWindow->part()->info();
         }
-
-#ifdef __GNUC__
-#warning TODO updatePropEditorVisibility
-#else
-#pragma WARNING( TODO updatePropEditorVisibility )
-#endif
-#if 0 //TODO reenable
-        if (propEditorToolWindow) {
-            if (viewMode == 0 || viewMode == Kexi::DataViewMode) {
-#ifdef PROPEDITOR_VISIBILITY_CHANGES
-                wnd->makeDockInvisible(wnd->manager()->findWidgetParentDock(propEditor));
                
-//    propEditorToolWindow->hide();
-#endif
-            } else {
-                //propEditorToolWindow->show();
-                QWidget *origFocusWidget = qApp->focusWidget();
-                wnd->makeWidgetDockVisible(propEditorTabWidget);
-                if (origFocusWidget)
-                    origFocusWidget->setFocus();
-                /*moved
-                #if defined(KDOCKWIDGET_P)
-                        KDockWidget *dw = (KDockWidget *)propEditor->parentWidget();
-                        KDockSplitter *ds = (KDockSplitter *)dw->parentWidget();
-                        \
                ds->setSeparatorPosInPercent(config->readEntry("RightDockPosition", \
                80));//%
-                #endif*/
-            }
-        }
-#endif
+        const bool visible = (viewMode == Kexi::DesignViewMode)
+            && ((currentWindow && currentWindow->propertySet()) || \
info->isPropertyEditorAlwaysVisibleInDesignMode()); +        kDebug() << "visible == \
" << visible; +        propEditorDockWidget->setVisible(visible);
     }
 
 //2.0: unused


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

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