[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-03-31 7:10:17
Message-ID: 20100331071017.0C904AC88B () svn ! kde ! org
[Download RAW message or body]

SVN commit 1109470 by staniek:

Forms
*Update info label when selected object's name changes



 M  +10 -1     core/KexiMainWindowIface.h  
 M  +3 -2      formeditor/form.cpp  
 M  +14 -9     main/KexiMainWindow.cpp  
 M  +11 -0     main/KexiMainWindow.h  
 M  +1 -1      main/KexiMainWindow_p.h  
 M  +18 -11    plugins/forms/kexiformview.cpp  
 M  +2 -1      plugins/forms/kexiformview.h  


--- trunk/koffice/kexi/core/KexiMainWindowIface.h #1109469:1109470
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
-   Copyright (C) 2003-2009 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2003-2010 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
@@ -271,6 +271,15 @@
 //! @todo replace with the final Actions API
     virtual void addToolBarAction(const QString& toolBarName, QAction *action) = 0;
 
+    /*! Updates info label of the property editor by reusing properties provided
+     by the current property set.
+     Read documentation of KexiPropertyEditorView class for information about \
accepted properties. +     If the current property is 0 and @a \
textToDisplayForNullSet string is not empty, this string is displayed +     (without \
icon or any other additional part). +     If the current property is 0 and @a \
textToDisplayForNullSet string is empty, the info label widget becomes +     hidden. \
*/ +    virtual void updatePropertyEditorInfoLabel(const QString& \
textToDisplayForNullSet = QString()) = 0; +
 protected: // slots:
     virtual void slotObjectRenamed(const KexiPart::Item &item, const QString& \
oldName) = 0;  
--- trunk/koffice/kexi/formeditor/form.cpp #1109469:1109470
@@ -1,7 +1,7 @@
 /* This file is part of the KDE project
    Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at>
    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
-   Copyright (C) 2004-2009 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2004-2010 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
@@ -2058,7 +2058,7 @@
 
     // iterate over the property list, and create Property objects
     foreach(const QByteArray& propName, propNames) {
-        kDebug() << ">> " << propName;
+        //kDebug() << ">> " << propName;
         const QMetaProperty subMeta = // special case - subproperty
             subpropIface ? subpropIface->findMetaSubproperty(propName) : \
QMetaProperty();  const QMetaProperty meta = subMeta.isValid() ? subMeta
@@ -3548,6 +3548,7 @@
 
 void Form::disableFilter(QWidget *w, Container *container)
 {
+    Q_UNUSED(container);
     ObjectTreeItem *tree = objectTree()->lookup(w->objectName());
     if (!tree)
         return;
--- trunk/koffice/kexi/main/KexiMainWindow.cpp #1109469:1109470
@@ -3698,7 +3698,7 @@
     if (window == currentWindow() && !window->isAttached()) {
         if (d->propEditor) {
             // ah, closing detached window - better switch off property buffer right \
                now...
-            d->propBuffer = 0;
+            d->propertySet = 0;
             d->propEditor->editor()->changeSet(0);
         }
     }
@@ -4437,13 +4437,13 @@
     << (_currentWindow ? _currentWindow->windowTitle() : QString("NULL"))
     << " window: " << (window ? window->windowTitle() : QString("NULL"));
     if (_currentWindow && _currentWindow != window) {
-        d->propBuffer = 0; //we'll need to move to another prop. set
+        d->propertySet = 0; //we'll need to move to another prop. set
         return;
     }
     if (d->propEditor) {
-        KoProperty::Set *newBuf = _currentWindow ? _currentWindow->propertySet() : \
                0;
-        if (!newBuf || (force || static_cast<KoProperty::Set*>(d->propBuffer) != \
                newBuf)) {
-            d->propBuffer = newBuf;
+        KoProperty::Set *newSet = _currentWindow ? _currentWindow->propertySet() : \
0; +        if (!newSet || (force || static_cast<KoProperty::Set*>(d->propertySet) != \
newSet)) { +            d->propertySet = newSet;
             if (preservePrevSelection || force) {
                 KoProperty::EditorView::SetOptions options = \
KoProperty::EditorView::ExpandChildItems;  if (preservePrevSelection) {
@@ -4454,17 +4454,17 @@
                 }
 
                 if (propertyToSelect.isEmpty()) {
-                    d->propEditor->editor()->changeSet(d->propBuffer, options);
+                    d->propEditor->editor()->changeSet(d->propertySet, options);
                 }
                 else {
-                    d->propEditor->editor()->changeSet(d->propBuffer, \
propertyToSelect, options); +                    \
d->propEditor->editor()->changeSet(d->propertySet, propertyToSelect, options);  }
             }
         }
 /*moved to d->updatePropEditorVisibility()
         const bool inDesignMode = _currentWindow && \
                _currentWindow->currentViewMode() == Kexi::DesignViewMode;
-        if (   (newBuf && inDesignMode)
-            || (!newBuf && inDesignMode && \
_currentWindow->part()->info()->isPropertyEditorAlwaysVisibleInDesignMode())) +       \
if (   (newSet && inDesignMode) +            || (!newSet && inDesignMode && \
_currentWindow->part()->info()->isPropertyEditorAlwaysVisibleInDesignMode()))  {
             d->propEditorDockWidget->setVisible(true);
         }
@@ -5245,4 +5245,9 @@
     d->tabbedToolBar->addAction(toolBarName, action);
 }
 
+void KexiMainWindow::updatePropertyEditorInfoLabel(const QString& \
textToDisplayForNullSet) +{
+    d->propEditor->updateInfoLabelForPropertySet(d->propertySet, \
textToDisplayForNullSet); +}
+
 #include "KexiMainWindow.moc"
--- trunk/koffice/kexi/main/KexiMainWindow.h #1109469:1109470
@@ -477,6 +477,17 @@
     /*! Used in openProject when running another Kexi process is required. */
     tristate openProjectInExternalKexiInstance(const QString& aFileName, const \
QString& fileNameForConnectionData, const QString& dbName);  
+    /*! Updates info label of the property editor by reusing properties provided
+     by the current property set.
+     Read documentation of KexiPropertyEditorView class for information about \
accepted properties. +     If the current property is 0 and @a \
textToDisplayForNullSet string is not empty, this string is displayed +     (without \
icon or any other additional part). +     If the current property is 0 and @a \
textToDisplayForNullSet string is empty, the info label widget becomes +     hidden.
+     Implemented for KexiMainWindow.
+     @see KexiPropertyPaneViewBase::updateInfoLabelForPropertySet() */
+    virtual void updatePropertyEditorInfoLabel(const QString& \
textToDisplayForNullSet); +
 protected slots:
 
     /*! Called once after timeout (after ctors are executed). */
--- trunk/koffice/kexi/main/KexiMainWindow_p.h #1109469:1109470
@@ -955,7 +955,7 @@
     QPointer<KexiPart::Part> partForPreviouslySetupPropertyPanelTabs;
     QMap<KexiPart::Part*, int> recentlySelectedPropertyPanelPages;
     QPointer<KexiPropertyEditorView> propEditor;
-    QPointer<KoProperty::Set> propBuffer;
+    QPointer<KoProperty::Set> propertySet;
 
     KXMLGUIClient *curWindowGUIClient, *curWindowViewGUIClient,
     *closedWindowGUIClient, *closedWindowViewGUIClient;
--- trunk/koffice/kexi/plugins/forms/kexiformview.cpp #1109469:1109470
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
-   Copyright (C) 2004-2009 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2004-2010 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
@@ -349,12 +349,12 @@
                 m_treeview, SLOT(setSelectedWidget(QWidget*, bool)));
         connect(form, SIGNAL(childAdded(ObjectTreeItem*)), m_treeview, \
                SLOT(addItem(ObjectTreeItem*)));
         connect(form, SIGNAL(childRemoved(ObjectTreeItem*)), m_treeview, \
                SLOT(removeItem(ObjectTreeItem*)));
