QTfrontend/ui/page/pagemain.cpp
branchwebgl
changeset 9127 e350500c4edb
parent 8833 c13ebed437cb
parent 9123 19c57656460f
child 9236 ddd675825672
equal deleted inserted replaced
8860:bde641cf53c8 9127:e350500c4edb
     1 /*
     1 /*
     2  * Hedgewars, a free turn based strategy game
     2  * Hedgewars, a free turn based strategy game
     3  * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
     4  *
     4  *
     5  * This program is free software; you can redistribute it and/or modify
     5  * This program is free software; you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     6  * it under the terms of the GNU General Public License as published by
     7  * the Free Software Foundation; version 2 of the License
     7  * the Free Software Foundation; version 2 of the License
     8  *
     8  *
   118 }
   118 }
   119 
   119 
   120 void PageMain::connectSignals()
   120 void PageMain::connectSignals()
   121 {
   121 {
   122     connect(BtnNet, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
   122     connect(BtnNet, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
   123     connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
   123     //connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
   124     connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
   124     //connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
   125     // TODO: add signal-forwarding required by (currently missing) encapsulation
   125     // TODO: add signal-forwarding required by (currently missing) encapsulation
   126 }
   126 }
   127 
   127 
   128 PageMain::PageMain(QWidget* parent) : AbstractPage(parent)
   128 PageMain::PageMain(QWidget* parent) : AbstractPage(parent)
   129 {
   129 {
   134     mainNote->setOpenExternalLinks(true);
   134     mainNote->setOpenExternalLinks(true);
   135 
   135 
   136 #ifdef DEBUG
   136 #ifdef DEBUG
   137     setDefaultDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!"));
   137     setDefaultDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!"));
   138 #else
   138 #else
   139     setDefaultDescription(QLabel::tr("Tip: ") + randomTip());
   139     setDefaultDescription(QLabel::tr("Tip: %1").arg(randomTip()));
   140 #endif
   140 #endif
   141 
   141 
   142 }
   142 }
   143 
   143 
   144 QString PageMain::randomTip() const
   144 QString PageMain::randomTip() const
   187     BtnNetLocal->setVisible(!visible);
   187     BtnNetLocal->setVisible(!visible);
   188     BtnNetOfficial->setVisible(!visible);
   188     BtnNetOfficial->setVisible(!visible);
   189     if (visible)    BtnNet->setIcon(originalNetworkIcon);
   189     if (visible)    BtnNet->setIcon(originalNetworkIcon);
   190     else            BtnNet->setIcon(disabledNetworkIcon);
   190     else            BtnNet->setIcon(disabledNetworkIcon);
   191 }
   191 }
       
   192 
       
   193 void PageMain::resetNetworkChoice()
       
   194 {
       
   195     BtnNetLocal->setVisible(false);
       
   196     BtnNetOfficial->setVisible(false);
       
   197     BtnNet->setIcon(originalNetworkIcon);
       
   198 }