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

Peter Kümmel syntheticpp at gmx.net
Tue Aug 31 15:05:39 CEST 2010


SVN commit 1170290 by kuemmel:

this way we get a better width of the combobox

 M  +11 -13    datawizard.cpp  
 M  +1 -1      datawizard.h  
 M  +1 -1      datawizardpagedatasource.ui  


--- branches/work/kst/portto4/kst/src/libkstapp/datawizard.cpp #1170289:1170290
@@ -47,7 +47,10 @@
   _url->setFile(default_source);
   _url->setFocus();
 
-  initUpdateBox();  
+  _updateBox->addItem("Time interval");
+  _updateBox->addItem("Change detection");
+  _updateBox->addItem("Don't update");
+  updateUpdateBox();
   connect(_updateBox, SIGNAL(activated(int)), this, SLOT(updateTypeActivated(int)));
 }
 
@@ -56,34 +59,28 @@
 }
 
 
-void DataWizardPageDataSource::initUpdateBox()
+void DataWizardPageDataSource::updateUpdateBox()
 {
-  _updateBox->clear();
-
   if (_dataSource) {
-    _updateBox->addItem("Time interval");
-    _updateBox->addItem("Change detection");
-    _updateBox->addItem("Don't update");
+    _updateBox->setEnabled(true);
     switch (_dataSource->updateType()) {
       case DataSource::Timer: _updateBox->setCurrentIndex(0); break;
       case DataSource::File:  _updateBox->setCurrentIndex(1); break;
       case DataSource::None:  _updateBox->setCurrentIndex(2); break;
       default: break;
     };
-
-  } else {
-    _updateBox->addItem("Unknown");
-    _updateBox->setCurrentIndex(0);
+  } else {    _updateBox->setEnabled(false);
   }
 }
 
 void DataWizardPageDataSource::updateTypeActivated(int idx)
 {
-  initUpdateBox();
   if (!_dataSource) {    
+    _updateBox->setEnabled(false);
     return;
   }
   switch (idx) {
+    _updateBox->setEnabled(true);
     case 0: _dataSource->setUpdateType(DataSource::Timer); break;
     case 1: _dataSource->setUpdateType(DataSource::File);  break;
     case 2: _dataSource->setUpdateType(DataSource::None);  break;
@@ -133,7 +130,7 @@
     _store->cleanUpDataSourceList();
   }
 
-  initUpdateBox();
+  updateUpdateBox();
 
   emit completeChanged();
   emit dataSourceChanged();
@@ -144,6 +141,7 @@
   _pageValid = false;
   _fileType->setText(QString());
   _configureSource->setEnabled(false);
+  _updateBox->setEnabled(false);
   emit completeChanged();
 
   _requestID += 1;
--- branches/work/kst/portto4/kst/src/libkstapp/datawizard.h #1170289:1170290
@@ -59,7 +59,7 @@
     ObjectStore *_store;
     DataSourcePtr _dataSource;
     int _requestID;
-    void initUpdateBox();
+    void updateUpdateBox();
 };
 
 class DataWizardPageVectors : public QWizardPage, Ui::DataWizardPageVectors
--- branches/work/kst/portto4/kst/src/libkstapp/datawizardpagedatasource.ui #1170289:1170290
@@ -142,7 +142,7 @@
         <widget class="QComboBox" name="_updateBox">
          <property name="minimumSize">
           <size>
-           <width>120</width>
+           <width>0</width>
            <height>0</height>
           </size>
          </property>


More information about the Kst mailing list