QTfrontend/pageoptions.cpp
changeset 6024 d38da7c19e43
parent 6009 14f6fc9869f2
child 6042 8b5345758f62
--- a/QTfrontend/pageoptions.cpp	Sun Sep 25 16:09:55 2011 +0200
+++ b/QTfrontend/pageoptions.cpp	Sun Sep 25 19:30:10 2011 +0200
@@ -76,6 +76,7 @@
             BtnNewTeam->setIconSize(pmNew.size());
             BtnNewTeam->setIcon(pmNew);
             BtnNewTeam->setMaximumWidth(pmNew.width() + 6);
+            connect(BtnNewTeam, SIGNAL(clicked()), this, SIGNAL(newTeamRequested()));
             GBTlayout->addWidget(BtnNewTeam, 0, 1);
 
             BtnEditTeam = new QPushButton(teamsBox);
@@ -83,6 +84,7 @@
             BtnEditTeam->setIconSize(pmEdit.size());
             BtnEditTeam->setIcon(pmEdit);
             BtnEditTeam->setMaximumWidth(pmEdit.width() + 6);
+            connect(BtnEditTeam, SIGNAL(clicked()), this, SLOT(requestEditSelectedTeam()));
             GBTlayout->addWidget(BtnEditTeam, 0, 2);
 
             BtnDeleteTeam = new QPushButton(teamsBox);
@@ -90,6 +92,7 @@
             BtnDeleteTeam->setIconSize(pmDelete.size());
             BtnDeleteTeam->setIcon(pmDelete);
             BtnDeleteTeam->setMaximumWidth(pmDelete.width() + 6);
+            connect(BtnDeleteTeam, SIGNAL(clicked()), this, SLOT(requestDeleteSelectedTeam()));
             GBTlayout->addWidget(BtnDeleteTeam, 0, 3);
 
             LblNoEditTeam = new QLabel(teamsBox);
@@ -457,3 +460,23 @@
 {
     editNetNick->setText(editNetNick->text().trimmed());
 }
+
+void PageOptions::requestEditSelectedTeam()
+{
+    emit editTeamRequested(CBTeamName->currentText());
+}
+
+void PageOptions::requestDeleteSelectedTeam()
+{
+    emit deleteTeamRequested(CBTeamName->currentText());
+}
+
+void PageOptions::setTeamOptionsEnabled(bool enabled)
+{
+    BtnNewTeam->setVisible(enabled);
+    BtnEditTeam->setVisible(enabled);
+    BtnDeleteTeam->setVisible(enabled);
+    CBTeamName->setVisible(enabled);
+    LblNoEditTeam->setVisible(!enabled);
+}
+