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

Peter Kümmel syntheticpp at gmx.net
Tue Oct 23 19:21:56 UTC 2012


SVN commit 1322174 by kuemmel:

disable time format string when option is not selected

 M  +9 -0      datasources/ascii/asciiconfigwidget.cpp  
 M  +1 -0      datasources/ascii/asciiconfigwidget.h  
 M  +8 -0      libkstapp/axistab.cpp  
 M  +1 -0      libkstapp/axistab.h  
 M  +4 -4      libkstapp/axistab.ui  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciiconfigwidget.cpp #1322173:1322174
@@ -45,6 +45,7 @@
 
   connect(_readFields, SIGNAL(toggled(bool)), this, SLOT(updateUnitLineEnabled(bool)));
   connect(_limitFileBuffer, SIGNAL(toggled(bool)), this, SLOT(updateFrameBuffer(bool)));
+  connect(_indexType, SIGNAL(currentIndexChanged(int)), this, SLOT(updateFormatString()));
 }
 
 void AsciiConfigWidgetInternal::updateUnitLineEnabled(bool checked)
@@ -75,6 +76,13 @@
   }
 }
 
+void AsciiConfigWidgetInternal::updateFormatString() {
+  bool enable = (AsciiSourceConfig::Interpretation)(_indexType->currentIndex() + 1)
+                  == AsciiSourceConfig::FormatedTime;
+  _indexTimeFormat->setEnabled(enable);
+  _timeFormatLabel->setEnabled(enable);
+}
+
 QString AsciiConfigWidgetInternal::readLine(QTextStream& in, int maxLength)
 {
   const QString line = in.readLine();
@@ -187,6 +195,7 @@
 
   _useThreads->setChecked(config._useThreads);
   _indexTimeFormat->setText(config._indexTimeFormat);
+  updateFormatString();
 }
 
 
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciiconfigwidget.h #1322173:1322174
@@ -36,6 +36,7 @@
     void showBeginning();
     void updateUnitLineEnabled(bool);
     void updateFrameBuffer(bool);
+    void updateFormatString();
 
   private:
     const int _index_offset;
--- branches/work/kst/portto4/kst/src/libkstapp/axistab.cpp #1322173:1322174
@@ -77,6 +77,7 @@
   connect(_scaleLog, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
   connect(_scaleReverse, SIGNAL(stateChanged(int)), this, SIGNAL(modified()));
   connect(_scaleDisplayType, SIGNAL(currentIndexChanged(int)), this, SIGNAL(modified()));
+  connect(_scaleDisplayType, SIGNAL(currentIndexChanged(int)), this, SLOT(updateFormatString()));
   connect(_scaleDisplayFormatString, SIGNAL(textChanged(QString)), this, SIGNAL(modified()));
   connect(_scaleInterpretType, SIGNAL(currentIndexChanged(int)), this, SIGNAL(modified()));
   connect(_timeZone, SIGNAL(currentIndexChanged(int)), this, SIGNAL(modified()));
@@ -580,6 +581,13 @@
   updateButtons();
 }
 
+void AxisTab::updateFormatString() {
+  bool enable = (AxisDisplayType(_scaleDisplayType->itemData(_scaleDisplayType->currentIndex()).toInt())
+                  == AXIS_DISPLAY_QTDATETIME_FORMAT);
+  _scaleDisplayFormatString->setEnabled(enable);
+  _timeFormatLabel->setEnabled(enable);
+  _timeFormatHelp->setEnabled(enable);
+}
 
 void AxisTab::updateButtons() {
   bool interpret = (_scaleInterpret->checkState() == Qt::Checked);
--- branches/work/kst/portto4/kst/src/libkstapp/axistab.h #1322173:1322174
@@ -143,6 +143,7 @@
 
   public Q_SLOTS:
     void updateButtons();
+    void updateFormatString();
     void offsetAutoPressed();
     void offsetOnPressed();
     void offsetOffPressed();
--- branches/work/kst/portto4/kst/src/libkstapp/axistab.ui #1322173:1322174
@@ -139,9 +139,9 @@
          </widget>
         </item>
         <item row="3" column="0" colspan="2">
-         <widget class="QLabel" name="_timeFormaLabel">
+         <widget class="QLabel" name="_timeFormatLabel">
           <property name="enabled">
-           <bool>false</bool>
+           <bool>true</bool>
           </property>
           <property name="sizePolicy">
            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -168,9 +168,9 @@
          </widget>
         </item>
         <item row="3" column="4" colspan="2">
-         <widget class="QLabel" name="label_8">
+         <widget class="QLabel" name="_timeFormatHelp">
           <property name="text">
-           <string>Date: y,M,d Time: h,m,s,z</string>
+           <string>Date: y/M/d Time: h/m/s/z</string>
           </property>
          </widget>
         </item>


More information about the Kst mailing list