Merge pull request #67 from QuasarApp/admod

Admod
This commit is contained in:
Andrei Yankovich 2021-05-11 10:58:02 +03:00 committed by GitHub
commit 95555a215c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 380 additions and 118 deletions

4
.gitignore vendored
View File

@ -53,6 +53,10 @@ installer/packages/HanoiTowers/parts
installer/packages/HanoiTowers/prime
installer/packages/HanoiTowers/stage
installer/packages/HanoiTowers/data/*
HanoiTowers/client/android/src/com/falsinsoft/
HanoiTowers/client/android/aidl/
HanoiTowers/client/android/src/com/google/
.snapcraft
Distro
# QtCreator

3
.gitmodules vendored
View File

@ -16,3 +16,6 @@
[submodule "HanoiTowers/client/Credits"]
path = submodules/Credits
url = https://github.com/QuasarApp/Credits
[submodule "submodules/QtAndroidTools"]
path = submodules/QtAndroidTools
url = https://github.com/QuasarApp/QtAndroidTools.git

View File

@ -11,13 +11,12 @@ project(HanoiTowers)
set(BUILD_SHARED_LIBS ON)
include(submodules/Heart/QuasarAppLib/CMake/QuasarApp.cmake)
include(submodules/Heart/QuasarAppLib/CMake/Version.cmake)
initAll()
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
initAll()
return()
endif()
endif()
@ -28,6 +27,8 @@ endif()
if(ONLINE_FUNCTIONS)
add_definitions(-DONLINE_FUNCTIONS)
else()
set(HEART_SSL OFF)
endif()
if (NOT DEFINED HANOI_TESTS)
@ -45,7 +46,7 @@ if (NOT DEFINED HANOI_SERVER)
set(HANOI_SERVER OFF)
endif()
if (ONLINE_FUNCTIONS)
if ( NOT ONLINE_FUNCTIONS)
set(HANOI_SERVER OFF)
endif()
@ -65,8 +66,8 @@ SET(PRODUCT_VER_Mn 6)
SET(PRODUCT_VER_Re 0)
file(MAKE_DIRECTORY ${TARGET_DIR})
initAll()
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
@ -97,7 +98,35 @@ if (HANOI_CLIENT)
add_subdirectory(submodules/SimpleQmlNotify)
add_subdirectory(submodules/ViewSolutions)
add_subdirectory(submodules/Credits)
if (ANDROID)
set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/HanoiTowers/client/android")
set(QTAT_APP_PERMISSIONS OFF)
set(QTAT_APK_EXPANSION_FILES OFF)
set(QTAT_APK_INFO OFF)
set(QTAT_SCREEN OFF)
set(QTAT_SYSTEM OFF)
set(QTAT_BATTERY_STATE OFF)
set(QTAT_SIGNAL_STRENGTH OFF)
set(QTAT_IMAGES OFF)
set(QTAT_NOTIFICATION OFF)
set(QTAT_ADMOB_BANNER OFF)
set(QTAT_ADMOB_INTERSTITIAL ON)
set(QTAT_ADMOB_REWARDED_VIDEO OFF)
set(QTAT_PLAY_STORE OFF)
set(QTAT_GOOGLE_ACCOUNT OFF)
set(QTAT_GOOGLE_DRIVE OFF)
set(QTAT_SHARING OFF)
set(QTAT_USER_MESSAGING_PLATFORM OFF)
set(QTAT_AUDIO OFF)
add_subdirectory(submodules/QtAndroidTools/QtAndroidTools)
include_directories(submodules/QtAndroidTools/QtAndroidTools)
endif()
add_subdirectory(HanoiTowers/client)
endif()
if (HANOI_SERVER)
@ -105,6 +134,3 @@ if (HANOI_SERVER)
add_subdirectory(HanoiTowers/Server)
endif()

View File

@ -21,5 +21,6 @@
"qif": "./../installer",
"icon": "./../HanoiTowers/client/res/iconInstall.png",
"deb": true,
"zip": true,
"targetDir": "./../Distro"
}

View File

@ -14,8 +14,8 @@
#include "hanoitowersprotockol_global.h"
struct HANOITOWERSPROTOCOL_EXPORT UserPreview: public QH::StreamBase {
explicit UserPreview();
explicit UserPreview(const QString& id);
UserPreview();
UserPreview(const QString& id);
QString id;
QString userName;

View File

@ -49,18 +49,31 @@ if (ANDROID)
Credits
QmlNotyfyService)
find_package(QT NAMES Qt6 Qt5 COMPONENTS AndroidExtras REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS AndroidExtras REQUIRED)
addDeployAPK(${CURRENT_PROJECT} "${CMAKE_CURRENT_LIST_DIR}/android" "digitalface" "${SIGN_PATH}/DigitalFaceMobily.keystore" "${SIGN_STORE_PASSWORD}" "${TARGET_DIR}" "${HANOI_EXTRA_LIBS}")
target_link_libraries(${CURRENT_PROJECT} PRIVATE QtAndroidTools Qt${QT_VERSION_MAJOR}::AndroidExtras)
file(GLOB java_files
"android/src/com/quasarapp/androidtools/*.java"
)
add_custom_target(${name}Android
SOURCES ${java_files}
)
else()
# Desctop deploying
addDeployFromCustomFile("Client" "${CMAKE_SOURCE_DIR}/Deploy/Client.json")
# if (UNIX)
# #addDeployQIF("Client" ${INSTALLER_DIR} ${TARGET_DIR} "${INSTALLER_DIR}/config/configLinux.xml")
# #addDeploySnap("Client" ${TARGET_DIR})
if (UNIX)
#addDeployQIF("Client" ${INSTALLER_DIR} ${TARGET_DIR} "${INSTALLER_DIR}/config/configLinux.xml")
addDeploySnap("Client" ${TARGET_DIR})
# #addReleaseSnap("Client")
#addReleaseSnap("Client")
# endif()
endif()
endif()
#addReleaseQif("Client" ${DATA_DIR} ${TARGET_DIR})

View File

@ -0,0 +1,49 @@
/*
* Copyright (C) 2021-2021 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
#include "activityhandler.h"
#ifdef Q_OS_ANDROID
#include <QAndroidIntent>
const int REQUEST_CODE = 123;
const jint RESULT_OK = QAndroidJniObject::getStaticField<jint>("android/app/Activity", "RESULT_OK");
ActivityHandler *ActivityHandler::m_instance = nullptr;
ActivityHandler::ActivityHandler(QObject *parent) : QObject(parent) {
m_instance = this;
}
void ActivityHandler::showSecondActivity() {
QAndroidIntent activityIntent(QtAndroid::androidActivity().object(),
"org/qtproject/example/activityhandler/CustomActivity");
QtAndroid::startActivity(
activityIntent.handle(), REQUEST_CODE,
[this](int requestCode, int resultCode, const QAndroidJniObject &data) {
activityReceiver(requestCode, resultCode, data);
});
}
void ActivityHandler::activityReceiver(int requestCode,
int resultCode,
const QAndroidJniObject &data) {
if (requestCode == REQUEST_CODE) {
if (resultCode == RESULT_OK) {
const QAndroidJniObject key = QAndroidJniObject::fromString("message");
const QAndroidJniObject message = data.callObjectMethod(
"getStringExtra", "(Ljava/lang/String;)Ljava/lang/String;", key.object());
if (message.isValid())
emit ActivityHandler::instance()->receiveFromActivityResult(message.toString());
} else {
emit ActivityHandler::instance()->receiveFromActivityResult("Rejected!");
}
}
}
#endif

View File

@ -0,0 +1,36 @@
/*
* Copyright (C) 2021-2021 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
#ifndef ACTIVITYHANDLER_H
#define ACTIVITYHANDLER_H
#include <QObject>
#ifdef Q_OS_ANDROID
#include <QtAndroid>
class ActivityHandler : public QObject
{
Q_OBJECT
public:
ActivityHandler(QObject *parent = nullptr);
static ActivityHandler *instance() { return m_instance; }
Q_INVOKABLE void showSecondActivity();
void activityReceiver(int requestCode, int resultCode, const QAndroidJniObject &data);
signals:
void receiveFromActivityResult(const QString &message);
private:
static ActivityHandler *m_instance;
};
#endif
#endif // ACTIVITYHANDLER_H

View File

@ -0,0 +1,11 @@
import QtQuick 2.15
import QtAndroidTools 1.0
QtAndroidAdMobInterstitial {
id: interstitial
unitId: "ca-app-pub-5799112356811682/5211864198"
nonPersonalizedAds: false
onLoading: interstitialState.text = "Loading"
onLoaded: interstitialState.text = "Loaded"
onLoadError: interstitialState.text = "Error " + errorId
}

View File

@ -10,7 +10,9 @@
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="landscape" android:launchMode="singleTop">
<!-- Sample AdMob app ID: ca-app-pub-5799112356811682~1226170116 -->
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-5799112356811682~1226170116"/>
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="com.quasarapp.androidtools.MainActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="landscape" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@ -75,4 +77,7 @@
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
</application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>

View File

@ -18,6 +18,7 @@ apply plugin: 'com.android.application'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.google.android.gms:play-services-ads:19.+'
}
android {
@ -71,6 +72,7 @@ android {
defaultConfig {
resConfig "en"
multiDexEnabled true
minSdkVersion = 22
targetSdkVersion = 30
}

View File

@ -9,3 +9,7 @@ org.gradle.jvmargs=-Xmx2048m
# build with the same inputs. However, over time, the cache size will
# grow. Uncomment the following line to enable it.
#org.gradle.caching=true
android.useAndroidX=true
android.enableJetifier=true

View File

@ -0,0 +1,50 @@
/*
* Copyright (C) 2021-2021 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
package com.quasarapp.androidtools;
import org.qtproject.qt5.android.bindings.QtActivity;
import android.view.View;
public class MainActivity extends QtActivity
{
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
hideSystemUI();
}
}
private void hideSystemUI() {
// Enables regular immersive mode.
// For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE.
// Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE
// Set the content to appear under the system bars so that the
// content doesn't resize when the system bars hide and show.
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
// Hide the nav bar and status bar
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN);
}
// Shows the system bars by removing all the flags
// except for the ones that make the content appear under the system bars.
private void showSystemUI() {
View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
}

View File

@ -220,6 +220,14 @@ QObject *HanoiTowers::selectedUser() {
return &_selectedUser;
}
bool HanoiTowers::isAndroid() const{
#ifdef Q_OS_ANDROID
return true;
#else
return false;
#endif
}
void HanoiTowers::handleChangeName(const QString &) {
emit profileChanged();
}

View File

@ -108,6 +108,8 @@ public:
QObject *bestUser();
QObject *selectedUser();
Q_INVOKABLE bool isAndroid() const;
public slots:

View File

@ -192,12 +192,12 @@
<translation type="vanished">Tower height: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="34"/>
<location filename="../menu/GameStateWidget.qml" line="33"/>
<source>Tower height: </source>
<translation>Tower height: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="63"/>
<location filename="../menu/GameStateWidget.qml" line="62"/>
<source>step </source>
<translation>step </translation>
</message>
@ -266,68 +266,68 @@
<translation>User data updated successful</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="239"/>
<location filename="../hanoitowers.cpp" line="247"/>
<source>login error</source>
<translation>Login error</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="240"/>
<location filename="../hanoitowers.cpp" line="248"/>
<source>Failed to login into online account, please check your password and username</source>
<translation>Failed to login into online account, please check your password and username</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="250"/>
<location filename="../hanoitowers.cpp" line="258"/>
<source>Register online error</source>
<translation>Register online error</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="251"/>
<location filename="../hanoitowers.cpp" line="259"/>
<source>Failed to register this account, if this account was created by you, try to restore it.</source>
<translation>Failed to register this account, if this account was created by you, try to restore it.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="261"/>
<location filename="../hanoitowers.cpp" line="283"/>
<location filename="../hanoitowers.cpp" line="269"/>
<location filename="../hanoitowers.cpp" line="291"/>
<source>Server error</source>
<translation>Server error</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="268"/>
<location filename="../hanoitowers.cpp" line="276"/>
<source>User with this id is not registered. If it you then use please the sigup form.</source>
<translation>User with this id is not registered. If it you then use please the sigup form.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="276"/>
<location filename="../hanoitowers.cpp" line="284"/>
<source>User with this id already registered. If it you then use please the login form.</source>
<translation>User with this id already registered. If it you then use please the login form.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="424"/>
<location filename="../hanoitowers.cpp" line="432"/>
<source>Create user error</source>
<translation>User create error</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="425"/>
<location filename="../hanoitowers.cpp" line="433"/>
<source>Failed to create a new user, The name %0 alredy used.</source>
<translation>Failed to create a new user, This name %0 alredy used.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>Remove online error</source>
<translation>Remove online error</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>current profile not online!</source>
<translation>Current profile is offline!</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Remove Local user</source>
<translation>Remove Local user</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Failed to remove the local user data</source>
<translation>Failed to remove the local user data</translation>
</message>

View File

@ -210,12 +210,12 @@
<translation type="vanished">: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="34"/>
<location filename="../menu/GameStateWidget.qml" line="33"/>
<source>Tower height: </source>
<translation> </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="63"/>
<location filename="../menu/GameStateWidget.qml" line="62"/>
<source>step </source>
<translation> </translation>
</message>
@ -284,68 +284,68 @@
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="239"/>
<location filename="../hanoitowers.cpp" line="247"/>
<source>login error</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="240"/>
<location filename="../hanoitowers.cpp" line="248"/>
<source>Failed to login into online account, please check your password and username</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="250"/>
<location filename="../hanoitowers.cpp" line="258"/>
<source>Register online error</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="251"/>
<location filename="../hanoitowers.cpp" line="259"/>
<source>Failed to register this account, if this account was created by you, try to restore it.</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="261"/>
<location filename="../hanoitowers.cpp" line="283"/>
<location filename="../hanoitowers.cpp" line="269"/>
<location filename="../hanoitowers.cpp" line="291"/>
<source>Server error</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="268"/>
<location filename="../hanoitowers.cpp" line="276"/>
<source>User with this id is not registered. If it you then use please the sigup form.</source>
<translation>IDのユーザーは登録されていません 使使</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="276"/>
<location filename="../hanoitowers.cpp" line="284"/>
<source>User with this id already registered. If it you then use please the login form.</source>
<translation>IDのユーザーはすでに登録されています 使使</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="424"/>
<location filename="../hanoitowers.cpp" line="432"/>
<source>Create user error</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="425"/>
<location filename="../hanoitowers.cpp" line="433"/>
<source>Failed to create a new user, The name %0 alredy used.</source>
<translation> %0 使</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>Remove online error</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>current profile not online!</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Remove Local user</source>
<translation></translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Failed to remove the local user data</source>
<translation></translation>
</message>

View File

@ -217,12 +217,12 @@
<translation type="vanished">Высота башни</translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="34"/>
<location filename="../menu/GameStateWidget.qml" line="33"/>
<source>Tower height: </source>
<translation>Высота башни: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="63"/>
<location filename="../menu/GameStateWidget.qml" line="62"/>
<source>step </source>
<translation>Шаг </translation>
</message>
@ -291,68 +291,68 @@
<translation>Данные пользователя обновлены</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="239"/>
<location filename="../hanoitowers.cpp" line="247"/>
<source>login error</source>
<translation>Ошибка входа</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="240"/>
<location filename="../hanoitowers.cpp" line="248"/>
<source>Failed to login into online account, please check your password and username</source>
<translation>Ошибка входа в онлайн аккаунт, пожалуйста проверте свой логин и пароль</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="250"/>
<location filename="../hanoitowers.cpp" line="258"/>
<source>Register online error</source>
<translation>Ошибка регистрации</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="251"/>
<location filename="../hanoitowers.cpp" line="259"/>
<source>Failed to register this account, if this account was created by you, try to restore it.</source>
<translation>Не удалось зарегистрировать аккаунт, если этот аккаунт был создан вами попробуйте восстановить его.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="261"/>
<location filename="../hanoitowers.cpp" line="283"/>
<location filename="../hanoitowers.cpp" line="269"/>
<location filename="../hanoitowers.cpp" line="291"/>
<source>Server error</source>
<translation>Ошибка сервера</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="268"/>
<location filename="../hanoitowers.cpp" line="276"/>
<source>User with this id is not registered. If it you then use please the sigup form.</source>
<translation>Пользователь с этим id не зарегистрирован. Пожалуйста, заполните форму регистрации.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="276"/>
<location filename="../hanoitowers.cpp" line="284"/>
<source>User with this id already registered. If it you then use please the login form.</source>
<translation>Пользователь с этим id уже зарегистрирован. Если это вы, пожалуйста используйте форму входа.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="424"/>
<location filename="../hanoitowers.cpp" line="432"/>
<source>Create user error</source>
<translation>Ошибка создания пользователя</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="425"/>
<location filename="../hanoitowers.cpp" line="433"/>
<source>Failed to create a new user, The name %0 alredy used.</source>
<translation>Не удалось создать пользователя. Данное имя %0 уже используется</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>Remove online error</source>
<translation>Ошибка удаления онлайн аккаунта</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>current profile not online!</source>
<translation>Текущий профиль не в сети!</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Remove Local user</source>
<translation>Удалить локального.пользователя</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Failed to remove the local user data</source>
<translation>Ошибка удаления локального пользователя</translation>
</message>

View File

@ -218,12 +218,12 @@ Bu seviye için minimum adımlar: %2</translation>
<translation type="vanished">Kule yüksekliği: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="34"/>
<location filename="../menu/GameStateWidget.qml" line="33"/>
<source>Tower height: </source>
<translation>Kule yüksekliği: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="63"/>
<location filename="../menu/GameStateWidget.qml" line="62"/>
<source>step </source>
<translation>adım </translation>
</message>
@ -292,68 +292,68 @@ Bu seviye için minimum adımlar: %2</translation>
<translation>Kullanıcı verileri başarıyla güncellendi</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="239"/>
<location filename="../hanoitowers.cpp" line="247"/>
<source>login error</source>
<translation>sisteme giriş hatası</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="240"/>
<location filename="../hanoitowers.cpp" line="248"/>
<source>Failed to login into online account, please check your password and username</source>
<translation>Çevrimiçi hesaba giriş yapılamadı, lütfen şifrenizi ve kullanıcı adınızı kontrol edin</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="250"/>
<location filename="../hanoitowers.cpp" line="258"/>
<source>Register online error</source>
<translation>Çevrimiçi kayıt hatası</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="251"/>
<location filename="../hanoitowers.cpp" line="259"/>
<source>Failed to register this account, if this account was created by you, try to restore it.</source>
<translation>Bu hesap kaydedilemedi, bu hesap sizin tarafınızdan oluşturulduysa, geri yüklemeyi deneyin.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="261"/>
<location filename="../hanoitowers.cpp" line="283"/>
<location filename="../hanoitowers.cpp" line="269"/>
<location filename="../hanoitowers.cpp" line="291"/>
<source>Server error</source>
<translation>Server hatası</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="268"/>
<location filename="../hanoitowers.cpp" line="276"/>
<source>User with this id is not registered. If it you then use please the sigup form.</source>
<translation>Bu kimliğe sahip kullanıcı kayıtlı değil. Daha sonra kullanırsanız, lütfen kayıt formunu kullanın.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="276"/>
<location filename="../hanoitowers.cpp" line="284"/>
<source>User with this id already registered. If it you then use please the login form.</source>
<translation>Bu kimliğe sahip kullanıcı zaten kayıtlı. Eğer öyleyse, lütfen giriş formunu kullanın.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="424"/>
<location filename="../hanoitowers.cpp" line="432"/>
<source>Create user error</source>
<translation>Kullanıcı hatası oluştur</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="425"/>
<location filename="../hanoitowers.cpp" line="433"/>
<source>Failed to create a new user, The name %0 alredy used.</source>
<translation>Yeni bir kullanıcı oluşturulamadı, %0 adı kullanıldı.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>Remove online error</source>
<translation>Çevrimiçi kullanıcı verilerini kaldırma hatası</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>current profile not online!</source>
<translation>Mevcut profil çevrimdışı!</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Remove Local user</source>
<translation>Yerel kullanıcıyı kaldır</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Failed to remove the local user data</source>
<translation>Yerel kullanıcı verileri kaldırılamadı</translation>
</message>

View File

@ -220,12 +220,12 @@
<translation type="vanished">Висота вежі: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="34"/>
<location filename="../menu/GameStateWidget.qml" line="33"/>
<source>Tower height: </source>
<translation>Висота вежі: </translation>
</message>
<message>
<location filename="../menu/GameStateWidget.qml" line="63"/>
<location filename="../menu/GameStateWidget.qml" line="62"/>
<source>step </source>
<translation>крок </translation>
</message>
@ -294,68 +294,68 @@
<translation>Дані користувачів оновлено успішно</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="239"/>
<location filename="../hanoitowers.cpp" line="247"/>
<source>login error</source>
<translation>Помилка входу</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="240"/>
<location filename="../hanoitowers.cpp" line="248"/>
<source>Failed to login into online account, please check your password and username</source>
<translation>Не вдалося увійти в онлайн-акаунт, перевірте свій пароль та імя користувача</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="250"/>
<location filename="../hanoitowers.cpp" line="258"/>
<source>Register online error</source>
<translation>Помилка реєстрації в Інтернеті</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="251"/>
<location filename="../hanoitowers.cpp" line="259"/>
<source>Failed to register this account, if this account was created by you, try to restore it.</source>
<translation>Не вдалося зареєструвати цей обліковий запис, якщо цей обліковий запис був створений вами, спробуйте відновити його.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="261"/>
<location filename="../hanoitowers.cpp" line="283"/>
<location filename="../hanoitowers.cpp" line="269"/>
<location filename="../hanoitowers.cpp" line="291"/>
<source>Server error</source>
<translation>Помилка серверу</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="268"/>
<location filename="../hanoitowers.cpp" line="276"/>
<source>User with this id is not registered. If it you then use please the sigup form.</source>
<translation>Користувач з цим id не зареєстрований. Якщо ви це використовуєте, будь ласка, будь ласка, зареєструйтесь.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="276"/>
<location filename="../hanoitowers.cpp" line="284"/>
<source>User with this id already registered. If it you then use please the login form.</source>
<translation>Користувач з цим ідентифікатором вже зареєстрований. Якщо ви використовуєте його, будь ласка, увійдіть у форму для входу.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="424"/>
<location filename="../hanoitowers.cpp" line="432"/>
<source>Create user error</source>
<translation>Помилка створення користувача</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="425"/>
<location filename="../hanoitowers.cpp" line="433"/>
<source>Failed to create a new user, The name %0 alredy used.</source>
<translation>Не вдалося створити нового користувача, імя %0 вже використовується.</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>Remove online error</source>
<translation>Помилка видалення онлайн даних користувачів</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="456"/>
<location filename="../hanoitowers.cpp" line="464"/>
<source>current profile not online!</source>
<translation>Поточний профіль офлайн!</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Remove Local user</source>
<translation>Видалити локального користувача</translation>
</message>
<message>
<location filename="../hanoitowers.cpp" line="462"/>
<location filename="../hanoitowers.cpp" line="470"/>
<source>Failed to remove the local user data</source>
<translation>Не вдалося видалити локальні дані користувача</translation>
</message>

View File

@ -12,11 +12,14 @@
#include <QQmlApplicationEngine>
#include <QQmlComponent>
#include <QQmlContext>
#include "activityhandler.h"
#include "hanoitowers.h"
#include <QTranslator>
#include <qmlnotifyservice.h>
#include <credits.h>
#ifdef Q_OS_ANDROID
#include <QtAndroidTools.h>
#endif
int main(int argc, char *argv[])
{
@ -29,7 +32,7 @@ int main(int argc, char *argv[])
QLocale locale = QLocale::system();
if(argc > 1) {
locale = QString::fromLatin1(argv[1]);
locale = QLocale(QString::fromLatin1(argv[1]));
}
if(!QuasarAppUtils::Locales::init(locale, {":/languages/languages/",
@ -51,6 +54,13 @@ int main(int argc, char *argv[])
return 2;
}
#ifdef Q_OS_ANDROID
QtAndroidTools::initializeQmlTools();
ActivityHandler *activityHandler = new ActivityHandler(&app);
engine.rootContext()->setContextProperty(QLatin1String("activityHandler"), activityHandler);
#endif
root->setContextProperty("backEnd", &back);
root->setContextProperty("OnlineStatusQml", QVariant::fromValue(OnlineStatusQml{}));

View File

@ -20,6 +20,25 @@ ApplicationWindow {
width: 1240
height: 720
title: qsTr("Hanoi Towers")
property var admodbanner: null
function createSpriteObjects(url, parent) {
if (!backEnd.isAndroid()) {
return null;
}
const component = Qt.createComponent(url);
return component.createObject(parent);
}
Component.onCompleted: {
const obj = createSpriteObjects("qrc:/admod/AdMobInterstitialAndroid.qml", this);
if (obj) {
admodbanner = obj;
admodbanner.load()
admodbanner.show();
}
}
header: Menu.ToolBarPage {
id: toolBar
@ -47,6 +66,17 @@ ApplicationWindow {
anchors.fill: parent
interactive: false
onCurrentIndexChanged: {
if (currentIndex)
return;
if (admodbanner) {
admodbanner.load()
admodbanner.show();
}
}
background: Item {}
Menu.MainMenu {
@ -142,6 +172,7 @@ ApplicationWindow {
]
}
NotificationServiceView {
anchors.fill: parent;
}

View File

@ -1,6 +1,5 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.15
import QtQuick.Window 2.1
import ".."

View File

@ -3,7 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Dialogs 1.1
import QtQuick.Dialogs 1.2
GridLayout {
id: mainLayout

View File

@ -22,6 +22,7 @@
<file>menu/LocalUsersTable.qml</file>
<file>Background.qml</file>
<file>HelpPage.qml</file>
<file>admod/AdMobInterstitialAndroid.qml</file>
</qresource>
<qresource prefix="/textures">
<file>res/fogBack.png</file>

View File

@ -1,5 +1,5 @@
[Desktop Entry]
Version=1.5.2
Version=1.6.0
Name=Hanoi Towers
Comment=Hanoi Towers Game.
Exec=hanoi-tower
@ -10,6 +10,6 @@ Categories=Games;Application;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=hanoi-tower
X-GNOME-Bugzilla-Component=General
X-GNOME-Bugzilla-Version=1.5.2
X-GNOME-Bugzilla-Version=1.6.0
StartupNotify=true
Name[ru_RU]=Hanoi-Tower
Name[ru_RU]=Ханойские башни

View File

@ -9,16 +9,14 @@ description: |
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
base: core18
icon: installer/packages/HanoiTowers/data/icons/icon.png
base: core20
icon: installer/config/logo.png
apps:
hanoi-tower:
command: desktop-launch $SNAP/HanoiTowers.sh
command: bin/desktop-launch $SNAP/HanoiTowers.sh
plugs: [desktop, unity7, home, opengl, x11, wayland, gsettings]
parts:
hanoi-tower:
plugin: nil
@ -26,13 +24,21 @@ parts:
- libasn1-8-heimdal
- libgssapi3-heimdal
- libldap-2.4-2
after: [libsgl, qtlib]
after: [libsgl, qtlib, desktop-qt5]
override-stage: |
snapcraftctl stage
chmod +x -R "$SNAPCRAFT_STAGE"
desktop-qt5:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: qt
plugin: make
qtlib:
plugin: dump
source: installer/packages/HanoiTowers/data
source: Distro/HanoiTowers.zip
libsgl:
plugin: nil
stage-packages:

@ -1 +1 @@
Subproject commit a765010efa2b4eafcb6a151e7f56ede04d0a9333
Subproject commit afb5e5a40501066673c480adeed3314fe2b6b197

@ -1 +1 @@
Subproject commit 239fc7dae74a4e88fc379162428d3ca5217d2a5a
Subproject commit 755f9565dc1696ced7c40dc2dec998b808b9d942

@ -1 +1 @@
Subproject commit a7b22dac24bd8e2a079d758d4dde9921fef23056
Subproject commit edafe48668f01058e724d763669e3af865566edc

@ -1 +1 @@
Subproject commit 055445ac2b5983125d77bcbe41b4d9a2774287b1
Subproject commit ec0d9a9904e1b48df90c1583de769dab920a5f14

@ -0,0 +1 @@
Subproject commit d3f1c400719858fc22eefa0cbfe9485b8e9666af

@ -1 +1 @@
Subproject commit 099a83ccf6c0a72acfef772884ae08d0594dd489
Subproject commit cdeab90d82ee95edbe86afa1da5ac6dd16cee7bb

@ -1 +1 @@
Subproject commit 220b9b7035bcdc7b1cc79e0f0d8e31f0c10e5359
Subproject commit 5e765f171ae73e18a6fa6c75139cb9e8274373ad