--- 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)