Frontend:
authorsmxx
Thu, 08 Apr 2010 17:56:30 +0000
changeset 3324 339b271d6641
parent 3323 091cf214bdd5
child 3325 652a8ebdf667
Frontend: * Show a text notice instead of settings page's (disabled) modify team buttons while in a room or game setup screen
QTfrontend/hwform.cpp
QTfrontend/pages.cpp
QTfrontend/pages.h
share/hedgewars/Data/Sounds/Rope_hit.ogg
--- a/QTfrontend/hwform.cpp	Thu Apr 08 02:35:40 2010 +0000
+++ b/QTfrontend/hwform.cpp	Thu Apr 08 17:56:30 2010 +0000
@@ -416,9 +416,11 @@
     if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) {
         QStringList tmNames = config->GetTeamsList();
         TeamSelWidget* curTeamSelWidget;
-        ui.pageOptions->BtnNewTeam->setEnabled(false);
-        ui.pageOptions->BtnEditTeam->setEnabled(false);
-        ui.pageOptions->BtnDeleteTeam->setEnabled(false);
+        ui.pageOptions->BtnNewTeam->setVisible(false);
+        ui.pageOptions->BtnEditTeam->setVisible(false);
+        ui.pageOptions->BtnDeleteTeam->setVisible(false);
+        ui.pageOptions->CBTeamName->setVisible(false);
+        ui.pageOptions->LblNoEditTeam->setVisible(true);
 
         if(id == ID_PAGE_MULTIPLAYER) {
           curTeamSelWidget = ui.pageMultiplayer->teamsSelect;
@@ -451,9 +453,11 @@
 
     if(id == ID_PAGE_MAIN)
     {
-        ui.pageOptions->BtnNewTeam->setEnabled(true);
-        ui.pageOptions->BtnEditTeam->setEnabled(true);
-        ui.pageOptions->BtnDeleteTeam->setEnabled(true);
+        ui.pageOptions->BtnNewTeam->setVisible(true);
+        ui.pageOptions->BtnEditTeam->setVisible(true);
+        ui.pageOptions->BtnDeleteTeam->setVisible(true);
+        ui.pageOptions->CBTeamName->setVisible(true);
+        ui.pageOptions->LblNoEditTeam->setVisible(false);
     }
 
     // load and save ignore/friends lists
--- a/QTfrontend/pages.cpp	Thu Apr 08 02:35:40 2010 +0000
+++ b/QTfrontend/pages.cpp	Thu Apr 08 17:56:30 2010 +0000
@@ -425,6 +425,12 @@
             BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6);
             GBTlayout->addWidget(BtnDeleteTeam, 0, 3);
 
+            LblNoEditTeam = new QLabel(teamsBox);
+            LblNoEditTeam->setText(tr("You can't edit teams from team selection. Go back to main menu to add, edit or delete teams."));
+            LblNoEditTeam->setWordWrap(true);
+            LblNoEditTeam->setVisible(false);
+            GBTlayout->addWidget(LblNoEditTeam, 0, 0);
+
             gbTBLayout->addWidget(teamsBox, 0, 0);
         }
 
--- a/QTfrontend/pages.h	Thu Apr 08 02:35:40 2010 +0000
+++ b/QTfrontend/pages.h	Thu Apr 08 17:56:30 2010 +0000
@@ -214,6 +214,7 @@
     QPushButton *BtnNewTeam;
     QPushButton *BtnEditTeam;
     QPushButton *BtnDeleteTeam;
+    QLabel *LblNoEditTeam;
     QComboBox *CBTeamName;
     IconedGroupBox *AGGroupBox;
     QComboBox *CBResolution;
Binary file share/hedgewars/Data/Sounds/Rope_hit.ogg has changed