QTfrontend/selectWeapon.cpp
changeset 724 21706280d913
parent 723 35f7bdb93268
child 725 a7a8eef5bbb6
--- a/QTfrontend/selectWeapon.cpp	Sun Jan 20 13:49:57 2008 +0000
+++ b/QTfrontend/selectWeapon.cpp	Sun Jan 20 13:51:22 2008 +0000
@@ -27,6 +27,7 @@
 #include <QBitmap>
 #include <QLineEdit>
 #include <QSettings>
+#include <QMessageBox>
 
 QImage getAmmoImage(int num)
 {
@@ -149,7 +150,20 @@
 void SelWeaponWidget::deleteWeaponsName()
 {
   if (curWeaponsName=="") return;
-  wconf->remove(curWeaponsName);
+
+  if (curWeaponsName=="Default") {
+    QMessageBox impossible(QMessageBox::Warning, QMessageBox::tr("Weapons"), QMessageBox::tr("Can not delete default weapon set"));
+    impossible.exec();
+    return;
+  }
+
+  QMessageBox reallyDelete(QMessageBox::Question, QMessageBox::tr("Weapons"), QMessageBox::tr("Really delete this weapon set?"),
+			   QMessageBox::Ok | QMessageBox::Cancel);
+  
+  if (reallyDelete.exec()==QMessageBox::Ok) {
+    wconf->remove(curWeaponsName);
+    emit weaponsDeleted();
+  }
 }
 
 void SelWeaponWidget::setWeaponsName(const QString& name, bool editMode)