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

Eli Fidler eli at staikos.net
Thu Mar 1 20:14:37 CET 2007


SVN commit 638381 by fidler:

settings dialog is modal, so convert to OK/Cancel

re: bug 141662


 M  +16 -16    kstsettingsdlg.ui  
 M  +11 -8     kstsettingsdlg.ui.h  


--- trunk/extragear/graphics/kst/src/libkstapp/kstsettingsdlg.ui #638380:638381
@@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
 <class>KstSettingsDlg</class>
 <widget class="QDialog">
     <property name="name">
@@ -9,7 +9,7 @@
             <x>0</x>
             <y>0</y>
             <width>541</width>
-            <height>549</height>
+            <height>587</height>
         </rect>
     </property>
     <property name="sizePolicy">
@@ -62,21 +62,18 @@
                 </spacer>
                 <widget class="QPushButton">
                     <property name="name">
-                        <cstring>_apply</cstring>
+                        <cstring>_ok</cstring>
                     </property>
-                    <property name="enabled">
-                        <bool>false</bool>
-                    </property>
                     <property name="text">
-                        <string>&amp;Apply</string>
+                        <string>&amp;OK</string>
                     </property>
                 </widget>
                 <widget class="QPushButton">
                     <property name="name">
-                        <cstring>_close</cstring>
+                        <cstring>_cancel</cstring>
                     </property>
                     <property name="text">
-                        <string>&amp;Close</string>
+                        <string>&amp;Cancel</string>
                     </property>
                 </widget>
             </hbox>
@@ -1229,12 +1226,12 @@
 </customwidgets>
 <images>
     <image name="image0">
-        <data format="XPM.GZ" length="4462">789c9d97c76e24490e86effd1442f3d65870d2451a0ce6206f5adeb4cc620f8c34f2553225b5a4c1befb46927fe6a1d4c0ccac4287fa8a0c26834193f5dbb785b3fd9d856fbf7d799ec9ecba5ea8afe469e15bf3727ffffeeffffcf1e797af49b2d0ffc7d142f2f55f5fbe1ecc16ea85dde9a4ed81290045faa77ca49cf4ab67ba1e3953969173651ab9d4fdf1c8a27c3872ad7c3c72d3b32c2a67c3f3444636fbef23eb7e590267e68fcc4656395d8dacf6d938ef97eaef289781cddebdb2846fccff44b989ba58e3411f3dc75158e6df1d3889539517ca49bf54fe43398d1dec4f46567f685fd9c539f43fc025f80c1c3ce8d93f28e77185f8bf0c6cfae4c0b5f9c3c6e5c0542a4b5876fe13708df39d2bd7716372aa8c93c4e4723bb2f977aadc26ceec4bdb7310e6b0bfab9c2445ecd49f1370694cebca65d260ffa6711a41aef14d24e94cee6be3348e0ae5e9c8765f07ca3e8db17f0f9c825794eb3489351fe9bb7217e4969f29388bd51ee9fda5715a19730696b852fea95c6471647ca95cf64bcf43e0cef4657b647bfe6acf213d6bb32f9a9f5992b5a64f9a8f990b6cf9ecc15d6cf9acf6b2da55a8a75cb973dee4b2d1b38b5c05de02434e87e01aacfb351df5bebddea74b5c67f9c795711ea15e357e2ecde35
 8fb87efc0a867df8cac728a074e62e527706afb59f3cf6583be5c28bb3c35f693812d1fbdc6dbe57966fec932d899ffa4f7e38adca17e34beaeca4b9c271a18f1d5fc739257b0d70d9c68be7bed7fcee7827ab91cd8e4740cf6b19d4ffb87ab07b9bf516e72d4a3ac821b9cef6e60d84f47367ded2fae1d9f7704f6163f79000ffde27660f387ed3c5dbf54dfeebb0bf6acbe6b706bfa5ef32f8f8b18f5bf0f463f20edb77956a4e68fbc80b3c4facd163847be6bfde72ec86dbeac82715fbc0286be683cf3bc081d44f7df80d344fb0b6b7de64581fb916765297263d6fccd9b7ee97e566e8b06cfdb1f59cf2bda2f8bbc2c11df0c5c41aefdb328ca22b1feb0012eedbce24736f91b18fb796d64eb87cb60817dcdafb07d906bfd14d22f659d8785ef97b2f6d7b2df6ef1d6fb2babaac6f92e8c25b27ecc1f239b7f3a5fca5a8678ea7c2d9bc0e6ef1238b3fca2c7814d5f4cbf9334b5f833384bed3c7a5f5514f4adbe2ec07962e7590457f06f6f649b977afe2a16f42f5e070bfc591e18f7a5f1a812a9e0df39d827da4fbd8c6ccfd7785569bf945f953371a9d5a3de67950bfa2d75c63eb2fb15bdcfaaf011e6c7263846bf8f4636f91618f3c7d3c0f047fb69550efab2074e12bd6fd27957553ec33c5b043bcc7f9d0795f818fdb501a3df8ae673e507ff69021eea37063b
 c45ffb73550736ff36c0a84f3e0317a86f8b5f139e6ffe1f821de6d9127898ff3be00a7c3ab2cd03e3d697560ff40016e47b3bb2e96bbd559d8f32bbff4b7065f193042c98873acf240af6adbf3c83c5f2954bb0c7bcd77c107d81d2fdebc63e33ff640aaecc9e1c8151df5c803dfaadc64b52dfa03ed64636ffb4ff4b2867f453ede7227586fcd3f9264ded91fffafe236d5da37fe83c91ceb7b9e5b7f6731ff92ed7f747d6fbf7e185cf58347e3e6932e47b3430fa893edf87d795c2fc3f003b67f5f902cec17abfde0dfa3c053b3c5ffb832fc2eb8fddcf233887fc195c801f46b6f3cdc02558fba72f7d2d1a7f7e321ee58fe0cad86bbff24dd3e2fe74fef836b0c6eb60d62fa6bf5e07b3419f853dd7dc70fb8bd5f1255fd90ed30f9f3c5ff30ddff21ddff384a7fcc08ffcc4cf61cdf8855ff9e79c7e1db4dff89d3f7891977899577895d7789d377893b7f83b6fcfe937bc13b477798ff7f9800ff928ac633ee11f7cca6761d7f99c7e1b3cb908da11c7413be1943376e153cc39175c72f549ff9e17c31744429e6a6aa8a58e2ee98aaee9866e7f617fc24b7417a4f734a1293dd0233dd133cd8285177aa5f9f3b63ca5377aa78f607b919668995682e62aadd17ab0b1419b9ff41f682b48bed336edd02eed05ed7d5ea3033a0cdf1ed1f127fd273ae123fa41a774a6b68
 5cee982228a837e42e927fd47caf8985c38651eb40b2ac38e4a5842658a97fab33fd248cb87d2c9a55cc9b5dcc82d1fc99ddccb44a6f230af2f8ff224cf417f262ff22a3fe54ddee543166549966545567f617f4dd66523dc6b2c9bb225df655b7682f692ecca9eeccfe97772c09b722847722c27c1f3eb70f66bf9116c9fca999ccbc59cfe25bf4a143a5ef8992561324a78bd92522acf9ebc78efe7cf7b153276db37bef59dbff457fedadff85b7f27abfede4ffcd4cf9ff76faeff4fffefeff8c7f5fedfdfbffc0fa355c495</data>
