--- a/QTfrontend/hwform.cpp Mon Jan 21 07:10:59 2019 +0100
+++ b/QTfrontend/hwform.cpp Mon Jan 21 09:12:39 2019 +0100
@@ -579,6 +579,7 @@
ui.pageCampaign->CBTeam->clear();
ui.pageTraining->CBTeam->clear();
/* Only show human teams in campaign/training page */
+ bool playable = false;
for(int i=0; i<teamslist.length(); i++)
{
HWTeam testTeam = HWTeam(teamslist[i]);
@@ -587,8 +588,13 @@
{
ui.pageCampaign->CBTeam->addItem(teamslist[i]);
ui.pageTraining->CBTeam->addItem(teamslist[i]);
+ playable = true;
}
}
+ ui.pageCampaign->BtnStartCampaign->setEnabled(playable);
+ ui.pageCampaign->btnPreview->setEnabled(playable);
+ ui.pageTraining->btnStart->setEnabled(playable);
+ ui.pageTraining->btnPreview->setEnabled(playable);
UpdateTrainingPageTeam(0);
}
--- a/QTfrontend/ui/page/pagetraining.cpp Mon Jan 21 07:10:59 2019 +0100
+++ b/QTfrontend/ui/page/pagetraining.cpp Mon Jan 21 09:12:39 2019 +0100
@@ -304,7 +304,7 @@
list = (QListWidget*) tbw->currentWidget();
QListWidgetItem * curItem = list->currentItem();
- if (curItem != NULL)
+ if ((curItem != NULL) && (CBTeam->currentIndex() != -1))
emit startMission(curItem->data(Qt::UserRole).toString(), getSubFolderOfSelected());
}
--- a/QTfrontend/ui/page/pagetraining.h Mon Jan 21 07:10:59 2019 +0100
+++ b/QTfrontend/ui/page/pagetraining.h Mon Jan 21 09:12:39 2019 +0100
@@ -30,6 +30,8 @@
QListWidget * lstTrainings;
QListWidget * lstChallenges;
QListWidget * lstScenarios;
+ QPushButton * btnPreview;
+ QPushButton * btnStart;
QComboBox * CBTeam;
public slots:
@@ -46,8 +48,6 @@
private:
- QPushButton * btnPreview;
- QPushButton * btnStart;
QLabel * lblCaption;
QLabel * lblDescription;
QLabel * lblHighscores;