QTfrontend/ui/page/pagemain.cpp
branchwebgl
changeset 8833 c13ebed437cb
parent 8444 75db7bb8dce8
parent 8729 b19be476a2fa
child 9127 e350500c4edb
equal deleted inserted replaced
8450:404ddce27b23 8833:c13ebed437cb
    59     //netLayoutWidget->setStyleSheet("background: green;");
    59     //netLayoutWidget->setStyleSheet("background: green;");
    60     //netLayoutWidget->setFixedSize(314, 260);
    60     //netLayoutWidget->setFixedSize(314, 260);
    61     netLayout->setSpacing(20);
    61     netLayout->setSpacing(20);
    62     netLayout->setAlignment(Qt::AlignHCenter);
    62     netLayout->setAlignment(Qt::AlignHCenter);
    63 
    63 
    64     BtnNetLocal = addButton("Play local network game", (QBoxLayout*)netLayout, 0, false);
    64     BtnNetLocal = addButton(tr("Play local network game"), (QBoxLayout*)netLayout, 0, false);
    65     BtnNetLocal->setWhatsThis(tr("Play a game across a local area network"));
    65     BtnNetLocal->setWhatsThis(tr("Play a game across a local area network"));
    66     BtnNetLocal->setFixedSize(BtnNet->width() - 50, 60);
    66     BtnNetLocal->setFixedSize(BtnNet->width() - 50, 60);
    67     BtnNetLocal->setVisible(false);
    67     BtnNetLocal->setVisible(false);
    68 
    68 
    69     BtnNetOfficial = addButton("Play official network game", (QBoxLayout*)netLayout, 0, false);
    69     BtnNetOfficial = addButton(tr("Play official network game"), (QBoxLayout*)netLayout, 0, false);
    70     BtnNetOfficial->setWhatsThis(tr("Play a game on an official server"));
    70     BtnNetOfficial->setWhatsThis(tr("Play a game on an official server"));
    71     BtnNetOfficial->setFixedSize(BtnNet->width() - 50, 60);
    71     BtnNetOfficial->setFixedSize(BtnNet->width() - 50, 60);
    72     BtnNetOfficial->setVisible(false);
    72     BtnNetOfficial->setVisible(false);
    73 
    73 
    74     // button order matters for overlapping (what's on top and what isn't)
    74     // button order matters for overlapping (what's on top and what isn't)
    75     BtnInfo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, true);
    75     BtnInfo = addButton(":/res/HedgewarsTitle.png", pageLayout, 0, 0, 1, 4, true);
    76     BtnInfo->setStyleSheet("border: transparent;background: transparent;");
    76     BtnInfo->setStyleSheet("border: transparent;background: transparent;");
    77     BtnInfo->setWhatsThis(tr("Read about who is behind the Hedgewars Project"));
    77     BtnInfo->setWhatsThis(tr("Read about who is behind the Hedgewars Project"));
    78     pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter);
    78     pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter);
    79 
    79 
    80     BtnFeedback = addButton("Feedback", pageLayout, 4, 0, 1, 4, false);
    80     BtnFeedback = addButton(tr("Feedback"), pageLayout, 4, 0, 1, 4, false);
    81     BtnFeedback->setFixedSize(86, 27);
    81     BtnFeedback->setStyleSheet("padding: 5px 10px");
    82     BtnFeedback->setWhatsThis(tr("Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars"));
    82     BtnFeedback->setWhatsThis(tr("Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars"));
    83     pageLayout->setAlignment(BtnFeedback, Qt::AlignHCenter);
    83     pageLayout->setAlignment(BtnFeedback, Qt::AlignHCenter);
    84 
    84 
    85     BtnDataDownload = addButton(tr("Downloadable Content"), pageLayout, 5, 0, 1, 4, false);
    85     BtnDataDownload = addButton(tr("Downloadable Content"), pageLayout, 5, 0, 1, 4, false);
    86     BtnDataDownload->setFixedSize(176, 27);
    86     BtnDataDownload->setStyleSheet("padding: 5px 10px");
    87     BtnDataDownload->setWhatsThis(tr("Access the user created content downloadable from our website"));
    87     BtnDataDownload->setWhatsThis(tr("Access the user created content downloadable from our website"));
    88     pageLayout->setAlignment(BtnDataDownload, Qt::AlignHCenter);
    88     pageLayout->setAlignment(BtnDataDownload, Qt::AlignHCenter);
    89 
    89 
    90     // disable exit button sound
    90     // disable exit button sound
    91     btnBack->isSoundEnabled = false;
    91     btnBack->isSoundEnabled = false;
   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()));
       
   124     connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
   123     // TODO: add signal-forwarding required by (currently missing) encapsulation
   125     // TODO: add signal-forwarding required by (currently missing) encapsulation
   124 }
   126 }
   125 
   127 
   126 PageMain::PageMain(QWidget* parent) : AbstractPage(parent)
   128 PageMain::PageMain(QWidget* parent) : AbstractPage(parent)
   127 {
   129 {
   128     initPage();
   130     initPage();
   129 
   131 
   130     if(frontendEffects) setAttribute(Qt::WA_NoSystemBackground, true);
   132     if(frontendEffects)
       
   133         setAttribute(Qt::WA_NoSystemBackground, true);
   131     mainNote->setOpenExternalLinks(true);
   134     mainNote->setOpenExternalLinks(true);
   132 
   135 
   133     if(!isDevBuild)
   136 #ifdef DEBUG
   134     {
   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!"));
   135         setDefautDescription(QLabel::tr("Tip: ") + randomTip());
   138 #else
   136     }
   139     setDefaultDescription(QLabel::tr("Tip: ") + randomTip());
   137     else
   140 #endif
   138     {
       
   139         setDefautDescription(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!"));
       
   140     }
       
   141 
   141 
   142 }
   142 }
   143 
   143 
   144 QString PageMain::randomTip() const
   144 QString PageMain::randomTip() const
   145 {
   145 {