+        <data format="PNG" length="1002">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154388dad945f4c5b551cc73fe7dc4b7b4bcba0762d45c43114323599ee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d2a2f1af664b6f1e0fe3863a0718969700eb0c52142da0242a1bd6d696f7bcff101585203ceb8fd9ece39f99dcff9fe7edf939f88c562ec465f5f9fe609442c161362173c3e3eae7b7a7ac8e7f36432196cdbfe4f907c3e4f2291201e8fe338cec3737357e9e8e828aded1e229d650e1f2d51754b082110124c13a4dc5ea341eb9dc284c0558a853f3ce8cb0677ef500fde7d39d2596679e326597b8e9abb85d7a770ab16ab6983ec5a05b487a70e36f0f4e10afe408d6a558310980108478dba4a1e8233990c5d474b64ed39aa3a8fe5f3317fbf81dbd70bccfeb205947632fd74f6589c1c6ea2f70d03a58ba0c1f2c9bdc1b66de3b8256a6e11cbe7e3ee1d181b590124fe2693aeee08d223c82c3a2c24b7b874bec8f26288774f7bd054504aef0dde6e99c0eb83f9fb266323cb80a27fb0958141836044605a2ee5523393371cc646fee2da37195aa35d0c0c5b4859ac03d7e91712dcaac5adab3650a3ff9d08ef7dd8404bb48869e5d958b5b87dadc4c9a1464e9f0d0326df7e
 bd86bd2e310cb1bf62d384d59441f2d70a070e1c60e09489929b988681bdd9cc97170bcc4c65595f71f8e0e3301337fc24a7732467831875a47f289652b0be5e4151e6d07316c1b0c0340d8ab92023e76d66a6b2840e36d2fb7a13fee632475e6edc367ea98a90fb98b7dd6310ca0328a44761582e1bab41befabcc0ec940d28bc5e93b68e064cab84e1d9beaeb48934eac1f53b01c1b000fca496aa54b61a99fcde61662a4b4b4b23d1680be9d426173e4df3602a48ea411989a4fd590f52a8fd156b05ed9d350e3defe3cfdf4b4c7ce770ea7d3fb9f520afbe1620daeee5c26735d20b9b9cfb6811a754a439e4e5c5639a4caa1e5caf586bfc0197b78702005cb9b4cae4cd3267ce8638fe964bd72b393e39d74928d242617303a756a37f284447770dcdbffc6384a05a85de1306e9a52057c7527c7131c3c42d3f475eb2303c82d4fc3276d6811db37efeb148723082d9b08f79f97c1e5729109a9a28307cc622d2d6cdf52b2b24efe548dedb00142009862cfa879ee1a71f6cec928353511472fbf4389148b0b0e0c108081412458dfe21c9f11351e67e7358595468246d1d1e5e38a6e9e851bc39d84ab502a669331dafec0d8ec7e3e8cb06e1a881d727d1ae40180a434a8c9db129a54126ad48a7358c2b4c5352c8c374bcccdab2bb37d8719cba79fab8211f9df218e0582
 c261e95f8bfc04f1a1e8bc5c4dfe0a190172af6a9690000000049454e44ae426082</data>
     </image>
 </images>
 <connections>
     <connection>
