浏览代码

ENH: show exit status and exit code of hosted app

Marco Nolden 14 年之前
父节点
当前提交
9579bfecaf
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      Applications/ctkExampleHost/ctkHostAppExampleWidget.cpp

+ 11 - 1
Applications/ctkExampleHost/ctkHostAppExampleWidget.cpp

@@ -63,12 +63,22 @@ void ctkHostAppExampleWidget::appProcessError(QProcess::ProcessError error)
 
 void ctkHostAppExampleWidget::appProcessStateChanged(QProcess::ProcessState state)
 {
+  QString labelText;
   switch (state){
   case QProcess::Running:
     ui->processStateLabel->setText("Running");
     break;
   case QProcess::NotRunning:
-    ui->processStateLabel->setText("Not Running");
+    if (host->getAppProcess().exitStatus() == QProcess::CrashExit )
+    {
+        labelText = "crashed";
+    }
+    else
+    {
+      labelText = "Not Running, last exit code ";
+      labelText.append(QString::number(host->getAppProcess().exitCode()));
+    }
+    ui->processStateLabel->setText(labelText);
     break;
   case QProcess::Starting:
     ui->processStateLabel->setText("Starting");