From 4f9a7941def233ebe3d7540474f2e642d604ae43 Mon Sep 17 00:00:00 2001 From: doitux Date: Mon, 28 May 2012 18:45:02 +0200 Subject: [PATCH] android gui tweaks and bugfix for crash on windows/linux --- src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp | 8 ++++---- src/gui/qt/gametable/gametableimpl.cpp | 11 +++++++++++ src/gui/qt/gui_800x480/settingsdialog_800x480.ui | 4 ++-- src/gui/qt/settingsdialog/settingsdialogimpl.cpp | 7 +++++++ src/gui/qt/styles/gametablestylereader.cpp | 4 ++-- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 77b37e3e..013f25d5 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -44,10 +44,10 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); //wait start game message - waitStartGameMsgBox = new MyMessageBox(this); + waitStartGameMsgBox = new MyMessageBox(this); waitStartGameMsgBox->setText(tr("Starting game. Please wait ...")); #ifndef ANDROID - waitRejoinStartGameMsgBox->setWindowModality(Qt::NonModal); + waitStartGameMsgBox->setWindowModality(Qt::NonModal); #endif #ifdef __APPLE__ waitStartGameMsgBox->setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); @@ -55,10 +55,10 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c) waitStartGameMsgBox->setStandardButtons(QMessageBox::NoButton); //wait start game message for rejoin - waitRejoinStartGameMsgBox = new MyMessageBox(this); + waitRejoinStartGameMsgBox = new MyMessageBox(this); waitRejoinStartGameMsgBox->setText(tr("Waiting for the start of the next hand to rejoin the game ...")); #ifndef ANDROID - waitRejoinStartGameMsgBox->setWindowModality(Qt::NonModal); + waitRejoinStartGameMsgBox->setWindowModality(Qt::NonModal); #endif #ifdef __APPLE__ waitRejoinStartGameMsgBox->setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index fca2a45b..b175ef1a 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -303,6 +303,17 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) playerTipLabelArray[8] = label_playerTip8; playerTipLabelArray[9] = label_playerTip9; +#ifdef GUI_800x480 + int j; + for (i=0; ihide(); + } + playerTipLabelArray[i]->hide(); + } + +#endif + // playerNameLabelArray init playerNameLabelArray[0] = label_PlayerName0; playerNameLabelArray[1] = label_PlayerName1; diff --git a/src/gui/qt/gui_800x480/settingsdialog_800x480.ui b/src/gui/qt/gui_800x480/settingsdialog_800x480.ui index 23052d25..557fdf22 100644 --- a/src/gui/qt/gui_800x480/settingsdialog_800x480.ui +++ b/src/gui/qt/gui_800x480/settingsdialog_800x480.ui @@ -315,7 +315,7 @@ - + 4 @@ -807,7 +807,7 @@ p, li { white-space: pre-wrap; } - + 4 diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index 786a1302..ff112869 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -39,6 +39,13 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva #endif setupUi(this); +#ifdef ANDROID + stackedWidget->removeWidget(page_styles); + stackedWidget->removeWidget(page_sound); + listWidget->takeItem(1); + listWidget->takeItem(1); +#endif + if(!SQLITE_LOG) {//temporarely remove sql log features pushButton_deleteLog->hide(); pushButton_saveLogAs->hide(); diff --git a/src/gui/qt/styles/gametablestylereader.cpp b/src/gui/qt/styles/gametablestylereader.cpp index 000a0c4e..40349695 100644 --- a/src/gui/qt/styles/gametablestylereader.cpp +++ b/src/gui/qt/styles/gametablestylereader.cpp @@ -1364,7 +1364,7 @@ void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state) // default case 0: #ifdef GUI_800x480 - bb->setStyleSheet("QPushButton:enabled { background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+"; font-size: 26px} QPushButton:disabled { background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900; font-size: 26px}"); + bb->setStyleSheet("QPushButton:enabled { padding: 10px; background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+"; font-size: 26px} QPushButton:disabled { padding: 10px; background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900; font-size: 26px}"); #else bb->setStyleSheet("QPushButton:enabled { background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+";} QPushButton:disabled { background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900;}"); #endif @@ -1372,7 +1372,7 @@ void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state) // blink case 1: #ifdef GUI_800x480 - bb->setStyleSheet("QPushButton { background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+"; font-size: 26px}"); + bb->setStyleSheet("QPushButton { padding: 10px; background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+"; font-size: 26px}"); #else bb->setStyleSheet("QPushButton { background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+";}"); #endif