-        <sender>_close</sender>
+        <sender>_cancel</sender>
         <signal>clicked()</signal>
         <receiver>KstSettingsDlg</receiver>
         <slot>close()</slot>
@@ -1252,16 +1249,16 @@
         <slot>defaults()</slot>
     </connection>
     <connection>
-        <sender>_apply</sender>
+        <sender>_ok</sender>
         <signal>clicked()</signal>
         <receiver>KstSettingsDlg</receiver>
         <slot>save()</slot>
     </connection>
     <connection>
-        <sender>_apply</sender>
+        <sender>_ok</sender>
         <signal>clicked()</signal>
         <receiver>KstSettingsDlg</receiver>
-        <slot>setClean()</slot>
+        <slot>close()</slot>
     </connection>
     <connection>
         <sender>_colors</sender>
@@ -1519,8 +1516,8 @@
     <tabstop>_radioButtonAuthenticationCramMD5</tabstop>
     <tabstop>_radioButtonAuthenticationDigestMD5</tabstop>
     <tabstop>_defaults</tabstop>
-    <tabstop>_apply</tabstop>
-    <tabstop>_close</tabstop>
+    <tabstop>_ok</tabstop>
+    <tabstop>_cancel</tabstop>
     <tabstop>tabWidget2</tabstop>
 </tabstops>
 <includes>
@@ -1536,6 +1533,9 @@
     <include location="local" impldecl="in implementation">ksttimezones.h</include>
     <include location="local" impldecl="in implementation">kstsettingsdlg.ui.h</include>
 </includes>
+<variables>
+    <variable access="private">bool _dirty</variable>
+</variables>
 <signals>
     <signal>settingsChanged()</signal>
 </signals>
--- trunk/extragear/graphics/kst/src/libkstapp/kstsettingsdlg.ui.h #638380:638381
@@ -13,26 +13,26 @@
     fillAxesSettings();
     updateCurveColorSettings();
     setSettings(KstSettings::globalSettings());
+    setClean();
     updateAxesButtons();
     updateAxesSettings();
     updateEMailSettings();
     _source->insertStringList(KstDataSource::pluginList());
     if (_source->count() > 0) {
- sourceChanged(_source->text(0));
+	sourceChanged(_source->text(0));
     } else {
- _configureSource->setEnabled(false);
+	_configureSource->setEnabled(false);
     }
-    _apply->setEnabled(false);
 
     QString hours = i18n(" hours");
     QLineEdit* edit = dynamic_cast<QLineEdit*>(_valueOffset->child("qt_spinbox_edit"));
     if (edit) {
- edit->setMaxLength(5 + hours.length());
+	edit->setMaxLength(5 + hours.length());
     }
     _valueOffset->setRange(-24.0, 24.0, 0.50, false);
     _valueOffset->setSuffix(i18n(" hours"));
     _colorPalette->_label->setText(i18n("Curve color sequence: "));
-    
+
     connect(_spinBoxLineWidth, SIGNAL(valueChanged(int)), this, SLOT(setDirty()));
     connect(_spinBoxLineWidth->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(setDirty()));
     connect(_valueOffset->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(updateTimezone(const QString&)));
@@ -95,18 +95,22 @@
 
 void KstSettingsDlg::setDirty()
 {
-    _apply->setEnabled(true);
+    _dirty = true;
 }
 
 
 void KstSettingsDlg::setClean()
 {
-    _apply->setEnabled(false);
+    _dirty = false;
 }
 
 
 void KstSettingsDlg::save()
 {
+    if (!_dirty) {
+	return;
+    }
+
     KstSettings s;
 
     s.plotUpdateTimer   = _timer->value();
@@ -229,7 +233,6 @@
     }
     KDialogBase *dlg = new KDialogBase(this, "Data Config Dialog", true, i18n("Configure Data Source"));
     connect(dlg, SIGNAL(okClicked()), cw, SLOT(save()));
-    connect(dlg, SIGNAL(applyClicked()), cw, SLOT(save()));
     cw->reparent(dlg, QPoint(0, 0));
     dlg->setMainWidget(cw);
     cw->load();


More information about the Kst mailing list