From 15e08d632fb305476914041d28395fc16e79efa1 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Sat, 4 Apr 2020 23:11:22 +0200
Subject: Heavy renaming and 0-check fix
---
.gitignore | 1 +
BinaryFun.desktop | 12 -
BinaryFun.pro | 42 --
BinaryFun.pro.user | 799 -----------------------------------
harbour-binaryfun.desktop | 12 +
harbour-binaryfun.pro | 42 ++
icons/108x108/BinaryFun.png | Bin 4099 -> 0 bytes
icons/108x108/harbour-binaryfun.png | Bin 0 -> 4099 bytes
icons/128x128/BinaryFun.png | Bin 5295 -> 0 bytes
icons/128x128/harbour-binaryfun.png | Bin 0 -> 5295 bytes
icons/172x172/BinaryFun.png | Bin 7458 -> 0 bytes
icons/172x172/harbour-binaryfun.png | Bin 0 -> 7458 bytes
icons/86x86/BinaryFun.png | Bin 3363 -> 0 bytes
icons/86x86/harbour-binaryfun.png | Bin 0 -> 3363 bytes
qml/BinaryFun.qml | 10 -
qml/Bit.qml | 6 +-
qml/harbour-binaryfun.qml | 10 +
qml/pages/Game.qml | 16 +-
qml/pages/LeaderBoard.qml | 2 +-
qml/pages/Menu.qml | 4 +-
rpm/BinaryFun.changes.in | 17 -
rpm/BinaryFun.changes.run.in | 25 --
rpm/BinaryFun.spec | 71 ----
rpm/BinaryFun.yaml | 45 --
rpm/harbour-binaryfun.spec | 71 ++++
rpm/harbour-binaryfun.yaml | 45 ++
src/BinaryFun.cpp | 20 -
src/harbour-binaryfun.cpp | 20 +
translations/BinaryFun-de.ts | 56 ---
translations/BinaryFun.ts | 56 ---
translations/harbour-binaryfun-de.ts | 60 +++
translations/harbour-binaryfun.ts | 60 +++
32 files changed, 338 insertions(+), 1164 deletions(-)
create mode 100644 .gitignore
delete mode 100644 BinaryFun.desktop
delete mode 100644 BinaryFun.pro
delete mode 100644 BinaryFun.pro.user
create mode 100644 harbour-binaryfun.desktop
create mode 100644 harbour-binaryfun.pro
delete mode 100644 icons/108x108/BinaryFun.png
create mode 100644 icons/108x108/harbour-binaryfun.png
delete mode 100644 icons/128x128/BinaryFun.png
create mode 100644 icons/128x128/harbour-binaryfun.png
delete mode 100644 icons/172x172/BinaryFun.png
create mode 100644 icons/172x172/harbour-binaryfun.png
delete mode 100644 icons/86x86/BinaryFun.png
create mode 100644 icons/86x86/harbour-binaryfun.png
delete mode 100644 qml/BinaryFun.qml
create mode 100644 qml/harbour-binaryfun.qml
delete mode 100644 rpm/BinaryFun.changes.in
delete mode 100644 rpm/BinaryFun.changes.run.in
delete mode 100644 rpm/BinaryFun.spec
delete mode 100644 rpm/BinaryFun.yaml
create mode 100644 rpm/harbour-binaryfun.spec
create mode 100644 rpm/harbour-binaryfun.yaml
delete mode 100644 src/BinaryFun.cpp
create mode 100644 src/harbour-binaryfun.cpp
delete mode 100644 translations/BinaryFun-de.ts
delete mode 100644 translations/BinaryFun.ts
create mode 100644 translations/harbour-binaryfun-de.ts
create mode 100644 translations/harbour-binaryfun.ts
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8a9d35c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.user
diff --git a/BinaryFun.desktop b/BinaryFun.desktop
deleted file mode 100644
index 2175c0c..0000000
--- a/BinaryFun.desktop
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Type=Application
-X-Nemo-Application-Type=silica-qt5
-Icon=BinaryFun
-Exec=BinaryFun
-Name=Binary Fun
-# translation example:
-# your app name in German locale (de)
-#
-# Remember to comment out the following line, if you do not want to use
-# a different app name in German locale (de).
-Name[de]=Binary Fun
diff --git a/BinaryFun.pro b/BinaryFun.pro
deleted file mode 100644
index 2450f51..0000000
--- a/BinaryFun.pro
+++ /dev/null
@@ -1,42 +0,0 @@
-# NOTICE:
-#
-# Application name defined in TARGET has a corresponding QML filename.
-# If name defined in TARGET is changed, the following needs to be done
-# to match new name:
-# - corresponding QML filename must be changed
-# - desktop icon filename must be changed
-# - desktop filename must be changed
-# - icon definition filename in desktop file must be changed
-# - translation filenames have to be changed
-
-# The name of your application
-TARGET = BinaryFun
-
-CONFIG += sailfishapp
-
-SOURCES += src/BinaryFun.cpp
-
-DISTFILES += qml/BinaryFun.qml \
- qml/Bit.qml \
- qml/cover/CoverPage.qml \
- qml/pages/Game.qml \
- qml/pages/Menu.qml \
- rpm/BinaryFun.changes.in \
- rpm/BinaryFun.changes.run.in \
- rpm/BinaryFun.spec \
- rpm/BinaryFun.yaml \
- translations/*.ts \
- BinaryFun.desktop \
- qml/pages/LeaderBoard.qml
-
-SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
-
-# to disable building translations every time, comment out the
-# following CONFIG line
-CONFIG += sailfishapp_i18n
-
-# German translation is enabled as an example. If you aren't
-# planning to localize your app, remember to comment out the
-# following TRANSLATIONS line. And also do not forget to
-# modify the localized app name in the the .desktop file.
-TRANSLATIONS += translations/BinaryFun-de.ts
diff --git a/BinaryFun.pro.user b/BinaryFun.pro.user
deleted file mode 100644
index d224a80..0000000
--- a/BinaryFun.pro.user
+++ /dev/null
@@ -1,799 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {165e634c-1493-4e4a-a669-d4ec7547e75a}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- true
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
-
- ProjectExplorer.Project.Target.0
-
- SailfishOS-3.2.1.20-armv7hl (in Sailfish OS Build Engine)
- SailfishOS-3.2.1.20-armv7hl (in Sailfish OS Build Engine)
- SailfishOS-3.2.1.20-armv7hl
- 0
- 1
- 0
-
- /home/melvin/code/build-BinaryFun-SailfishOS_3_2_1_20_armv7hl_in_Sailfish_OS_Build_Engine-Debug
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- qmake
-
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 3
- Build
-
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 2
- Clean
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
- true
-
-
- /home/melvin/code/build-BinaryFun-SailfishOS_3_2_1_20_armv7hl_in_Sailfish_OS_Build_Engine-Release
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- qmake
-
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- false
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 3
- Build
-
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 2
- Clean
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
- true
-
-
- /home/melvin/code/build-BinaryFun-SailfishOS_3_2_1_20_armv7hl_in_Sailfish_OS_Build_Engine-Profile
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- qmake
-
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- false
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 3
- Build
-
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 2
- Clean
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
- true
-
- 3
-
-
-
- true
- RPM
-
- QmakeProjectManager.MerRpmBuildStep
-
-
- true
- RPM Validation
-
- QmakeProjectManager.MerRpmValidationStep
-
- 2
- Deploy
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Build RPM Package For Manual Deployment
-
- QmakeProjectManager.MerMb2RpmBuildConfiguration
-
-
-
-
- true
- Prepare Target
-
- QmakeProjectManager.MerPrepareTargetStep
-
-
- true
- Rsync
-
- QmakeProjectManager.MerRsyncDeployStep
-
- 2
- Deploy
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Deploy By Copying Binaries
-
- QmakeProjectManager.MerRSyncDeployConfiguration
-
-
-
-
- true
- Prepare Target
-
- QmakeProjectManager.MerPrepareTargetStep
-
-
- true
- RPM
-
- QmakeProjectManager.MerRpmDeployStep
-
- 2
- Deploy
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Deploy As RPM Package
-
- QmakeProjectManager.MerRpmDeployConfiguration
-
- 3
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- /home/melvin/code/BinaryFunSFOS
- false
- -1
- 3
-
- 1
-
-
- BinaryFun (on Sailfish OS Emulator 3.2.1.20)
- QmakeProjectManager.MerRunConfiguration:/home/melvin/code/BinaryFunSFOS/BinaryFun.pro
- 1
-
- false
-
- 3768
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.Target.1
-
- SailfishOS-3.2.1.20-i486 (in Sailfish OS Build Engine)
- SailfishOS-3.2.1.20-i486 (in Sailfish OS Build Engine)
- SailfishOS-3.2.1.20-i486
- 0
- 2
- 0
-
- /home/melvin/code/build-BinaryFun-SailfishOS_3_2_1_20_i486_in_Sailfish_OS_Build_Engine-Debug
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- qmake
-
- QtProjectManager.QMakeBuildStep
- true
-
- false
- false
- false
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 3
- Build
-
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 2
- Clean
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Debug
- Debug
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
- true
-
-
- /home/melvin/code/build-BinaryFun-SailfishOS_3_2_1_20_i486_in_Sailfish_OS_Build_Engine-Release
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- qmake
-
- QtProjectManager.QMakeBuildStep
- false
-
- false
- false
- false
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 3
- Build
-
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 2
- Clean
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Release
- Release
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
- true
-
-
- /home/melvin/code/build-BinaryFun-SailfishOS_3_2_1_20_i486_in_Sailfish_OS_Build_Engine-Profile
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- qmake
-
- QtProjectManager.QMakeBuildStep
- true
-
- false
- true
- false
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- false
-
-
- false
-
- 3
- Build
-
- ProjectExplorer.BuildSteps.Build
-
-
-
- true
- Start Build Engine
-
- Mer.MerSdkStartStep
-
-
- true
- Make
-
- Qt4ProjectManager.MakeStep
-
- true
- clean
-
- false
-
- 2
- Clean
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- Profile
- Profile
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
- true
-
- 3
-
-
-
- true
- RPM
-
- QmakeProjectManager.MerRpmBuildStep
-
-
- true
- RPM Validation
-
- QmakeProjectManager.MerRpmValidationStep
-
- 2
- Deploy
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Build RPM Package For Manual Deployment
-
- QmakeProjectManager.MerMb2RpmBuildConfiguration
-
-
-
-
- true
- Prepare Target
-
- QmakeProjectManager.MerPrepareTargetStep
-
-
- true
- Rsync
-
- QmakeProjectManager.MerRsyncDeployStep
-
- 2
- Deploy
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Deploy By Copying Binaries
-
- QmakeProjectManager.MerRSyncDeployConfiguration
-
-
-
-
- true
- Prepare Target
-
- QmakeProjectManager.MerPrepareTargetStep
-
-
- true
- RPM
-
- QmakeProjectManager.MerRpmDeployStep
-
- 2
- Deploy
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Deploy As RPM Package
-
- QmakeProjectManager.MerRpmDeployConfiguration
-
- 3
-
-
- dwarf
-
- cpu-cycles
-
-
- 250
- -F
- true
- 4096
- false
- false
- 1000
-
- true
-
- false
- false
- false
- false
- true
- 0.01
- 10
- true
- kcachegrind
- 1
- 25
-
- 1
- true
- false
- true
- valgrind
-
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
-
- /home/melvin/code/BinaryFunSFOS
- false
- -1
- 3
-
- 1
-
-
- BinaryFun (on Sailfish OS Emulator 3.2.1.20)
- QmakeProjectManager.MerRunConfiguration:/home/melvin/code/BinaryFunSFOS/BinaryFun.pro
- 1
-
- false
-
- 3768
- false
- true
- false
- false
- true
-
-
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 2
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 21
-
-
- Version
- 21
-
-
diff --git a/harbour-binaryfun.desktop b/harbour-binaryfun.desktop
new file mode 100644
index 0000000..46734a4
--- /dev/null
+++ b/harbour-binaryfun.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Type=Application
+X-Nemo-Application-Type=silica-qt5
+Icon=harbour-binaryfun
+Exec=harbour-binaryfun
+Name=Binary Fun
+# translation example:
+# your app name in German locale (de)
+#
+# Remember to comment out the following line, if you do not want to use
+# a different app name in German locale (de).
+Name[de]=Binary Fun
diff --git a/harbour-binaryfun.pro b/harbour-binaryfun.pro
new file mode 100644
index 0000000..1cfcb0e
--- /dev/null
+++ b/harbour-binaryfun.pro
@@ -0,0 +1,42 @@
+# NOTICE:
+#
+# Application name defined in TARGET has a corresponding QML filename.
+# If name defined in TARGET is changed, the following needs to be done
+# to match new name:
+# - corresponding QML filename must be changed
+# - desktop icon filename must be changed
+# - desktop filename must be changed
+# - icon definition filename in desktop file must be changed
+# - translation filenames have to be changed
+
+# The name of your application
+TARGET = harbour-binaryfun
+
+CONFIG += sailfishapp
+
+SOURCES += src/harbour-binaryfun.cpp
+
+DISTFILES += qml/harbour-binaryfun.qml \
+ qml/Bit.qml \
+ qml/cover/CoverPage.qml \
+ qml/pages/Game.qml \
+ qml/pages/Menu.qml \
+ rpm/harbour-binaryfun.changes.in \
+ rpm/harbour-binaryfun.changes.run.in \
+ rpm/harbour-binaryfun.spec \
+ rpm/harbour-binaryfun.yaml \
+ translations/*.ts \
+ harbour-binaryfun.desktop \
+ qml/pages/LeaderBoard.qml
+
+SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
+
+# to disable building translations every time, comment out the
+# following CONFIG line
+CONFIG += sailfishapp_i18n
+
+# German translation is enabled as an example. If you aren't
+# planning to localize your app, remember to comment out the
+# following TRANSLATIONS line. And also do not forget to
+# modify the localized app name in the the .desktop file.
+TRANSLATIONS += translations/harbour-binaryfun-de.ts
diff --git a/icons/108x108/BinaryFun.png b/icons/108x108/BinaryFun.png
deleted file mode 100644
index b18994c..0000000
Binary files a/icons/108x108/BinaryFun.png and /dev/null differ
diff --git a/icons/108x108/harbour-binaryfun.png b/icons/108x108/harbour-binaryfun.png
new file mode 100644
index 0000000..b18994c
Binary files /dev/null and b/icons/108x108/harbour-binaryfun.png differ
diff --git a/icons/128x128/BinaryFun.png b/icons/128x128/BinaryFun.png
deleted file mode 100644
index c343e52..0000000
Binary files a/icons/128x128/BinaryFun.png and /dev/null differ
diff --git a/icons/128x128/harbour-binaryfun.png b/icons/128x128/harbour-binaryfun.png
new file mode 100644
index 0000000..c343e52
Binary files /dev/null and b/icons/128x128/harbour-binaryfun.png differ
diff --git a/icons/172x172/BinaryFun.png b/icons/172x172/BinaryFun.png
deleted file mode 100644
index 8e0ebd8..0000000
Binary files a/icons/172x172/BinaryFun.png and /dev/null differ
diff --git a/icons/172x172/harbour-binaryfun.png b/icons/172x172/harbour-binaryfun.png
new file mode 100644
index 0000000..8e0ebd8
Binary files /dev/null and b/icons/172x172/harbour-binaryfun.png differ
diff --git a/icons/86x86/BinaryFun.png b/icons/86x86/BinaryFun.png
deleted file mode 100644
index 05bc92c..0000000
Binary files a/icons/86x86/BinaryFun.png and /dev/null differ
diff --git a/icons/86x86/harbour-binaryfun.png b/icons/86x86/harbour-binaryfun.png
new file mode 100644
index 0000000..05bc92c
Binary files /dev/null and b/icons/86x86/harbour-binaryfun.png differ
diff --git a/qml/BinaryFun.qml b/qml/BinaryFun.qml
deleted file mode 100644
index 9378223..0000000
--- a/qml/BinaryFun.qml
+++ /dev/null
@@ -1,10 +0,0 @@
-import QtQuick 2.0
-import Sailfish.Silica 1.0
-import "pages"
-
-ApplicationWindow
-{
- initialPage: Component { Menu { } }
- cover: Qt.resolvedUrl("cover/CoverPage.qml")
- allowedOrientations: defaultAllowedOrientations
-}
diff --git a/qml/Bit.qml b/qml/Bit.qml
index be6d0f6..6563e73 100644
--- a/qml/Bit.qml
+++ b/qml/Bit.qml
@@ -37,12 +37,16 @@ Loader {
var indices = root.matrix.slice(0, bits);
var transformed = [];
indices.forEach(function(elem) {
- transformed.unshift((pad((parseInt(elem) >>> 0).toString(2), bits))[grid.row - 1]);
+ transformed.push((pad((parseInt(elem) >>> 0).toString(2), bits))[grid.row - 1]);
});
var transformed_num = parseInt(transformed.join(""), 2);
this.text = transformed_num;
root.matrix[index] = transformed_num;
+ if (transformed_num === 0) { // A rather dumb fix.
+ root.check(index - 1);
+ root.check(index - 1);
+ }
} else if (index !== bits){
var num = Math.floor(Math.random() * (Math.pow(2, bits) - 1)) + 1;
this.text = num;
diff --git a/qml/harbour-binaryfun.qml b/qml/harbour-binaryfun.qml
new file mode 100644
index 0000000..9378223
--- /dev/null
+++ b/qml/harbour-binaryfun.qml
@@ -0,0 +1,10 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+import "pages"
+
+ApplicationWindow
+{
+ initialPage: Component { Menu { } }
+ cover: Qt.resolvedUrl("cover/CoverPage.qml")
+ allowedOrientations: defaultAllowedOrientations
+}
diff --git a/qml/pages/Game.qml b/qml/pages/Game.qml
index 8f95f58..3ab037d 100644
--- a/qml/pages/Game.qml
+++ b/qml/pages/Game.qml
@@ -6,7 +6,7 @@ Page {
property int bits: 0 // gets passed by previous page
id: page
- allowedOrientations: Orientation.All
+ allowedOrientations: Orientation.Portrait
SilicaFlickable {
anchors.fill: parent
@@ -47,11 +47,11 @@ Page {
var near = nearest(index);
var current_score = parseInt(info_label.text.substr(0, info_label.text.indexOf('/')))
- if (Number(root.matrix.slice(near, near + bits).join("")).toString() === (root.matrix[near + bits] >>> 0).toString(2)) {
+ if (Number(root.matrix.slice(near, near + bits).join("")).toString() === (root.matrix[near + bits] >>> 0).toString(2) && timer.running) {
correct[near / (bits + 1) - 1] = 1;
info_label.text = current_score + 1 + " / " + root.bits;
} else {
- if (correct[near / (bits + 1) - 1] === 1) {
+ if (correct[near / (bits + 1) - 1] === 1 && timer.running) {
info_label.text = current_score - 1 + " / " + root.bits;
}
@@ -59,10 +59,12 @@ Page {
}
if (correct.filter(function(i) { return i === 1 }).length === bits) {
- info_label.text = "Yeeehaaw!";
- timer_label.text = ((new Date().getTime() - start_time) / 1000) + "s - Not bad!"
- timer.running = false;
- new_game.visible = true;
+ if (timer.running) { // aka still playing
+ info_label.text = "Yeeehaaw!";
+ timer_label.text = ((new Date().getTime() - start_time) / 1000) + "s - " + qsTr("Not bad!");
+ timer.running = false;
+ new_game.visible = true;
+ }
}
}
diff --git a/qml/pages/LeaderBoard.qml b/qml/pages/LeaderBoard.qml
index 93dad0e..eae37b0 100644
--- a/qml/pages/LeaderBoard.qml
+++ b/qml/pages/LeaderBoard.qml
@@ -3,7 +3,7 @@ import Sailfish.Silica 1.0
Page {
id: page
- allowedOrientations: Orientation.All
+ allowedOrientations: Orientation.Portrait
SilicaFlickable {
anchors.fill: parent
diff --git a/qml/pages/Menu.qml b/qml/pages/Menu.qml
index 39de258..1d93a0f 100644
--- a/qml/pages/Menu.qml
+++ b/qml/pages/Menu.qml
@@ -3,7 +3,7 @@ import Sailfish.Silica 1.0
Page {
id: page
- allowedOrientations: Orientation.All
+ allowedOrientations: Orientation.Portrait
SilicaFlickable {
anchors.fill: parent
@@ -53,7 +53,7 @@ Page {
}
Button {
- text: qsTr("Godlike (10 Bit)")
+ text: qsTr("God-like (10 Bit)")
onClicked: {
pageStack.push(Qt.resolvedUrl("Game.qml"), {bits: 10});
}
diff --git a/rpm/BinaryFun.changes.in b/rpm/BinaryFun.changes.in
deleted file mode 100644
index cc8397e..0000000
--- a/rpm/BinaryFun.changes.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Rename this file as BinaryFun.changes to include changelog
-# entries in your RPM file.
-#
-# Add new changelog entries following the format below.
-# Add newest entries to the top of the list.
-# Separate entries from eachother with a blank line.
-#
-# Alternatively, if your changelog is automatically generated (e.g. with
-# the git-change-log command provided with Sailfish OS SDK), create a
-# BinaryFun.changes.run script to let mb2 run the required commands for you.
-
-# * date Author's Name version-release
-# - Summary of changes
-
-* Mon Jan 7 2019 Marvin Borner 0.1.1
-- Fixed bug with decimal zero
-
diff --git a/rpm/BinaryFun.changes.run.in b/rpm/BinaryFun.changes.run.in
deleted file mode 100644
index c7f6475..0000000
--- a/rpm/BinaryFun.changes.run.in
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-#
-# Rename this file as BinaryFun.changes.run to let mb2 automatically
-# generate changelog from well formatted Git commit messages and tag
-# annotations.
-
-git-change-log
-
-# Here are some basic examples how to change from the default behavior. Run
-# git-change-log --help inside the Sailfish OS SDK chroot or build engine to
-# learn all the options git-change-log accepts.
-
-# Use a subset of tags
-#git-change-log --tags refs/tags/my-prefix/*
-
-# Group entries by minor revision, suppress headlines for patch-level revisions
-#git-change-log --dense '/[0-9]\+\.[0-9\+$'
-
-# Trim very old changes
-#git-change-log --since 2014-04-01
-#echo '[ Some changelog entries trimmed for brevity ]'
-
-# Use the subjects (first lines) of tag annotations when no entry would be
-# included for a revision otherwise
-#git-change-log --auto-add-annotations
diff --git a/rpm/BinaryFun.spec b/rpm/BinaryFun.spec
deleted file mode 100644
index 2c75d11..0000000
--- a/rpm/BinaryFun.spec
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Do NOT Edit the Auto-generated Part!
-# Generated by: spectacle version 0.27
-#
-
-Name: BinaryFun
-
-# >> macros
-# << macros
-
-%{!?qtc_qmake:%define qtc_qmake %qmake}
-%{!?qtc_qmake5:%define qtc_qmake5 %qmake5}
-%{!?qtc_make:%define qtc_make make}
-%{?qtc_builddir:%define _builddir %qtc_builddir}
-Summary: An awesome binary game
-Version: 0.1.1
-Release: 1
-Group: Qt/Qt
-License: LICENSE
-URL: http://example.org/
-Source0: %{name}-%{version}.tar.bz2
-Source100: BinaryFun.yaml
-Requires: sailfishsilica-qt5 >= 0.10.9
-BuildRequires: pkgconfig(sailfishapp) >= 1.0.2
-BuildRequires: pkgconfig(Qt5Core)
-BuildRequires: pkgconfig(Qt5Qml)
-BuildRequires: pkgconfig(Qt5Quick)
-BuildRequires: desktop-file-utils
-
-%description
-Just type the given decimal number in binary as fast as possible.
-
-
-%prep
-%setup -q -n %{name}-%{version}
-
-# >> setup
-# << setup
-
-%build
-# >> build pre
-# << build pre
-
-%qtc_qmake5
-
-%qtc_make %{?_smp_mflags}
-
-# >> build post
-# << build post
-
-%install
-rm -rf %{buildroot}
-# >> install pre
-# << install pre
-%qmake5_install
-
-# >> install post
-# << install post
-
-desktop-file-install --delete-original \
- --dir %{buildroot}%{_datadir}/applications \
- %{buildroot}%{_datadir}/applications/*.desktop
-
-%files
-%defattr(-,root,root,-)
-%{_bindir}
-%{_datadir}/%{name}
-%{_datadir}/applications/%{name}.desktop
-%{_datadir}/icons/hicolor/*/apps/%{name}.png
-# >> files
-# << files
diff --git a/rpm/BinaryFun.yaml b/rpm/BinaryFun.yaml
deleted file mode 100644
index ef849f9..0000000
--- a/rpm/BinaryFun.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-Name: BinaryFun
-Summary: An awesome binary game
-Version: 0.1.1
-Release: 1
-# The contents of the Group field should be one of the groups listed here:
-# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
-Group: Qt/Qt
-URL: http://example.org/
-License: LICENSE
-# This must be generated before uploading a package to a remote build service.
-# Usually this line does not need to be modified.
-Sources:
-- '%{name}-%{version}.tar.bz2'
-Description: |
- Just type the given decimal number in binary as fast as possible.
-Configure: none
-# The qtc5 builder inserts macros to allow QtCreator to have fine
-# control over qmake/make execution
-Builder: qtc5
-
-# This section specifies build dependencies that are resolved using pkgconfig.
-# This is the preferred way of specifying build dependencies for your package.
-PkgConfigBR:
- - sailfishapp >= 1.0.2
- - Qt5Core
- - Qt5Qml
- - Qt5Quick
-
-# Build dependencies without a pkgconfig setup can be listed here
-# PkgBR:
-# - package-needed-to-build
-
-# Runtime dependencies which are not automatically detected
-Requires:
- - sailfishsilica-qt5 >= 0.10.9
-
-# All installed files
-Files:
- - '%{_bindir}'
- - '%{_datadir}/%{name}'
- - '%{_datadir}/applications/%{name}.desktop'
- - '%{_datadir}/icons/hicolor/*/apps/%{name}.png'
-
-# For more information about yaml and what's supported in Sailfish OS
-# build system, please see https://wiki.merproject.org/wiki/Spectacle
diff --git a/rpm/harbour-binaryfun.spec b/rpm/harbour-binaryfun.spec
new file mode 100644
index 0000000..b660eb0
--- /dev/null
+++ b/rpm/harbour-binaryfun.spec
@@ -0,0 +1,71 @@
+#
+# Do NOT Edit the Auto-generated Part!
+# Generated by: spectacle version 0.27
+#
+
+Name: harbour-binaryfun
+
+# >> macros
+# << macros
+
+%{!?qtc_qmake:%define qtc_qmake %qmake}
+%{!?qtc_qmake5:%define qtc_qmake5 %qmake5}
+%{!?qtc_make:%define qtc_make make}
+%{?qtc_builddir:%define _builddir %qtc_builddir}
+Summary: An awesome binary game
+Version: 0.1.1
+Release: 1
+Group: Qt/Qt
+License: LICENSE
+URL: http://example.org/
+Source0: %{name}-%{version}.tar.bz2
+Source100: harbour-binaryfun.yaml
+Requires: sailfishsilica-qt5 >= 0.10.9
+BuildRequires: pkgconfig(sailfishapp) >= 1.0.2
+BuildRequires: pkgconfig(Qt5Core)
+BuildRequires: pkgconfig(Qt5Qml)
+BuildRequires: pkgconfig(Qt5Quick)
+BuildRequires: desktop-file-utils
+
+%description
+Just type the given decimal number in binary as fast as possible.
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+# >> setup
+# << setup
+
+%build
+# >> build pre
+# << build pre
+
+%qtc_qmake5
+
+%qtc_make %{?_smp_mflags}
+
+# >> build post
+# << build post
+
+%install
+rm -rf %{buildroot}
+# >> install pre
+# << install pre
+%qmake5_install
+
+# >> install post
+# << install post
+
+desktop-file-install --delete-original \
+ --dir %{buildroot}%{_datadir}/applications \
+ %{buildroot}%{_datadir}/applications/*.desktop
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}
+%{_datadir}/%{name}
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/icons/hicolor/*/apps/%{name}.png
+# >> files
+# << files
diff --git a/rpm/harbour-binaryfun.yaml b/rpm/harbour-binaryfun.yaml
new file mode 100644
index 0000000..042b43d
--- /dev/null
+++ b/rpm/harbour-binaryfun.yaml
@@ -0,0 +1,45 @@
+Name: harbour-binaryfun
+Summary: An awesome binary game
+Version: 0.1.1
+Release: 1
+# The contents of the Group field should be one of the groups listed here:
+# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
+Group: Qt/Qt
+URL: http://example.org/
+License: LICENSE
+# This must be generated before uploading a package to a remote build service.
+# Usually this line does not need to be modified.
+Sources:
+- '%{name}-%{version}.tar.bz2'
+Description: |
+ Just type the given decimal number in binary as fast as possible.
+Configure: none
+# The qtc5 builder inserts macros to allow QtCreator to have fine
+# control over qmake/make execution
+Builder: qtc5
+
+# This section specifies build dependencies that are resolved using pkgconfig.
+# This is the preferred way of specifying build dependencies for your package.
+PkgConfigBR:
+ - sailfishapp >= 1.0.2
+ - Qt5Core
+ - Qt5Qml
+ - Qt5Quick
+
+# Build dependencies without a pkgconfig setup can be listed here
+# PkgBR:
+# - package-needed-to-build
+
+# Runtime dependencies which are not automatically detected
+Requires:
+ - sailfishsilica-qt5 >= 0.10.9
+
+# All installed files
+Files:
+ - '%{_bindir}'
+ - '%{_datadir}/%{name}'
+ - '%{_datadir}/applications/%{name}.desktop'
+ - '%{_datadir}/icons/hicolor/*/apps/%{name}.png'
+
+# For more information about yaml and what's supported in Sailfish OS
+# build system, please see https://wiki.merproject.org/wiki/Spectacle
diff --git a/src/BinaryFun.cpp b/src/BinaryFun.cpp
deleted file mode 100644
index 0891a00..0000000
--- a/src/BinaryFun.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifdef QT_QML_DEBUG
-#include
-#endif
-
-#include
-
-int main(int argc, char *argv[])
-{
- // SailfishApp::main() will display "qml/BinaryFun.qml", if you need more
- // control over initialization, you can use:
- //
- // - SailfishApp::application(int, char *[]) to get the QGuiApplication *
- // - SailfishApp::createView() to get a new QQuickView * instance
- // - SailfishApp::pathTo(QString) to get a QUrl to a resource file
- // - SailfishApp::pathToMainQml() to get a QUrl to the main QML file
- //
- // To display the view, call "show()" (will show fullscreen on device).
-
- return SailfishApp::main(argc, argv);
-}
diff --git a/src/harbour-binaryfun.cpp b/src/harbour-binaryfun.cpp
new file mode 100644
index 0000000..0774653
--- /dev/null
+++ b/src/harbour-binaryfun.cpp
@@ -0,0 +1,20 @@
+#ifdef QT_QML_DEBUG
+#include
+#endif
+
+#include
+
+int main(int argc, char *argv[])
+{
+ // SailfishApp::main() will display "qml/harbour-binaryfun.qml", if you need more
+ // control over initialization, you can use:
+ //
+ // - SailfishApp::application(int, char *[]) to get the QGuiApplication *
+ // - SailfishApp::createView() to get a new QQuickView * instance
+ // - SailfishApp::pathTo(QString) to get a QUrl to a resource file
+ // - SailfishApp::pathToMainQml() to get a QUrl to the main QML file
+ //
+ // To display the view, call "show()" (will show fullscreen on device).
+
+ return SailfishApp::main(argc, argv);
+}
diff --git a/translations/BinaryFun-de.ts b/translations/BinaryFun-de.ts
deleted file mode 100644
index fc5adab..0000000
--- a/translations/BinaryFun-de.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
- CoverPage
-
- Binary Fun
- Binary Fun
-
-
-
- Game
-
- Binary Fun
- Binary Fun
-
-
- Play again!
-
-
-
-
- LeaderBoard
-
- Under Construction!
-
-
-
-
- Menu
-
- Binary Fun
- Binary Fun
-
-
- Easy (4 Bit)
-
-
-
- Medium (6 Bit)
-
-
-
- Hard (8 Bit)
-
-
-
- Very easy (2 Bit)
-
-
-
- Godlike (10 Bit)
-
-
-
-
diff --git a/translations/BinaryFun.ts b/translations/BinaryFun.ts
deleted file mode 100644
index 1201108..0000000
--- a/translations/BinaryFun.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
- CoverPage
-
- Binary Fun
-
-
-
-
- Game
-
- Binary Fun
-
-
-
- Play again!
-
-
-
-
- LeaderBoard
-
- Under Construction!
-
-
-
-
- Menu
-
- Binary Fun
-
-
-
- Easy (4 Bit)
-
-
-
- Medium (6 Bit)
-
-
-
- Hard (8 Bit)
-
-
-
- Very easy (2 Bit)
-
-
-
- Godlike (10 Bit)
-
-
-
-
diff --git a/translations/harbour-binaryfun-de.ts b/translations/harbour-binaryfun-de.ts
new file mode 100644
index 0000000..7b44a02
--- /dev/null
+++ b/translations/harbour-binaryfun-de.ts
@@ -0,0 +1,60 @@
+
+
+
+
+ CoverPage
+
+ Binary Fun
+ Binär-Spaß
+
+
+
+ Game
+
+ Binary Fun
+ Binär-Spaß
+
+
+ Play again!
+ Nochmal!
+
+
+ Not bad!
+ Nicht schlecht!
+
+
+
+ LeaderBoard
+
+ Under Construction!
+ Im Aufbau!
+
+
+
+ Menu
+
+ Binary Fun
+ Binär-Spaß
+
+
+ Easy (4 Bit)
+ Einfach (4 Bit)
+
+
+ Medium (6 Bit)
+ Mittel (6 Bit)
+
+
+ Hard (8 Bit)
+ Schwer (8 Bit)
+
+
+ Very easy (2 Bit)
+ Sehr einfach (2 Bit)
+
+
+ God-like (10 Bit)
+
+
+
+
diff --git a/translations/harbour-binaryfun.ts b/translations/harbour-binaryfun.ts
new file mode 100644
index 0000000..141787e
--- /dev/null
+++ b/translations/harbour-binaryfun.ts
@@ -0,0 +1,60 @@
+
+
+
+
+ CoverPage
+
+ Binary Fun
+
+
+
+
+ Game
+
+ Binary Fun
+
+
+
+ Play again!
+
+
+
+ Not bad!
+
+
+
+
+ LeaderBoard
+
+ Under Construction!
+
+
+
+
+ Menu
+
+ Binary Fun
+
+
+
+ Easy (4 Bit)
+
+
+
+ Medium (6 Bit)
+
+
+
+ Hard (8 Bit)
+
+
+
+ Very easy (2 Bit)
+
+
+
+ God-like (10 Bit)
+
+
+
+
--
cgit v1.2.3