[Kst] branches/work/kst/portto4/kst/src

Mike Fenton mike at staikos.net
Wed Sep 26 17:26:04 CEST 2007


SVN commit 717299 by fenton:

Transition of editmultiplewidget into the new UI and extension of
dialog.ui to include an extension widget for adding additional ui
components to the right of the existing dialog.


 M  +28 -0     libkstapp/datadialog.cpp  
 M  +1 -0      libkstapp/datadialog.h  
 M  +6 -0      libkstapp/dialog.cpp  
 M  +1 -0      libkstapp/dialog.h  
 M  +22 -0     libkstapp/dialog.ui  
 AM            widgets/editmultiplewidget.cpp   [License: GPL (v2+)]
 AM            widgets/editmultiplewidget.h   [License: GPL (v2+)]
 AM            widgets/editmultiplewidget.ui  
 M  +4 -1      widgets/widgets.pro  


--- branches/work/kst/portto4/kst/src/libkstapp/datadialog.cpp #717298:717299
@@ -14,6 +14,8 @@
 #include "dialogtab.h"
 #include "dialogpage.h"
 
+#include "editmultiplewidget.h"
+
 #include "kstdataobject.h"
 
 #include <QLabel>
@@ -46,6 +48,17 @@
 
   connect(this, SIGNAL(ok()), this, SLOT(slotOk()));
 
+  QWidget *extension = extensionWidget();
+
+  QVBoxLayout *extensionLayout = new QVBoxLayout(extension);
+  extensionLayout->setContentsMargins(0, -1, 0, -1);
+
+  EditMultipleWidget *editMultipleWidget = new EditMultipleWidget();
+  extensionLayout->addWidget(editMultipleWidget);
+
+  extension->setLayout(extensionLayout);
+  extension->hide();
+
   QWidget *box = topCustomWidget();
 
   QHBoxLayout *layout = new QHBoxLayout(box);
@@ -54,11 +67,17 @@
   QLabel *label = new QLabel(tr("Unique Name:"), box);
   _tagName = new QLineEdit(box);
 
+  QPushButton *button = new QPushButton(tr("Edit Multiple >>"));
+  connect(button, SIGNAL(clicked()), this, SLOT(slotEditMultiple()));
+
   if (_dataObject)
     _tagName->setText(_dataObject->tagName());
+  else
+    button->setVisible(false);
 
   layout->addWidget(label);
   layout->addWidget(_tagName);
+  layout->addWidget(button);
 
   box->setLayout(layout);
 }
@@ -85,6 +104,15 @@
   setDataObject(ptr);
 }
 
+
+void DataDialog::slotEditMultiple() {
+  if (extensionWidget()->isVisible())
+    extensionWidget()->hide();
+  else
+    extensionWidget()->show();
 }
 
+
+}
+
 // vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/datadialog.h #717298:717299
@@ -44,6 +44,7 @@
 
   private Q_SLOTS:
     void slotOk();
+    void slotEditMultiple();
 
   private:
     void createGui();
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.cpp #717298:717299
@@ -77,10 +77,16 @@
 }
 
 
+QWidget *Dialog::extensionWidget() const {
+  return _extensionWidget;
+}
+
+
 QDialogButtonBox *Dialog::buttonBox() const {
  return _buttonBox;
 }
 
+
 void Dialog::selectPageForItem(QListWidgetItem *item) {
   if (_itemHash.contains(item))
     _stackedWidget->setCurrentWidget(_itemHash.value(item));
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.h #717298:717299
@@ -46,6 +46,7 @@
     QWidget *rightCustomWidget() const;
     QWidget *topCustomWidget() const;
     QWidget *bottomCustomWidget() const;
+    QWidget *extensionWidget() const;
     QDialogButtonBox *buttonBox() const;
 
   private Q_SLOTS:
--- branches/work/kst/portto4/kst/src/libkstapp/dialog.ui #717298:717299
@@ -9,6 +9,12 @@
     <height>299</height>
    </rect>
   </property>
+  <property name="sizePolicy" >
+   <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
   <property name="windowTitle" >
    <string>Dialog</string>
   </property>
@@ -99,6 +105,22 @@
        </property>
       </widget>
      </item>
+     <item rowspan="3" row="0" column="3" >
+      <widget class="QWidget" native="1" name="_extensionWidget" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="minimumSize" >
+        <size>
+         <width>325</width>
+         <height>0</height>
+        </size>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
    <item row="1" column="0" >
** branches/work/kst/portto4/kst/src/widgets/editmultiplewidget.cpp #property svn:executable
   + *
** branches/work/kst/portto4/kst/src/widgets/editmultiplewidget.h #property svn:executable
   + *
** branches/work/kst/portto4/kst/src/widgets/editmultiplewidget.ui #property svn:executable
   + *
--- branches/work/kst/portto4/kst/src/widgets/widgets.pro #717298:717299
@@ -24,6 +24,7 @@
     colorbutton.cpp \
     combobox.cpp \
     datarange.cpp \
+    editmultiplewidget.cpp \
     filerequester.cpp \
     gradienteditor.cpp
 
@@ -31,12 +32,14 @@
     colorbutton.h \
     combobox.h \
     datarange.h \
+    editmultiplewidget.h \
     filerequester.h \
     gradienteditor.h \
     kstwidgets.h
 
 FORMS += \
-    datarange.ui
+    datarange.ui \
+    editmultiplewidget.ui
 
 RESOURCES += \
     $$TOPLEVELDIR/src/images/images.qrc


More information about the Kst mailing list