diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index e7244530..6ed10464 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -83,7 +83,7 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva comboBox_switchLanguage->addItem(QString(tr("Turkish")+" "+QString::fromUtf8("(Tϋrkçe)")),"tr"); #ifdef ANDROID - connect( pushButton_ok, SIGNAL( accepted() ), this, SLOT( isAccepted() ) ); + connect( pushButton_ok, SIGNAL( clicked() ), this, SLOT( isAccepted() ) ); #else connect( buttonBox, SIGNAL( accepted() ), this, SLOT( isAccepted() ) ); #endif diff --git a/src/gui/qt/startwindow.ui b/src/gui/qt/startwindow.ui index 64bc6f78..a3d361fa 100644 --- a/src/gui/qt/startwindow.ui +++ b/src/gui/qt/startwindow.ui @@ -162,6 +162,23 @@ + + + + &5 Logs + + + + :/gfx/text-x-log.png:/gfx/text-x-log.png + + + + 37 + 32 + + + + @@ -198,7 +215,7 @@ 0 0 450 - 24 + 20 @@ -215,7 +232,6 @@ - @@ -309,6 +325,7 @@ + diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 88534dc7..346fa8df 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -83,49 +83,50 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l) this->setStatusBar(0); #ifdef GUI_800x480 -#ifdef ANDROID - this->menubar->hide(); + #ifdef ANDROID + this->menubar->hide(); - //check if custom background picture for the resolution is there. Otherwise create it! - QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str()); - QDesktopWidget dw; - int screenWidth = dw.screenGeometry().width(); - int screenHeight = dw.screenGeometry().height(); - QString customStartWindowBgFileString(UserDataDir+"/startwindowbg_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); - QFile customStartWindowBgFile(customStartWindowBgFileString); - if(customStartWindowBgFile.exists()) { - centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - } else { - QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png"); - pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - if(pix.save(customStartWindowBgFileString)) { + //check if custom background picture for the resolution is there. Otherwise create it! + QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str()); + QDesktopWidget dw; + int screenWidth = dw.screenGeometry().width(); + int screenHeight = dw.screenGeometry().height(); + QString customStartWindowBgFileString(UserDataDir+"/startwindowbg_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); + QFile customStartWindowBgFile(customStartWindowBgFileString); + if(customStartWindowBgFile.exists()) { centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); } else { - centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - } + QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png"); + pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + if(pix.save(customStartWindowBgFileString)) { + centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + } else { + centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + } - } - this->showFullScreen(); - - //TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(TRUE) - #ifndef ANDROID_TEST - JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0); - JNIEnv* env; - if (currVM->AttachCurrentThread(&env, NULL)<0) { - qCritical()<<"AttachCurrentThread failed"; - } else { -// jclass jclassApplicationClass = env->FindClass("android/view/View"); -// if (jclassApplicationClass) { -// env->SetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"KEEP_SCREEN_ON", "I"), 1); -// } - currVM->DetachCurrentThread(); } + this->showFullScreen(); + + //TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(TRUE) + #ifndef ANDROID_TEST + JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0); + JNIEnv* env; + if (currVM->AttachCurrentThread(&env, NULL)<0) { + qCritical()<<"AttachCurrentThread failed"; + } else { + // jclass jclassApplicationClass = env->FindClass("android/view/View"); + // if (jclassApplicationClass) { + // env->SetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"KEEP_SCREEN_ON", "I"), 1); + // } + currVM->DetachCurrentThread(); + } + #endif + #else +// Maemo + this->menubar->hide(); + centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_800x480.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); #endif -#else -// this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }"); - this->menubar->hide(); - centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_800x480.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); -#endif + // All mobile GUI's pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}"); @@ -136,23 +137,22 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l) connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) ); connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); - connect( pushButton_Logs, SIGNAL( clicked() ), this, SLOT( callLogFileDialog() ) ); #else + //Desktop this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:12px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }"); - centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}"); pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}"); pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}"); pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}"); + pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}"); connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) ); connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); #endif - // Dialogs myNewGameDialog = new newGameDialogImpl(this, myConfig); mySelectAvatarDialog = new selectAvatarDialogImpl(this, myConfig); @@ -182,7 +182,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l) connect( pushButton_Create_Network_Game, SIGNAL( clicked() ), this, SLOT( callCreateNetworkGameDialog() ) ); connect( actionJoin_Network_Game, SIGNAL( triggered() ), this, SLOT( callJoinNetworkGameDialog() ) ); connect( pushButton_Join_Network_Game, SIGNAL( clicked() ), this, SLOT( callJoinNetworkGameDialog() ) ); - connect( actionLogs, SIGNAL( triggered() ), this, SLOT( callLogFileDialog() ) ); + connect( pushButton_Logs, SIGNAL( clicked() ), this, SLOT( callLogFileDialog() ) ); connect(this, SIGNAL(signalShowClientDialog()), this, SLOT(showClientDialog()));