diff --git a/.gitignore b/.gitignore index 2c2b194..08d9d65 100644 --- a/.gitignore +++ b/.gitignore @@ -37,8 +37,14 @@ ui_*.h Makefile* *build-* -# QtCreator +*.snap +installer/packages/HanoiTowers/parts +installer/packages/HanoiTowers/prime +installer/packages/HanoiTowers/stage +installer/packages/HanoiTowers/data/* +# QtCreator +installer/HanoiTowersInstaller *.autosave # QtCtreator Qml @@ -50,7 +56,6 @@ CMakeLists.txt.user* snap/plugins/__pycache__/ - *.snap \.buildconfig diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..20008bb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "CQtDeployer"] + path = CQtDeployer + url = https://github.com/QuasarApp/Console-QtDeployer.git diff --git a/CQtDeployer b/CQtDeployer new file mode 160000 index 0000000..56411c0 --- /dev/null +++ b/CQtDeployer @@ -0,0 +1 @@ +Subproject commit 56411c0fe893464b68493ca2322c53c4d731a51a diff --git a/Hanoi-Towers.pro b/Hanoi-Towers.pro new file mode 100755 index 0000000..ff9668e --- /dev/null +++ b/Hanoi-Towers.pro @@ -0,0 +1,39 @@ +TEMPLATE = subdirs +CONFIG += ordered + +include($$PWD/installer/deploy/deployFiles.pri) +message( DEPLOY_FILES_MASTER = $$DEPLOY_FILES) + +ENABLE_SNAP = 1 #only linux +ENABLE_INSTALLER = 1 #only desctop + +SUBDIRS += hanoi_towers \ + CQtDeployer + +equals( ENABLE_INSTALLER, 1) { + !android:{ + message(desktopVersion: enabled) + CONFIG(release, debug|release): { + + SUBDIRS += installer + + } else { + message( Selected Debug mode. The installer will not be created ) + + } + } +} + +equals( ENABLE_SNAP, 1) { + !android:{ + message(desktopVersion: enabled) + CONFIG(release, debug|release): { + + SUBDIRS += installer/packages/HanoiTowers/snap.pro + + } else { + message( Selected Debug mode. The snap will not be created ) + + } + } +} diff --git a/source/AndroidManifest.xml b/hanoi_towers/AndroidManifest.xml similarity index 100% rename from source/AndroidManifest.xml rename to hanoi_towers/AndroidManifest.xml diff --git a/source/Help.qml b/hanoi_towers/Help.qml similarity index 100% rename from source/Help.qml rename to hanoi_towers/Help.qml diff --git a/source/PopUp.qml b/hanoi_towers/PopUp.qml similarity index 100% rename from source/PopUp.qml rename to hanoi_towers/PopUp.qml diff --git a/source/SwitchLvl.qml b/hanoi_towers/SwitchLvl.qml similarity index 100% rename from source/SwitchLvl.qml rename to hanoi_towers/SwitchLvl.qml diff --git a/source/Tower.qml b/hanoi_towers/Tower.qml similarity index 100% rename from source/Tower.qml rename to hanoi_towers/Tower.qml diff --git a/source/about.qml b/hanoi_towers/about.qml similarity index 100% rename from source/about.qml rename to hanoi_towers/about.qml diff --git a/source/android/AndroidManifest.xml b/hanoi_towers/android/AndroidManifest.xml similarity index 100% rename from source/android/AndroidManifest.xml rename to hanoi_towers/android/AndroidManifest.xml diff --git a/source/android/build.gradle b/hanoi_towers/android/build.gradle similarity index 100% rename from source/android/build.gradle rename to hanoi_towers/android/build.gradle diff --git a/hanoi_towers/android/gradle.properties b/hanoi_towers/android/gradle.properties new file mode 100644 index 0000000..e784db1 --- /dev/null +++ b/hanoi_towers/android/gradle.properties @@ -0,0 +1,9 @@ +## This file is automatically generated by QtCreator. +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +androidBuildToolsVersion=27.0.2 +androidCompileSdkVersion=23 +buildDir=.build +qt5AndroidDir=/media/E/Qt/5.10.1/android_armv7/src/android/java diff --git a/hanoi_towers/android/gradle.properties~ b/hanoi_towers/android/gradle.properties~ new file mode 100644 index 0000000..e784db1 --- /dev/null +++ b/hanoi_towers/android/gradle.properties~ @@ -0,0 +1,9 @@ +## This file is automatically generated by QtCreator. +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +androidBuildToolsVersion=27.0.2 +androidCompileSdkVersion=23 +buildDir=.build +qt5AndroidDir=/media/E/Qt/5.10.1/android_armv7/src/android/java diff --git a/source/android/gradle/wrapper/gradle-wrapper.jar b/hanoi_towers/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from source/android/gradle/wrapper/gradle-wrapper.jar rename to hanoi_towers/android/gradle/wrapper/gradle-wrapper.jar diff --git a/source/android/gradle/wrapper/gradle-wrapper.properties b/hanoi_towers/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from source/android/gradle/wrapper/gradle-wrapper.properties rename to hanoi_towers/android/gradle/wrapper/gradle-wrapper.properties diff --git a/source/android/gradlew b/hanoi_towers/android/gradlew similarity index 100% rename from source/android/gradlew rename to hanoi_towers/android/gradlew diff --git a/source/android/gradlew.bat b/hanoi_towers/android/gradlew.bat similarity index 100% rename from source/android/gradlew.bat rename to hanoi_towers/android/gradlew.bat diff --git a/hanoi_towers/android/local.properties b/hanoi_towers/android/local.properties new file mode 100644 index 0000000..b37ea25 --- /dev/null +++ b/hanoi_towers/android/local.properties @@ -0,0 +1,6 @@ +## This file is automatically generated by QtCreator. +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +sdk.dir=/media/E/Android/Sdk diff --git a/hanoi_towers/android/local.properties~ b/hanoi_towers/android/local.properties~ new file mode 100644 index 0000000..b37ea25 --- /dev/null +++ b/hanoi_towers/android/local.properties~ @@ -0,0 +1,6 @@ +## This file is automatically generated by QtCreator. +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +sdk.dir=/media/E/Android/Sdk diff --git a/source/android/res/drawable-hdpi/icon.png b/hanoi_towers/android/res/drawable-hdpi/icon.png similarity index 100% rename from source/android/res/drawable-hdpi/icon.png rename to hanoi_towers/android/res/drawable-hdpi/icon.png diff --git a/source/android/res/drawable-ldpi/icon.png b/hanoi_towers/android/res/drawable-ldpi/icon.png similarity index 100% rename from source/android/res/drawable-ldpi/icon.png rename to hanoi_towers/android/res/drawable-ldpi/icon.png diff --git a/source/android/res/drawable-mdpi/icon.png b/hanoi_towers/android/res/drawable-mdpi/icon.png similarity index 100% rename from source/android/res/drawable-mdpi/icon.png rename to hanoi_towers/android/res/drawable-mdpi/icon.png diff --git a/source/android/res/values/libs.xml b/hanoi_towers/android/res/values/libs.xml similarity index 100% rename from source/android/res/values/libs.xml rename to hanoi_towers/android/res/values/libs.xml diff --git a/source/backEnd.cpp b/hanoi_towers/backEnd.cpp similarity index 100% rename from source/backEnd.cpp rename to hanoi_towers/backEnd.cpp diff --git a/source/backEnd.h b/hanoi_towers/backEnd.h similarity index 100% rename from source/backEnd.h rename to hanoi_towers/backEnd.h diff --git a/source/base/BaseButton.qml b/hanoi_towers/base/BaseButton.qml similarity index 100% rename from source/base/BaseButton.qml rename to hanoi_towers/base/BaseButton.qml diff --git a/source/base/BaseRadioButton.qml b/hanoi_towers/base/BaseRadioButton.qml similarity index 100% rename from source/base/BaseRadioButton.qml rename to hanoi_towers/base/BaseRadioButton.qml diff --git a/source/base/BaseText.qml b/hanoi_towers/base/BaseText.qml similarity index 100% rename from source/base/BaseText.qml rename to hanoi_towers/base/BaseText.qml diff --git a/source/base/BoseCheckBox.qml b/hanoi_towers/base/BoseCheckBox.qml similarity index 100% rename from source/base/BoseCheckBox.qml rename to hanoi_towers/base/BoseCheckBox.qml diff --git a/source/base/Theme.qml b/hanoi_towers/base/Theme.qml similarity index 100% rename from source/base/Theme.qml rename to hanoi_towers/base/Theme.qml diff --git a/source/base/utils.js b/hanoi_towers/base/utils.js similarity index 100% rename from source/base/utils.js rename to hanoi_towers/base/utils.js diff --git a/source/game.qml b/hanoi_towers/game.qml similarity index 100% rename from source/game.qml rename to hanoi_towers/game.qml diff --git a/source/hanoi_towers.pro b/hanoi_towers/hanoi_towers.pro similarity index 75% rename from source/hanoi_towers.pro rename to hanoi_towers/hanoi_towers.pro index 508a86b..9b3112f 100644 --- a/source/hanoi_towers.pro +++ b/hanoi_towers/hanoi_towers.pro @@ -8,7 +8,10 @@ SOURCES += main.cpp \ backEnd.cpp RESOURCES += qml.qrc -TARGET=hanoi-towers +TARGET = hanoi-towers + +include($$PWD/../installer/deploy/targetList.pri) +include($$PWD/../installer/deploy/deployFiles.pri) # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = @@ -27,6 +30,12 @@ DEFINES += QT_DEPRECATED_WARNINGS # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +TARGET=HanoiTowers + +QT_DIR = $$dirname(QMAKE_QMAKE) +LUPDATE = $$QT_DIR/lupdate +LRELEASE = $$QT_DIR/lrelease + # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin @@ -47,8 +56,12 @@ DISTFILES += \ android/res/values/libs.xml \ android/build.gradle \ android/gradle/wrapper/gradle-wrapper.properties \ - android/gradlew.bat - + android/gradlew.bat \ + languages/ru.ts \ + languages/ja.ts \ + languages/tr.ts \ + languages/en.ts \ + languages/ua.ts ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android HEADERS += \ @@ -58,7 +71,14 @@ TRANSLATIONS += \ languages/ru.ts \ languages/ja.ts \ languages/tr.ts \ - languages/en.ts + languages/en.ts \ + languages/ua.ts + +commands += "$$LUPDATE $$PWD/hanoi_towers.pro" +commands += "$$LRELEASE $$PWD/hanoi_towers.pro" +for(command, commands) { + system($$command)|error("Failed to run: $$command") +} RC_ICONS = res/icon.ico diff --git a/source/import.qml b/hanoi_towers/import.qml similarity index 100% rename from source/import.qml rename to hanoi_towers/import.qml diff --git a/hanoi_towers/languages/en.qm b/hanoi_towers/languages/en.qm new file mode 100644 index 0000000..8fb8be1 Binary files /dev/null and b/hanoi_towers/languages/en.qm differ diff --git a/source/languages/en.ts b/hanoi_towers/languages/en.ts similarity index 82% rename from source/languages/en.ts rename to hanoi_towers/languages/en.ts index 982d28e..6157696 100644 --- a/source/languages/en.ts +++ b/hanoi_towers/languages/en.ts @@ -12,27 +12,27 @@ Config - + Settings - + Return to main menu - + Standart color - + Random color - + Animation @@ -42,7 +42,7 @@ - + @@ -76,22 +76,22 @@ - + start - + About - + Config - + exit @@ -99,7 +99,7 @@ SwitchLvl - + Start @@ -125,33 +125,33 @@ game - + lvl - + step - + Tower height: - + Return to main menu - + You have passed the level in %0 steps and unlocked level %1 Minimum steps for this lvl: %2 - + You have passed the level in %0 steps. Minimum steps for this lvl: %1 diff --git a/source/languages/ja.qm b/hanoi_towers/languages/ja.qm similarity index 100% rename from source/languages/ja.qm rename to hanoi_towers/languages/ja.qm diff --git a/source/languages/ja.ts b/hanoi_towers/languages/ja.ts similarity index 87% rename from source/languages/ja.ts rename to hanoi_towers/languages/ja.ts index f2ff52f..f613a8b 100644 --- a/source/languages/ja.ts +++ b/hanoi_towers/languages/ja.ts @@ -12,27 +12,27 @@ Config - + Settings 設定 - + Return to main menu メインメニューに戻る - + Standart color クラシックバックライト - + Random color 多色バックライト - + Animation アニメーション @@ -80,22 +80,22 @@ ハノイタワーズ - + start スタート - + About - + Config 設定 - + exit 出口 @@ -103,7 +103,7 @@ SwitchLvl - + Start スタート @@ -146,34 +146,34 @@ - + lvl レベル - + step ステップ - + Tower height: タワーの高さ: - + Return to main menu メインメニューに戻る - + You have passed the level in %0 steps and unlocked level %1 Minimum steps for this lvl: %2 あなたは %0 ステップでレベルを通過し、レベル %1 をロック解除しました このlvlの最小手順:%2 - + You have passed the level in %0 steps. Minimum steps for this lvl: %1 %0ステップでレベルを通過しました。 diff --git a/source/languages/ru.qm b/hanoi_towers/languages/ru.qm similarity index 100% rename from source/languages/ru.qm rename to hanoi_towers/languages/ru.qm diff --git a/source/languages/ru.ts b/hanoi_towers/languages/ru.ts similarity index 86% rename from source/languages/ru.ts rename to hanoi_towers/languages/ru.ts index 2edc17c..4903fad 100644 --- a/source/languages/ru.ts +++ b/hanoi_towers/languages/ru.ts @@ -12,27 +12,27 @@ Config - + Settings Настройки - + Return to main menu Вернутся в главное меню - + Standart color Классическая подсветка - + Random color Разноцветная подсветка - + Animation Анимация @@ -76,22 +76,22 @@ Ханойские Башни - + start Начать - + About об Авторах - + Config Настройки - + exit Выход @@ -99,7 +99,7 @@ SwitchLvl - + Start Начать @@ -142,34 +142,34 @@ об Авторах - + lvl Уровень - + step шаг - + Tower height: Высота башни: - + Return to main menu Вернутся в главное меню - + You have passed the level in %0 steps and unlocked level %1 Minimum steps for this lvl: %2 Вы прошли этот уровень за %0 шагов и разблокировали уровень %1 Минимум шагов на этом уровне: %2 - + You have passed the level in %0 steps. Minimum steps for this lvl: %1 Вы прошли этот уровень за %0 шагов diff --git a/source/languages/tr.qm b/hanoi_towers/languages/tr.qm similarity index 100% rename from source/languages/tr.qm rename to hanoi_towers/languages/tr.qm diff --git a/source/languages/tr.ts b/hanoi_towers/languages/tr.ts similarity index 85% rename from source/languages/tr.ts rename to hanoi_towers/languages/tr.ts index 10631bc..e8012cf 100644 --- a/source/languages/tr.ts +++ b/hanoi_towers/languages/tr.ts @@ -12,27 +12,27 @@ Config - + Settings ayarlar - + Return to main menu Ana menüye dön - + Standart color Klasik arka ışık - + Random color Çok renkli arka ışık - + Animation animasyon @@ -76,22 +76,22 @@ Hanoi Kuleleri - + start başlamak - + About hakkında - + Config ayarlar - + exit çıkış @@ -99,7 +99,7 @@ SwitchLvl - + Start başla @@ -142,34 +142,34 @@ hakkında - + lvl seviye - + step adım - + Tower height: Kule yüksekliği: - + Return to main menu Ana menüye dön - + You have passed the level in %0 steps and unlocked level %1 Minimum steps for this lvl: %2 Seviyeyi %0 adımından geçirdiniz ve %1 kilidini açtınız Bu lvl için minimum adımlar: %2 - + You have passed the level in %0 steps. Minimum steps for this lvl: %1 Seviyeyi %0 adımından geçtiniz. diff --git a/hanoi_towers/languages/ua.qm b/hanoi_towers/languages/ua.qm new file mode 100644 index 0000000..8fb8be1 Binary files /dev/null and b/hanoi_towers/languages/ua.qm differ diff --git a/hanoi_towers/languages/ua.ts b/hanoi_towers/languages/ua.ts new file mode 100644 index 0000000..4a274ef --- /dev/null +++ b/hanoi_towers/languages/ua.ts @@ -0,0 +1,175 @@ + + + + + BaseButton + + + ok + Ок + + + + Config + + + Settings + Налаштування + + + + Return to main menu + Головне меню + + + + Standart color + Стандартний колір + + + + Random color + Випадковий колір + + + + Animation + Анімація + + + + Header + + + + + + + + Main menu + Головне меню + + + + Help + + + Your task is to transfer discs of different sizesfrom the left tower to any other free space.You can only transfer the top drive of the tower.You can not transfer several disks at once and put larger disks on small disks. + Ваше завдання полягає в тому, щоб перенести диски різних розмірів з лівої вежі на будь-яке інше вільне місце. Ви можете перенести тільки верхній привід башти. Ви не можете одночасно передати кілька дисків і розмістити на дисках великі диски. + + + + Do not show again: + Не показувати знову: + + + + Ok + Ок + + + + MainMenu + + + Hanoi Towers + Ханої вежі + + + + start + Почати + + + + About + Про автора + + + + Config + Конфігурація + + + + exit + Вихід + + + + SwitchLvl + + + Start + Почати + + + + about + + + about + Про автора + + + + Product of QuasarApp +* Developers: +* Programmer: Yankovich N. Andrei. +* This game is distributed under the LGPLv3 license. +* Contact: https://github.com/EndrII +* Copyright (C) 2018 Yankovich N. Andrei. + Продукт компанії QuasarApp +* Розробники: +* Програміст: Янкович Н. Андрій. +* Ця гра поширюється під ліцензією LGPLv3. +* Контакт: https://github.com/EndrII +* Авторське право (C) 2018 Янкович Н. Андрій. + + + + game + + + lvl + рівень + + + + step + крок + + + + Tower height: + Висота башти: + + + + Return to main menu + Головне меню + + + + You have passed the level in %0 steps and unlocked level %1 + Minimum steps for this lvl: %2 + Ви пройшли рівень в кроках %0 і розблокували рівень %1 + Мінімальні кроки для цього рівня: %2 + + + + You have passed the level in %0 steps. +Minimum steps for this lvl: %1 + Ви пройшли рівень у %0 кроках. +Мінімальні кроки для цього рівня: %1 + + + + main + + + Hanoi Towers + Ханої вежі + + + diff --git a/source/main.cpp b/hanoi_towers/main.cpp similarity index 100% rename from source/main.cpp rename to hanoi_towers/main.cpp diff --git a/source/main.qml b/hanoi_towers/main.qml similarity index 100% rename from source/main.qml rename to hanoi_towers/main.qml diff --git a/source/menu/Config.qml b/hanoi_towers/menu/Config.qml similarity index 100% rename from source/menu/Config.qml rename to hanoi_towers/menu/Config.qml diff --git a/source/menu/Header.qml b/hanoi_towers/menu/Header.qml similarity index 100% rename from source/menu/Header.qml rename to hanoi_towers/menu/Header.qml diff --git a/source/menu/MainMenu.qml b/hanoi_towers/menu/MainMenu.qml similarity index 100% rename from source/menu/MainMenu.qml rename to hanoi_towers/menu/MainMenu.qml diff --git a/source/plate.qml b/hanoi_towers/plate.qml similarity index 100% rename from source/plate.qml rename to hanoi_towers/plate.qml diff --git a/source/qml.qrc b/hanoi_towers/qml.qrc similarity index 96% rename from source/qml.qrc rename to hanoi_towers/qml.qrc index a7984c8..29aebc3 100644 --- a/source/qml.qrc +++ b/hanoi_towers/qml.qrc @@ -35,5 +35,6 @@ languages/en.qm languages/ja.qm languages/tr.qm + languages/ua.qm diff --git a/source/qtquickcontrols2.conf b/hanoi_towers/qtquickcontrols2.conf similarity index 100% rename from source/qtquickcontrols2.conf rename to hanoi_towers/qtquickcontrols2.conf diff --git a/source/res.qrc b/hanoi_towers/res.qrc similarity index 100% rename from source/res.qrc rename to hanoi_towers/res.qrc diff --git a/source/res/Plate.png b/hanoi_towers/res/Plate.png similarity index 100% rename from source/res/Plate.png rename to hanoi_towers/res/Plate.png diff --git a/source/res/forAndroid (long).png b/hanoi_towers/res/forAndroid (long).png similarity index 100% rename from source/res/forAndroid (long).png rename to hanoi_towers/res/forAndroid (long).png diff --git a/source/res/forAndroid.png b/hanoi_towers/res/forAndroid.png similarity index 100% rename from source/res/forAndroid.png rename to hanoi_towers/res/forAndroid.png diff --git a/source/res/help.jpg b/hanoi_towers/res/help.jpg similarity index 100% rename from source/res/help.jpg rename to hanoi_towers/res/help.jpg diff --git a/source/res/icon.ico b/hanoi_towers/res/icon.ico similarity index 100% rename from source/res/icon.ico rename to hanoi_towers/res/icon.ico diff --git a/source/res/icon.png b/hanoi_towers/res/icon.png similarity index 100% rename from source/res/icon.png rename to hanoi_towers/res/icon.png diff --git a/source/res/iconInstall.png b/hanoi_towers/res/iconInstall.png similarity index 100% rename from source/res/iconInstall.png rename to hanoi_towers/res/iconInstall.png diff --git a/source/res/randomColor.png b/hanoi_towers/res/randomColor.png similarity index 100% rename from source/res/randomColor.png rename to hanoi_towers/res/randomColor.png diff --git a/source/res/standartColor.png b/hanoi_towers/res/standartColor.png similarity index 100% rename from source/res/standartColor.png rename to hanoi_towers/res/standartColor.png diff --git a/source/res/ubuntu.ttf b/hanoi_towers/res/ubuntu.ttf similarity index 100% rename from source/res/ubuntu.ttf rename to hanoi_towers/res/ubuntu.ttf diff --git a/source/res/wood.png b/hanoi_towers/res/wood.png similarity index 100% rename from source/res/wood.png rename to hanoi_towers/res/wood.png diff --git a/installer/config/config.xml b/installer/config/config.xml new file mode 100644 index 0000000..417a5f8 --- /dev/null +++ b/installer/config/config.xml @@ -0,0 +1,16 @@ + + + HanoiTowers + 1.0.0 + HanoiTowers + QuasarApp + @homeDir@/HanoiTowers + true + Uninstall + true + controlScript.js + iconInstaller.png + iconInstaller + iconInstaller + @TargetDir@/AppRun.sh + diff --git a/installer/config/controlScript.js b/installer/config/controlScript.js new file mode 100644 index 0000000..13d3c85 --- /dev/null +++ b/installer/config/controlScript.js @@ -0,0 +1,18 @@ +function Controller() +{ + installer.uninstallationFinished.connect(this, Controller.prototype.uninstallationFinished); + installer.installationFinished.connect(this, Controller.prototype.installationFinished); +} + + +Controller.prototype.uninstallationFinished = function() +{ + +} + + +Controller.prototype.installationFinished = function() +{ + +} + diff --git a/installer/config/iconInstaller.ico b/installer/config/iconInstaller.ico new file mode 100644 index 0000000..99642e1 Binary files /dev/null and b/installer/config/iconInstaller.ico differ diff --git a/installer/config/iconInstaller.png b/installer/config/iconInstaller.png new file mode 100644 index 0000000..d95d0d1 Binary files /dev/null and b/installer/config/iconInstaller.png differ diff --git a/installer/deploy/deploy.pro b/installer/deploy/deploy.pro new file mode 100644 index 0000000..8e69c6e --- /dev/null +++ b/installer/deploy/deploy.pro @@ -0,0 +1,41 @@ +TEMPLATE = aux + +INSTALLER = deployApp + +INPUT = DEPLOY_FILES +deployApp.input = INPUT +deployApp.output = $$INSTALLER + + +QT_DIR = $$dirname(QMAKE_QMAKE) +QML_DIR = $$QT_DIR/../qml + + +WINDEPLY = $$QT_DIR/windeployqt.exe +MACDEPLY = $$QT_DIR/macdeployqt +LINUXDEPLOY = $$PWD/linuxdeployqt-continuous-x86_64.AppImage + +message( QML_DIR = $$QML_DIR) +message( WINDEPLY = $$WINDEPLY) +message( MACDEPLY = $$MACDEPLY) +message( LINUXDEPLOY = $$LINUXDEPLOY) + +win32 { + deployApp.commands += "$$WINDEPLY --qmldir $$QML_DIR $$DEPLOY_FILES" +} + +unix { + deployApp.commands += "$$LINUXDEPLOY --qmldir=$$QML_DIR --qmake=$$QMAKE_QMAKE $$DEPLOY_FILES" +} + +mac { + deployApp.commands += "$$MACDEPLY --qmldir $$QML_DIR $$DEPLOY_FILES" +} + message( deployComand = "$$deployApp.commands") + +commands += "chmod +x $$LINUXDEPLOY" + +for(command, commands) { + system($$command)|error("Failed to run: $$command") +} + diff --git a/installer/deploy/deployFiles.pri b/installer/deploy/deployFiles.pri new file mode 100644 index 0000000..0ddd315 --- /dev/null +++ b/installer/deploy/deployFiles.pri @@ -0,0 +1,8 @@ +TARGET_PATH = $$PWD/../packages/HanoiTowers/data +equals( TEMPLATE, app) { + DESTDIR = $$PWD/../packages/HanoiTowers/data +} + +equals( TEMPLATE, lib) { + DESTDIR = $$PWD/../packages/HanoiTowers/data +} diff --git a/installer/deploy/targetList.pri b/installer/deploy/targetList.pri new file mode 100644 index 0000000..1b649cc --- /dev/null +++ b/installer/deploy/targetList.pri @@ -0,0 +1,17 @@ +# Here you need to specify a list of end targets for each platform. + +# windows +win32 { + TARGET_LIST += HanoiTowers.exe +} + +# linux +# by default installer create shortcut for last binary file of the list +unix { + TARGET_LIST += HanoiTowers +} + +# os X +macx { + TARGET_LIST += HanoiTowers +} diff --git a/installer/installer.pro b/installer/installer.pro new file mode 100644 index 0000000..d47040f --- /dev/null +++ b/installer/installer.pro @@ -0,0 +1,90 @@ +include($$PWD/deploy/targetList.pri) +include($$PWD/deploy/deployFiles.pri) + + +TEMPLATE = aux + +INSTALLER = installerApp + +INPUT = $$PWD/config/config.xml $$PWD/packages +installerApp.input = INPUT +installerApp.output = $$INSTALLER + +QT_DIR = $$dirname(QMAKE_QMAKE) +LUPDATE = $$QT_DIR/lupdate +LRELEASE = $$QT_DIR/lrelease + +OUT_FILE = HanoiTowersInstaller + +QT_DIR = $$dirname(QMAKE_QMAKE) +QML_DIR = $$PWD/../hanoi_towers + + +WINDEPLY = $$QT_DIR/windeployqt.exe +MACDEPLY = $$QT_DIR/macdeployqt +LINUXDEPLOY = $$PWD/../CQtDeployer/build/CQtDeployer + +message( QML_DIR = $$QML_DIR) +message( WINDEPLY = $$WINDEPLY) +message( MACDEPLY = $$MACDEPLY) +message( LINUXDEPLOY = $$LINUXDEPLOY) + +win32 { + OUT_FILE = HanoiTowersInstaller.exe + LUPDATE = $$QT_DIR/lupdate.exe + LRELEASE = $$QT_DIR/lrelease.exe +} + +message( QT_DIR = $$QT_DIR) +message( LUPDATE = $$LUPDATE) +message( LRELEASE = $$LRELEASE) +message( DEPLOY_FILES = $$DEPLOY_FILES) + +# todo get inpot files +win32 { + for(command, TARGET_LIST) { + installerApp.commands += $$WINDEPLY --qmldir $$QML_DIR $$TARGET_PATH/$$command && + } +} + +unix { + for(command, TARGET_LIST) { + installerApp.commands += $$LINUXDEPLOY -bin $$TARGET_PATH/$$command clear -qmlDir $$QML_DIR -qmake $$QMAKE_QMAKE && + } +} + +macx { + for(command, TARGET_LIST) { + installerApp.commands += $$MACDEPLY --qmldir $$QML_DIR $$TARGET_PATH/$$command && + } +} + +installerApp.commands += $$QT_DIR/../../../Tools/QtInstallerFramework/3.0/bin/binarycreator --offline-only -c $$PWD/config/config.xml -p $$PWD/packages $$PWD/$$OUT_FILE --verbose -f +installerApp.CONFIG += target_predeps no_link combine + +message( installComands = "$$installerApp.commands") + +commands += "$$LUPDATE $$PWD/packages/HanoiTowers/meta/installscript.js -ts $$PWD/packages/HanoiTowers/meta/ru.ts" +commands += "$$LRELEASE $$PWD/packages/HanoiTowers/meta/ru.ts" + +for(command, commands) { + system($$command)|error("Failed to run: $$command") +} + + +QMAKE_EXTRA_COMPILERS += installerApp + +DISTFILES += \ + config/controlScript.js \ + config/config.xml \ + README.md \ + config/ru.ts \ + packages/HanoiTowers/meta/installscript.js \ + packages/HanoiTowers/meta/package.xml \ + packages/HanoiTowers/meta/ru.ts + +#unix:extraclean.commands = chmod +x $$PWD/scripts/clear.sh && $$PWD/scripts/clear.sh +#win32:extraclean.commands = $$PWD/scripts/clear.bat; + +#distclean.depends = extraclean +#QMAKE_EXTRA_TARGETS += distclean extraclean diff --git a/installer/packages/HanoiTowers/data/icons/icon.png b/installer/packages/HanoiTowers/data/icons/icon.png new file mode 100644 index 0000000..a6666fe Binary files /dev/null and b/installer/packages/HanoiTowers/data/icons/icon.png differ diff --git a/installer/packages/HanoiTowers/meta/installscript.js b/installer/packages/HanoiTowers/meta/installscript.js new file mode 100644 index 0000000..b309a56 --- /dev/null +++ b/installer/packages/HanoiTowers/meta/installscript.js @@ -0,0 +1,74 @@ +// Constructor +function Component() +{ + + generateTr(); +} + +Component.prototype.createOperations = function() +{ + // call default implementation to actually install README.txt! + component.createOperations(); + + if (!component.isUninstalled()) { + console.log("remove icons!!!"); + + if (systemInfo.kernelType === "winnt") { + console.log("create icons!!! on Windows"); + component.addOperation("Delete", + "@DesktopDir@/@Name@.lnk"); + } + + console.log("remove icons!!!"); + + if (systemInfo.kernelType === "linux") { + + console.log("create icons!!! on LINUX"); + component.addOperation("Delete", + "@HomeDir@/.local/share/applications/@Name@.desktop"); + component.addOperation("Delete", + "@HomeDir@/Desktop/@Name@.desktop"); + + console.log("remove icons!!! on LINUX done"); + } + + } else { + console.log("create icons!!!"); + + if (systemInfo.kernelType === "winnt") { + + console.log("create icons!!! on Windows"); + component.addOperation("CreateShortcut", + "@TargetDir@/@Name@.exe", + "@DesktopDir@/@Name@.lnk"); + } + + console.log("create icons!!!"); + + if (systemInfo.kernelType === "linux") { + console.log("create icons!!! on LINUX"); + component.addOperation("CreateDesktopEntry", + "@HomeDir@/.local/share/applications/@Name@.desktop", + "Version=@Version@\n + Type=Application\n + Terminal=false\n + Exec=@TargetDir@/AppRun.sh\n + Name=@Name@\n + Icon=@TargetDir@/icons/icon.png\n + Name[en_US]=@Name@"); + + console.log("create icons!!! on LINUX done"); + } + } +} + +function generateTr() { + component.setValue("DisplayName", qsTr("HanoiTowers")); + component.setValue("Description", qsTr("Install HanoiTowers")); + +} + +function isNoEmpty(dir){ + var libsArray = installer.findPath("*", [dir]); + return Boolean(libsArray.length); +} diff --git a/installer/packages/HanoiTowers/meta/package.xml b/installer/packages/HanoiTowers/meta/package.xml new file mode 100644 index 0000000..1b31ce5 --- /dev/null +++ b/installer/packages/HanoiTowers/meta/package.xml @@ -0,0 +1,15 @@ + + + from script + from script + 1.0.0 + true + + 2018-08-25 + 200 + true + + + ru.qm + + diff --git a/installer/packages/HanoiTowers/meta/ru.qm b/installer/packages/HanoiTowers/meta/ru.qm new file mode 100644 index 0000000..910694a Binary files /dev/null and b/installer/packages/HanoiTowers/meta/ru.qm differ diff --git a/installer/packages/HanoiTowers/meta/ru.ts b/installer/packages/HanoiTowers/meta/ru.ts new file mode 100644 index 0000000..d908b65 --- /dev/null +++ b/installer/packages/HanoiTowers/meta/ru.ts @@ -0,0 +1,49 @@ + + + + + TargetWidget + + Install dir + Папка установки + + + Select the Installation directory + Выберите директорию установки + + + + installscript + + Virtus Rlo Images + Изображения Virtus ИВС + + + This package contains images for the sidebar of the rolo mode + Этот пакет содержит изображения для боковой панели режима ИВС + + + Choose your target directory. + Выберите целевой каталог. + + + Attention! This directory is already taken, to continue the installation, select another directory! + Внимание! Этот каталог уже создан, чтобы продолжить установку выберите другой каталог! + + + App + Основные компоненнты + + + + HanoiTowers + + + + + Install HanoiTowers + Install SoundBand + установка основного компонента + + + diff --git a/installer/packages/HanoiTowers/runSnap.sh b/installer/packages/HanoiTowers/runSnap.sh new file mode 100755 index 0000000..3c1951b --- /dev/null +++ b/installer/packages/HanoiTowers/runSnap.sh @@ -0,0 +1,15 @@ +#!/bin/sh +OLD_DIR=$PWD +BASE_DIR=$(dirname $0) +TARGET_DIR="$BASE_DIR/../../" +echo "selected target dir $TARGET_DIR" +echo "cd to snapcraft dir $BASE_DIR" +cd $BASE_DIR + +snapcraft + +echo "return to old dir $OLD_DIR" +cd $OLD_DIR + +rm -f $TARGET_DIR/*.snap +mv $BASE_DIR/*.snap $TARGET_DIR diff --git a/installer/packages/HanoiTowers/snap.pro b/installer/packages/HanoiTowers/snap.pro new file mode 100644 index 0000000..09d5e48 --- /dev/null +++ b/installer/packages/HanoiTowers/snap.pro @@ -0,0 +1,41 @@ +include($$PWD/../../deploy/targetList.pri) +include($$PWD/../../deploy/deployFiles.pri) + + +TEMPLATE = aux + +SNAPCRAFT = runSnap.sh + +DESTDIR = $$PWD + +INPUT = $$PWD/snap/snapcraft.yaml +snapApp.input = INPUT +snapApp.output = $$SNAPCRAFT +LINUXDEPLOY = $$PWD/../../../CQtDeployer/build/CQtDeployer + +QT_DIR = $$dirname(QMAKE_QMAKE) +QML_DIR = $$PWD/../../../hanoi_towers + +unix { + message($$DESTDIR); + message($$TARGET_LIST); + + for(command, TARGET_LIST) { + snapApp.commands += $$LINUXDEPLOY -bin $$TARGET_PATH/$$command -qmlDir $$QML_DIR -qmake $$QMAKE_QMAKE && + } + + snapApp.commands += $$DESTDIR/$$SNAPCRAFT + snapApp.CONFIG += target_predeps no_link combine + + message( snapComands = "$$snapApp.commands") +} + + +QMAKE_EXTRA_COMPILERS += snapApp + +DISTFILES += \ + +unix:extraclean.commands = $$SNAPCRAFT clean + +distclean.depends = extraclean +QMAKE_EXTRA_TARGETS += distclean extraclean diff --git a/installer/packages/HanoiTowers/snap/.snapcraft/state b/installer/packages/HanoiTowers/snap/.snapcraft/state new file mode 100644 index 0000000..0278549 --- /dev/null +++ b/installer/packages/HanoiTowers/snap/.snapcraft/state @@ -0,0 +1,4 @@ +!GlobalState +assets: + build-packages: [] + build-snaps: [] diff --git a/snap/forDumpBuild/snapcraft.yaml b/installer/packages/HanoiTowers/snap/forDumpBuild/snapcraft.yaml similarity index 100% rename from snap/forDumpBuild/snapcraft.yaml rename to installer/packages/HanoiTowers/snap/forDumpBuild/snapcraft.yaml diff --git a/snap/gui/HanoiTower.desktop b/installer/packages/HanoiTowers/snap/gui/Hanoi-Tower.desktop.desktop similarity index 91% rename from snap/gui/HanoiTower.desktop rename to installer/packages/HanoiTowers/snap/gui/Hanoi-Tower.desktop.desktop index 0fffd32..2456b14 100755 --- a/snap/gui/HanoiTower.desktop +++ b/installer/packages/HanoiTowers/snap/gui/Hanoi-Tower.desktop.desktop @@ -12,3 +12,4 @@ X-GNOME-Bugzilla-Product=hanoi-towers X-GNOME-Bugzilla-Component=General X-GNOME-Bugzilla-Version=1.5 StartupNotify=true +Name[ru_RU]=Hanoi-Tower.desktop diff --git a/installer/packages/HanoiTowers/snap/snapcraft.yaml b/installer/packages/HanoiTowers/snap/snapcraft.yaml new file mode 100644 index 0000000..f8c250b --- /dev/null +++ b/installer/packages/HanoiTowers/snap/snapcraft.yaml @@ -0,0 +1,59 @@ +name: hanoi-tower +version: '1.5.1snap' +summary: Deploy Qt Project +description: | + The Hanoi Tower is one of the most popular puzzles of the 19th century. | + Three bars are given, on one of which eight rings are strung, the rings differ in size and lie smaller on larger ones.| + The problem is to transfer the pyramid from eight rings for the least number of moves to another rod.| + At a time, only one ring is allowed to carry, and you can not put a larger ring on less.| + +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: data/icons/icon.png + +apps: + hanoi-tower: + command: desktop-launch $SNAP/AppRun.sh + + plugs: [desktop, unity7, home, opengl, x11, wayland, gsettings] + + +parts: + hanoi-tower: + plugin: nil + stage-packages: + - libasn1-8-heimdal + - libgssapi3-heimdal + - libldap-2.4-2 + after: [libsgl, desktop-glib-only, qtlib] + + + qtlib: + plugin: dump + source: data/ + + libsgl: + plugin: nil + stage-packages: + # Here for the plugins-- they're not linked in automatically. + - libx11-xcb1 + - libglu1-mesa + - libxrender1 + - libxi6 + - libegl1-mesa + - fontconfig + - libgl1-mesa-dri + - libxkbcommon0 + - ttf-ubuntu-font-family + - dmz-cursor-theme + - adwaita-icon-theme + - gnome-themes-standard + - shared-mime-info + - libgdk-pixbuf2.0-0 + - libgtk2.0-0 + - xdg-user-dirs + - libxrandr2 + - libwayland-cursor0 + - libwayland-egl1 + - libpq5 diff --git a/snap/static/snapcraft.yaml b/installer/packages/HanoiTowers/snap/static/snapcraft.yaml similarity index 100% rename from snap/static/snapcraft.yaml rename to installer/packages/HanoiTowers/snap/static/snapcraft.yaml diff --git a/snap/plugins/x-qtbuilder.py b/snap/plugins/x-qtbuilder.py deleted file mode 100644 index 860cd44..0000000 --- a/snap/plugins/x-qtbuilder.py +++ /dev/null @@ -1,204 +0,0 @@ -# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- -# -# Author: Marco Trevisan -# Copyright (C) 2017-2018 Canonical Ltd -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import os -import shutil -import snapcraft - -from snapcraft.plugins import make - -class QtBuilderPlugin(make.MakePlugin): - - @classmethod - def schema(cls): - schema = super().schema() - - schema['properties']['configflags'] = { - 'type': 'array', - 'minitems': 1, - 'uniqueItems': False, - 'items': { - 'type': 'string', - }, - 'default': [], - } - - schema['properties']['qt-source-git'] = { - 'type': 'string' - } - - schema['properties']['qt-source-depth'] = { - 'type': 'integer', - 'default': 1 - } - - schema['properties']['qt-version'] = { - 'type': 'string' - } - - schema['properties']['qt-patches-base-url'] = { - 'type': 'string' - } - - schema['properties']['qt-patches-path'] = { - 'type': 'string' - } - - schema['properties']['qt-submodules'] = { - 'type': 'array', - 'minitems': 0, - 'uniqueItems': True, - 'items': { - 'type': 'string', - }, - 'default': [], - } - - schema['properties']['qt-extra-plugins'] = { - 'type': 'array', - 'minitems': 0, - 'uniqueItems': True, - 'items': { - 'type': 'object', - 'minitems': 0, - 'uniqueItems': True, - 'items': { - 'type': 'string', - }, - }, - 'default': [], - } - - schema['properties']['environment'] = { - 'type': 'array', - 'minitems': 0, - 'uniqueItems': True, - 'items': { - 'type': 'object', - 'minitems': 0, - 'uniqueItems': True, - 'items': { - 'type': 'string', - }, - }, - 'default': [], - } - - schema['required'].append('qt-source-git') - - schema['build-properties'].append('configflags') - - return schema - - @classmethod - def get_pull_properties(cls): - return [ - 'qt-version', - 'qt-patches-base-url', - 'qt-patches-path', - 'qt-submodules', - 'qt-extra-plugins', - ] - - def __init__(self, name, options, project): - super().__init__(name, options, project) - self.build_packages.extend(['g++', 'patch', 'perl', 'wget']) - self.options.source_depth = self.options.qt_source_depth - - if self.options.qt_version: - if self.options.qt_version[0] == 'v': - self.options.source_branch = self.options.qt_version - self.options.qt_version = self.options.qt_version[1:] - else: - self.options.source_branch = '.'.join( - self.options.qt_version.split('.')[:-1]) - - - def pull(self): - if not os.path.exists(os.path.join(self.sourcedir, '.git')) or \ - not os.path.exists(os.path.join(self.sourcedir, 'init-repository')): - shutil.rmtree(self.sourcedir, ignore_errors=True) - command = 'git clone {} {}'.format( - self.options.qt_source_git, self.sourcedir).split() - if self.options.source_branch: - command.extend(['--branch', str(self.options.source_branch)]) - if self.options.source_depth: - command.extend(['--depth', str(self.options.source_depth)]) - - self.run(command) - - command = 'perl init-repository --branch -f'.split() - if len(self.options.qt_submodules): - command.extend('--module-subset={}'.format( - ','.join(self.options.qt_submodules)).split()) - self.run(command, cwd=self.sourcedir) - - if self.options.qt_version: - self.run("git submodule foreach git checkout v{}".format( - self.options.qt_version).split(), self.sourcedir) - - patch_file_template = '${{name}}{}.diff'.format( - '_' + self.options.qt_version.replace('.', '_') \ - if self.options.qt_version else '') - - if self.options.qt_patches_base_url: - patch_uri_template = '{}/{}'.format( - self.options.qt_patches_base_url, patch_file_template) - - patch_cmd = 'git submodule foreach -q'.split() + \ - ['[ -e {touch_file} ] || ' \ - 'wget -q -O - {patch_uri_template} | patch -p1 && ' \ - 'touch {touch_file}'.format( - patch_uri_template=patch_uri_template, - touch_file='.snapcraft-qt-patched')] - - self.run(patch_cmd, cwd=self.sourcedir) - - if self.options.qt_patches_path: - patch_path_template = os.path.join( - os.getcwd(), self.options.qt_patches_path, patch_file_template) - - patch_cmd = 'git submodule foreach -q'.split() + \ - ['[ -e {patch} ] && git apply -v3 {patch} || true'.format( - patch=patch_path_template)] - - self.run(patch_cmd, cwd=self.sourcedir) - - for extra_plugin in self.options.qt_extra_plugins: - [framework] = list(extra_plugin) - - final_path = os.path.join(self.sourcedir, 'qtbase', 'src', - 'plugins', framework) - - for repo in extra_plugin[framework]: - repo_path = os.path.basename(repo) - if repo_path.endswith('.git'): - repo_path = repo_path[:-4] - - if not os.path.exists(os.path.join(final_path, repo_path)): - command = 'git clone {}'.format(repo).split() - self.run(command, cwd=final_path) - - def build(self): - env = {} - - for environ in self.options.environment: - [env_name] = list(environ) - env[env_name] = str(environ[env_name]) - - self.run(['./configure'] + self.options.configflags, env=env) - super().build() diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml deleted file mode 100644 index 9f29ca1..0000000 --- a/snap/snapcraft.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: hanoi-tower -version: '1.4.testBuild8' -summary: Hanoi Towers Game -description: | - The Hanoi Tower is one of the most popular puzzles of the 19th century. | - Three bars are given, on one of which eight rings are strung, the rings differ in size and lie smaller on larger ones.| - The problem is to transfer the pyramid from eight rings for the least number of moves to another rod.| - At a time, only one ring is allowed to carry, and you can not put a larger ring on less.| - -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: source/res/icon.png - -apps: - hanoi-tower: - command: qt5-launch opt/hanoi-towers/bin/hanoi-towers -# desktop: usr/share/applications/desc.desktop - plugs: [desktop, home, opengl, x11, wayland, unity7] - - -parts: - hanoi-tower: - plugin: qmake - source: source/ - build-packages: - - qtdeclarative5-dev - stage-packages: - # Here for the plugins-- they're not linked in automatically. - - libqt5gui5 - - libqt5qml5 - - libqt5quick5 - - qml-module-qtquick2 - - qml-module-qtquick-dialogs - - qml-module-qtquick-controls - - qml-module-qtquick-controls2 - - qml-module-qtgraphicaleffects - - qml-module-qtquick-extras - - after: [qt5conf] # A wiki part - - diff --git a/source/languages/en.qm b/source/languages/en.qm deleted file mode 100644 index be651ee..0000000 --- a/source/languages/en.qm +++ /dev/null @@ -1 +0,0 @@ -