-    }
-    connect(m_propSet, SIGNAL(widgetNameChanged(const QByteArray&, const \
                QByteArray&)),
-            form, SLOT(changeName(const QByteArray&, const QByteArray&)));
-*/
+    }*/
+        connect(form(), SIGNAL(widgetNameChanged(const QByteArray&,const \
QByteArray&)), +                this, SLOT(slotWidgetNameChanged(const \
QByteArray&,const QByteArray&))); +
 //2.0    form->setSelectedWidget(form->widget());
-    form()->selectWidget(form()->widget()); //added in 2.0
+        form()->selectWidget(form()->widget()); //added in 2.0
 //2.0    windowChanged(form->widget());
         //end of: from FormManager::initForm(Form *form)
     }
@@ -656,7 +656,7 @@
             KexiUtils::unsetFocusWithReason(QApplication::focusWidget(), \
Qt::TabFocusReason);  //}
 
-            QWidget *widget;
+            QWidget *widget = 0;
             foreach(widget, *orderedFocusWidgets) {
                 KexiFormDataItemInterface *iface = \
dynamic_cast<KexiFormDataItemInterface*>(widget);  if (iface)
@@ -1333,9 +1333,8 @@
             //1. resize by hand
             m_dbform->setGeometry(newFormRect);
             //2. store information about resize
-            KFormDesigner::PropertyCommand *resizeFormCommand = new \
                KFormDesigner::PropertyCommand(
-                *form(), m_dbform->objectName().toLatin1(), oldFormRect, \
                newFormRect, "geometry",
-                group);
+            (void)new KFormDesigner::PropertyCommand( *form(), \
m_dbform->objectName().toLatin1(), +                oldFormRect, newFormRect, \
"geometry", group);  //2.0            group->addCommand(resizeFormCommand, true/*will \
be executed on CommandGroup::execute()*/);  }
 
@@ -1416,5 +1415,13 @@
   m_dbform->updateTabStopsOrder(form());
 }*/
 
+void KexiFormView::slotWidgetNameChanged(const QByteArray& oldname, const \
QByteArray& newname) +{
+    Q_UNUSED(oldname);
+    Q_UNUSED(newname);
+    //kDebug() << oldname << newname << \
form()->propertySet().propertyValue("objectName").toString(); +    \
KexiMainWindowIface::global()->updatePropertyEditorInfoLabel(); +    \
formPart()->dataSourcePage()->updateInfoLabelForPropertySet(&form()->propertySet()); \
+} +
 #include "kexiformview.moc"
-
--- trunk/koffice/kexi/plugins/forms/kexiformview.h #1109469:1109470
@@ -1,6 +1,6 @@
 /* This file is part of the KDE project
    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
-   Copyright (C) 2004-2009 Jarosław Staniek <staniek@kde.org>
+   Copyright (C) 2004-2010 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
@@ -141,6 +141,7 @@
 
 //moved to formmanager  void setUndoEnabled(bool enabled);
 //moved to formmanager  void setRedoEnabled(bool enabled);
+    void slotWidgetNameChanged(const QByteArray& oldname, const QByteArray& \
newname);  
 protected:
     virtual tristate beforeSwitchTo(Kexi::ViewMode mode, bool &dontStore);


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

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