From 0e1abc3656bda68d2a159c894b9747759bb5de66 Mon Sep 17 00:00:00 2001 From: doitux Date: Mon, 28 May 2007 18:48:12 +0000 Subject: [PATCH] --- src/gui/qt/mainwindow.ui | 174 ++++++++++++++---- src/gui/qt/mainwindow/mainwindowimpl.cpp | 30 ++- src/gui/qt/mainwindow/mainwindowimpl.h | 3 + src/gui/qt/mainwindow/mylefttabwidget.cpp | 1 + src/gui/qt/mainwindow/mylefttabwidget.h | 1 + .../waitforservertostartgamedialogimpl.cpp | 1 + 6 files changed, 174 insertions(+), 36 deletions(-) diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index b967bd05..94f79566 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -44,9 +44,9 @@ - 221 - 223 - 228 + 20 + 83 + 0 @@ -116,8 +116,8 @@ - 40 - 82 + 20 + 83 0 @@ -125,8 +125,8 @@ - 40 - 82 + 20 + 83 0 @@ -199,9 +199,9 @@ - 221 - 223 - 228 + 20 + 83 + 0 @@ -271,8 +271,8 @@ - 40 - 82 + 20 + 83 0 @@ -280,8 +280,8 @@ - 40 - 82 + 20 + 83 0 @@ -354,9 +354,9 @@ - 221 - 223 - 228 + 20 + 83 + 0 @@ -426,8 +426,8 @@ - 40 - 82 + 20 + 83 0 @@ -435,8 +435,8 @@ - 40 - 82 + 20 + 83 0 @@ -614,8 +614,26 @@ - 40 - 82 + 20 + 83 + 0 + + + + + + + 20 + 83 + 0 + + + + + + + 20 + 83 0 @@ -634,8 +652,26 @@ - 40 - 82 + 20 + 83 + 0 + + + + + + + 20 + 83 + 0 + + + + + + + 20 + 83 0 @@ -654,8 +690,26 @@ - 40 - 82 + 20 + 83 + 0 + + + + + + + 20 + 83 + 0 + + + + + + + 20 + 83 0 @@ -2254,8 +2308,26 @@ - 40 - 82 + 20 + 83 + 0 + + + + + + + 20 + 83 + 0 + + + + + + + 20 + 83 0 @@ -2274,8 +2346,26 @@ - 40 - 82 + 20 + 83 + 0 + + + + + + + 20 + 83 + 0 + + + + + + + 20 + 83 0 @@ -2294,8 +2384,26 @@ - 40 - 82 + 20 + 83 + 0 + + + + + + + 20 + 83 + 0 + + + + + + + 20 + 83 0 diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 879ad8f4..12a04ec0 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -672,8 +672,8 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) { Tools::getRandNumber(0, gameData.numberOfPlayers-1, 1, &tmpDealerPos, 0); startData.startDealerPlayerId = static_cast(tmpDealerPos); - //remove ChatWindow - tab_Chat->hide(); + //some gui modifications + localGameModification(); //Start Game!!! mySession->startLocalGame(gameData, startData); @@ -720,7 +720,11 @@ void mainWindowImpl::callCreateNetworkGameDialog() { if (myStartNetworkGameDialog->result() == QDialog::Accepted ) { + + //some gui modifications + networkGameModification(); myServerGuiInterface->getSession().initiateNetworkServerGame(); + } else { mySession->terminateNetworkClient(); @@ -731,7 +735,7 @@ void mainWindowImpl::callCreateNetworkGameDialog() { } void mainWindowImpl::callJoinNetworkGameDialog() { - + myJoinNetworkGameDialog->exec(); if (myJoinNetworkGameDialog->result() == QDialog::Accepted ) { @@ -761,6 +765,10 @@ void mainWindowImpl::callJoinNetworkGameDialog() { if (myWaitingForServerGameDialog->result() == QDialog::Rejected) { mySession->terminateNetworkClient(); } + else { + //some gui modifications + networkGameModification(); + } } } } @@ -2535,3 +2543,19 @@ void mainWindowImpl::closeEvent(QCloseEvent *event) { event->accept(); } + +void mainWindowImpl::localGameModification() { + + tabWidget_Left->setCurrentIndex(0); + tabWidget_Left->disableTab(1, TRUE); + +} + +void mainWindowImpl::networkGameModification() { + + tabWidget_Left->disableTab(1, FALSE); + tabWidget_Left->setCurrentIndex(1); + textBrowser_Chat->clear(); + +} + diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 0c17d372..f55a0617 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -245,6 +245,9 @@ public slots: void networkStart(boost::shared_ptr game); void closeEvent(QCloseEvent*); + + void localGameModification(); + void networkGameModification(); private: diff --git a/src/gui/qt/mainwindow/mylefttabwidget.cpp b/src/gui/qt/mainwindow/mylefttabwidget.cpp index 0b65b79e..39d0e27e 100644 --- a/src/gui/qt/mainwindow/mylefttabwidget.cpp +++ b/src/gui/qt/mainwindow/mylefttabwidget.cpp @@ -32,6 +32,7 @@ MyLeftTabWidget::~MyLeftTabWidget() void MyLeftTabWidget::startBlinkChatTab() { chatBlinkTimer->start(500); } void MyLeftTabWidget::stopBlinkChatTab() { chatBlinkTimer->stop(); } void MyLeftTabWidget::showDefaultChatTab() { myTabBar->setTabTextColor(1, QColor(240,240,240)); } +void MyLeftTabWidget::disableTab(int tabIndex, bool yesNo) { myTabBar->setTabEnabled(tabIndex, !yesNo); } void MyLeftTabWidget::blinkChatTab() { diff --git a/src/gui/qt/mainwindow/mylefttabwidget.h b/src/gui/qt/mainwindow/mylefttabwidget.h index 4205fb20..87ae1975 100644 --- a/src/gui/qt/mainwindow/mylefttabwidget.h +++ b/src/gui/qt/mainwindow/mylefttabwidget.h @@ -30,6 +30,7 @@ public: void startBlinkChatTab(); void stopBlinkChatTab(); void showDefaultChatTab(); + void disableTab(int tabIndex, bool yesNO); public slots: diff --git a/src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.cpp b/src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.cpp index b8cfaa76..2c757518 100644 --- a/src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.cpp +++ b/src/gui/qt/waitforservertostartgamedialog/waitforservertostartgamedialogimpl.cpp @@ -32,6 +32,7 @@ waitForServerToStartGameDialogImpl::waitForServerToStartGameDialogImpl(QWidget * } void waitForServerToStartGameDialogImpl::refresh(int actionID) { + QTimer::singleShot(1000, this, SLOT(accept())); }