Преглед на файлове

Added reset functionality to the explorer app.

Sascha Zelzer преди 13 години
родител
ревизия
f3c159bed6

+ 7 - 0
Applications/ctkCommandLineModuleExplorer/ctkCmdLineModuleExplorerMainWindow.cpp

@@ -204,6 +204,11 @@ void ctkCLModuleExplorerMainWindow::on_actionQuit_triggered()
   this->close();
 }
 
+void ctkCLModuleExplorerMainWindow::on_actionReset_triggered()
+{
+  this->tabList->activeTab()->resetValues();
+}
+
 void ctkCLModuleExplorerMainWindow::checkModulePaused()
 {
   if (this->currentFutureWatcher.future().isPaused())
@@ -266,6 +271,7 @@ void ctkCLModuleExplorerMainWindow::moduleTabActivated(ctkCmdLineModuleFrontend
     ui->actionRun->setEnabled(false);
     ui->actionPause->setEnabled(false);
     ui->actionCancel->setEnabled(false);
+    ui->actionReset->setEnabled(false);
     currentFutureWatcher.setFuture(ctkCmdLineModuleFuture());
   }
   else
@@ -274,6 +280,7 @@ void ctkCLModuleExplorerMainWindow::moduleTabActivated(ctkCmdLineModuleFrontend
     ui->actionPause->setEnabled(module->future().canPause() && module->isRunning());
     ui->actionPause->setChecked(module->isPaused());
     ui->actionCancel->setEnabled(module->future().canCancel() && module->isRunning());
+    ui->actionReset->setEnabled(true);
     currentFutureWatcher.setFuture(module->future());
   }
 }

+ 2 - 0
Applications/ctkCommandLineModuleExplorer/ctkCmdLineModuleExplorerMainWindow.h

@@ -62,6 +62,8 @@ protected Q_SLOTS:
   void on_actionOptions_triggered();
   void on_actionQuit_triggered();
 
+  void on_actionReset_triggered();
+
   void checkModulePaused();
   void currentModuleResumed();
   void currentModuleCanceled();

+ 11 - 0
Applications/ctkCommandLineModuleExplorer/ctkCmdLineModuleExplorerMainWindow.ui

@@ -63,6 +63,7 @@
     <addaction name="actionRun"/>
     <addaction name="actionPause"/>
     <addaction name="actionCancel"/>
+    <addaction name="actionReset"/>
     <addaction name="separator"/>
     <addaction name="actionOptions"/>
    </widget>
@@ -83,6 +84,8 @@
    <addaction name="actionRun"/>
    <addaction name="actionPause"/>
    <addaction name="actionCancel"/>
+   <addaction name="separator"/>
+   <addaction name="actionReset"/>
   </widget>
   <widget class="QDockWidget" name="dockWidget">
    <property name="features">
@@ -225,6 +228,14 @@
     <string>&amp;Options...</string>
    </property>
   </action>
+  <action name="actionReset">
+   <property name="text">
+    <string>Reset</string>
+   </property>
+   <property name="toolTip">
+    <string>Reset to default values</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>