add DLC button to net game room
authorsheepluva
Thu, 03 May 2012 13:25:40 +0200
changeset 7015 08642c7da4a3
parent 7014 c0b32404ef74
child 7016 8b34f46e10c1
add DLC button to net game room
QTfrontend/hwform.cpp
QTfrontend/ui/page/pagedata.cpp
QTfrontend/ui/page/pagenetgame.cpp
QTfrontend/ui/page/pagenetgame.h
--- a/QTfrontend/hwform.cpp	Thu May 03 12:33:08 2012 +0200
+++ b/QTfrontend/hwform.cpp	Thu May 03 13:25:40 2012 +0200
@@ -195,6 +195,9 @@
     connect(ui.pageMain->BtnDataDownload, SIGNAL(clicked()), pageSwitchMapper, SLOT(map()));
     pageSwitchMapper->setMapping(ui.pageMain->BtnDataDownload, ID_PAGE_DATADOWNLOAD);
 
+    connect(ui.pageNetGame, SIGNAL(DLCClicked()), pageSwitchMapper, SLOT(map()));
+    pageSwitchMapper->setMapping(ui.pageNetGame, ID_PAGE_DATADOWNLOAD);
+
     //connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed()));
     //connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked()));
 
--- a/QTfrontend/ui/page/pagedata.cpp	Thu May 03 12:33:08 2012 +0200
+++ b/QTfrontend/ui/page/pagedata.cpp	Thu May 03 13:25:40 2012 +0200
@@ -222,7 +222,10 @@
                 return false;
             }
 
-            m_contentDownloaded = true;
+            if (this->isVisible())
+                m_contentDownloaded = true;
+            else
+                DataManager::instance().reload();
         }
 
         file.close();
--- a/QTfrontend/ui/page/pagenetgame.cpp	Thu May 03 12:33:08 2012 +0200
+++ b/QTfrontend/ui/page/pagenetgame.cpp	Thu May 03 13:25:40 2012 +0200
@@ -63,6 +63,9 @@
 {
     QHBoxLayout * bottomLayout = new QHBoxLayout;
 
+    btnDLC = addButton(tr("DLC"), bottomLayout, 0);
+    btnDLC->setWhatsThis(tr("Downloadable Content"));
+
     leRoomName = new HistoryLineEdit(this,10);
     leRoomName->setMaxLength(60);
     leRoomName->setMinimumWidth(200);
@@ -77,21 +80,23 @@
     BtnGo->setMinimumHeight(50);
 
     bottomLayout->addWidget(leRoomName);
-    BtnUpdate = addButton(QAction::tr("Update"), bottomLayout, 1);
+    BtnUpdate = addButton(QAction::tr("Update"), bottomLayout, 2);
 
     bottomLayout->addStretch();
     bottomLayout->addWidget(BtnGo);
 
-    BtnMaster = addButton(tr("Control"), bottomLayout, 3);
+    BtnMaster = addButton(tr("Control"), bottomLayout, 4);
     bottomLayout->insertStretch(3, 100);
 
-    BtnStart = addButton(QAction::tr("Start"), bottomLayout, 3);
+    BtnStart = addButton(QAction::tr("Start"), bottomLayout, 4);
 
     return bottomLayout;
 }
 
 void PageNetGame::connectSignals()
 {
+    connect(btnDLC, SIGNAL(clicked()), this, SIGNAL(DLCClicked()));
+
     connect(btnSetup, SIGNAL(clicked()), this, SIGNAL(SetupClicked()));
 
     connect(BtnUpdate, SIGNAL(clicked()), this, SLOT(onUpdateClick()));
--- a/QTfrontend/ui/page/pagenetgame.h	Thu May 03 12:33:08 2012 +0200
+++ b/QTfrontend/ui/page/pagenetgame.h	Thu May 03 13:25:40 2012 +0200
@@ -65,6 +65,7 @@
 
     signals:
         void SetupClicked();
+        void DLCClicked();
         void askForUpdateRoomName(const QString &);
 
     private:
@@ -76,6 +77,7 @@
 
         HistoryLineEdit * leRoomName;
         QPushButton * btnSetup;
+        QPushButton * btnDLC;
 };
 
 #endif