QTfrontend/ui/page/pageoptions.cpp
changeset 12246 0b5aa545e058
parent 12245 88b31fdc760b
child 12256 caff1a3a7456
--- a/QTfrontend/ui/page/pageoptions.cpp	Wed Apr 12 23:05:18 2017 +0200
+++ b/QTfrontend/ui/page/pageoptions.cpp	Thu Apr 13 05:44:23 2017 +0200
@@ -32,6 +32,7 @@
 #include <QSlider>
 #include <QSignalMapper>
 #include <QColorDialog>
+#include <QMessageBox>
 #include <QStandardItemModel>
 #include <QDebug>
 
@@ -985,7 +986,10 @@
 
 void PageOptions::requestDeleteSelectedTeam()
 {
-    emit deleteTeamRequested(CBTeamName->currentText());
+    if(CBTeamName->count() > 1)
+        emit deleteTeamRequested(CBTeamName->currentText());
+    else
+        QMessageBox::warning(this, tr("Can't delete last team"), tr("You can't delete the last team!"));
 }
 
 void PageOptions::setTeamOptionsEnabled(bool enabled)