[Kst] branches/kst/1.3/kst/src/libkstapp

Adam Treat treat at kde.org
Fri Oct 6 20:14:39 CEST 2006


SVN commit 593076 by treat:

* Backport commit# 593050 to 1.3 branch


 M  +6 -0      kst.cpp  
 M  +14 -0     kstviewfitsdialog_i.cpp  
 M  +2 -0      kstviewfitsdialog_i.h  
 M  +5 -0      kstviewmatricesdialog_i.cpp  
 M  +2 -0      kstviewmatricesdialog_i.h  
 M  +4 -0      kstviewscalarsdialog_i.cpp  
 M  +2 -0      kstviewscalarsdialog_i.h  
 M  +5 -0      kstviewvectorsdialog_i.cpp  
 M  +2 -0      kstviewvectorsdialog_i.h  


--- branches/kst/1.3/kst/src/libkstapp/kst.cpp #593075:593076
@@ -2102,6 +2102,12 @@
 
 
 void KstApp::updateDataDialogs(bool dm, bool vm) {
+
+  ViewScalarsDialogAction->setEnabled(viewScalarsDialog->hasContent());
+  ViewVectorsDialogAction->setEnabled(viewVectorsDialog->hasContent());
+  ViewMatricesDialogAction->setEnabled(viewMatricesDialog->hasContent());
+  ViewFitsDialogAction->setEnabled(viewFitsDialog->hasContent());
+
   if (!viewScalarsDialog->isHidden()) {
     viewScalarsDialog->updateViewScalarsDialog();
   }
--- branches/kst/1.3/kst/src/libkstapp/kstviewfitsdialog_i.cpp #593075:593076
@@ -53,6 +53,20 @@
 KstViewFitsDialogI::~KstViewFitsDialogI() {
 }
 
+
+bool KstViewFitsDialogI::hasContent() const {
+  bool content = false;
+  KstPluginList fits = kstObjectSubList<KstDataObject,KstPlugin>(KST::dataObjectList);
+  KstPluginList::ConstIterator it = fits.begin();
+  for (; it != fits.end(); ++it) {
+    (*it)->readLock();
+    content = (*it)->plugin()->data()._isFit ? true : content;
+    (*it)->unlock();
+  }
+  return content;
+}
+
+
 void KstViewFitsDialogI::fillComboBox(const QString& str) {
   QString fitName = str;
 
--- branches/kst/1.3/kst/src/libkstapp/kstviewfitsdialog_i.h #593075:593076
@@ -30,6 +30,8 @@
     virtual ~KstViewFitsDialogI();
     KstFitTable* tableFits;
 
+    bool hasContent() const;
+
   public slots:
     void updateViewFitsDialog();
     void showViewFitsDialog();
--- branches/kst/1.3/kst/src/libkstapp/kstviewmatricesdialog_i.cpp #593075:593076
@@ -53,6 +53,11 @@
 }
 
 
+bool KstViewMatricesDialogI::hasContent() const {
+  return !KST::matrixList.isEmpty();
+}
+
+
 void KstViewMatricesDialogI::updateViewMatricesDialog() {
   matrixSelector->update();
   QString matrix = matrixSelector->selectedMatrix();
--- branches/kst/1.3/kst/src/libkstapp/kstviewmatricesdialog_i.h #593075:593076
@@ -30,6 +30,8 @@
     virtual ~KstViewMatricesDialogI();
     KstMatrixTable* _tableMatrices;
 
+    bool hasContent() const;
+
   public slots:
     void updateViewMatricesDialog();
     void updateViewMatricesDialog(const QString& strVector);
--- branches/kst/1.3/kst/src/libkstapp/kstviewscalarsdialog_i.cpp #593075:593076
@@ -56,6 +56,10 @@
 }
 
 
+bool KstViewScalarsDialogI::hasContent() const {
+  return !KST::scalarList.isEmpty();
+}
+
 void KstViewScalarsDialogI::updateViewScalarsDialog() {
   KST::scalarList.lock().readLock();
   int needed = KST::scalarList.count();
--- branches/kst/1.3/kst/src/libkstapp/kstviewscalarsdialog_i.h #593075:593076
@@ -30,6 +30,8 @@
     virtual ~KstViewScalarsDialogI();
     KstScalarTable* tableScalars;
 
+    bool hasContent() const;
+
   protected slots:
     virtual void languageChange();
 
--- branches/kst/1.3/kst/src/libkstapp/kstviewvectorsdialog_i.cpp #593075:593076
@@ -57,6 +57,11 @@
 }
 
 
+bool KstViewVectorsDialogI::hasContent() const {
+  return !KST::vectorList.isEmpty();
+}
+
+
 void KstViewVectorsDialogI::updateViewVectorsDialog() {
   vectorSelector->update();
   QString vector = vectorSelector->selectedVector();
--- branches/kst/1.3/kst/src/libkstapp/kstviewvectorsdialog_i.h #593075:593076
@@ -30,6 +30,8 @@
     virtual ~KstViewVectorsDialogI();
     KstVectorTable* tableVectors;
 
+    bool hasContent() const;
+
   public slots:
     void updateViewVectorsDialog();
     void updateViewVectorsDialog(const QString& strVector);


More information about the Kst mailing list