android test fixes
This commit is contained in:
@@ -21,8 +21,10 @@
|
|||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include <QPlatformNativeInterface>
|
#ifndef ANDROID_TEST
|
||||||
#include <jni.h>
|
#include <QPlatformNativeInterface>
|
||||||
|
#include <jni.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||||
|
|||||||
@@ -46,6 +46,13 @@
|
|||||||
#include "logfiledialog.h"
|
#include "logfiledialog.h"
|
||||||
#include "guilog.h"
|
#include "guilog.h"
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
#ifndef ANDROID_TEST
|
||||||
|
#include <QPlatformNativeInterface>
|
||||||
|
#include <jni.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
||||||
@@ -99,6 +106,21 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
|||||||
|
|
||||||
}
|
}
|
||||||
this->showFullScreen();
|
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
|
#else
|
||||||
// this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }");
|
// this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }");
|
||||||
this->menubar->hide();
|
this->menubar->hide();
|
||||||
|
|||||||
Reference in New Issue
Block a user