[Kst] extragear/graphics/kst/src/libkstapp

George Staikos staikos at kde.org
Wed Feb 15 16:22:50 CET 2006


SVN commit 509704 by staikos:

Add an apply button to view object dialogs

BUG: 118679


 M  +19 -9     editviewobjectdialog.ui  
 M  +17 -7     ksteditviewobjectdialog_i.cpp  
 M  +4 -0      ksteditviewobjectdialog_i.h  


--- trunk/extragear/graphics/kst/src/libkstapp/editviewobjectdialog.ui #509703:509704
@@ -8,14 +8,6 @@
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
-        <widget class="QPushButton" row="1" column="2">
-            <property name="name">
-                <cstring>_cancel</cstring>
-            </property>
-            <property name="text">
-                <string>&amp;Cancel</string>
-            </property>
-        </widget>
         <spacer row="1" column="0">
             <property name="name">
                 <cstring>spacer6</cstring>
@@ -41,8 +33,24 @@
                 <string>&amp;OK</string>
             </property>
         </widget>
-        <widget class="QButtonGroup" row="0" column="0" rowspan="1" colspan="3">
+        <widget class="QPushButton" row="1" column="2">
             <property name="name">
+                <cstring>_apply</cstring>
+            </property>
+            <property name="text">
+                <string>&amp;Apply</string>
+            </property>
+        </widget>
+        <widget class="QPushButton" row="1" column="3">
+            <property name="name">
+                <cstring>_cancel</cstring>
+            </property>
+            <property name="text">
+                <string>&amp;Cancel</string>
+            </property>
+        </widget>
+        <widget class="QButtonGroup" row="0" column="0" rowspan="1" colspan="4">
+            <property name="name">
                 <cstring>_propertiesGroup</cstring>
             </property>
             <property name="title">
@@ -71,7 +79,9 @@
     </grid>
 </widget>
 <tabstops>
+    <tabstop>_propertiesFrame</tabstop>
     <tabstop>_OK</tabstop>
+    <tabstop>_apply</tabstop>
     <tabstop>_cancel</tabstop>
 </tabstops>
 <layoutdefaults spacing="6" margin="11"/>
--- trunk/extragear/graphics/kst/src/libkstapp/ksteditviewobjectdialog_i.cpp #509703:509704
@@ -15,6 +15,8 @@
  *                                                                         *
  ***************************************************************************/
 
+#include "ksteditviewobjectdialog_i.h"
+
 #include <qbutton.h>
 #include <qbuttongroup.h>
 #include <qcheckbox.h>
@@ -32,7 +34,7 @@
 #include <knuminput.h>
 #include <kurlrequester.h>
   
-#include "ksteditviewobjectdialog_i.h"
+#include "kst.h"
 
 #include <klocale.h>
 #include <stdio.h>
@@ -40,6 +42,7 @@
 KstEditViewObjectDialogI::KstEditViewObjectDialogI(QWidget* parent, const char* name, bool modal, WFlags fl) 
 : KstEditViewObjectDialog(parent, name, modal, fl) {
   connect(_cancel, SIGNAL(clicked()), this, SLOT(close()));
+  connect(_apply, SIGNAL(clicked()), this, SLOT(applyClicked()));
   connect(_OK, SIGNAL(clicked()), this, SLOT(okClicked()));
 
   _grid = 0L;
@@ -273,12 +276,7 @@
 }
 
 
-void KstEditViewObjectDialogI::okClicked() {
-  if (!_viewObject) {
-    QDialog::reject();
-    return;
-  }
-
+void KstEditViewObjectDialogI::applyClicked() {
   if (_customWidget) {
     // FILL ME IN TODO
     _viewObject->readConfigWidget(_customWidget);
@@ -307,6 +305,18 @@
     }
 #endif
   }
+  KstApp::inst()->paintAll(KstPainter::P_PAINT);
+}
+
+
+void KstEditViewObjectDialogI::okClicked() {
+  if (!_viewObject) {
+    QDialog::reject();
+    return;
+  }
+
+  applyClicked();
+
   QDialog::accept();
 }
 
--- trunk/extragear/graphics/kst/src/libkstapp/ksteditviewobjectdialog_i.h #509703:509704
@@ -24,6 +24,9 @@
 #include "kst_export.h"
 #include <qguardedptr.h>
 
+class QComboBox;
+class QGridLayout;
+
 class KST_EXPORT KstEditViewObjectDialogI : public KstEditViewObjectDialog {
   Q_OBJECT
   public:
@@ -56,6 +59,7 @@
     bool _isNew;
     
   private slots:
+    void applyClicked();
     void okClicked();
 };
 


More information about the Kst mailing list