summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-04-10 14:12:38 +0200
committerMarvin Borner2020-04-10 14:12:38 +0200
commit71e4befa76e91721df2baeab99fff1b4987b0cdb (patch)
tree2ee575260124119094fdf2eca6b527ccc62b7a99
parent1a7c61dfb1da9de54e276e241495359d40c80ef7 (diff)
Added chess notation converter
-rw-r--r--harbour-sailchess.pro.user48
-rw-r--r--qml/Functions.qml7
2 files changed, 39 insertions, 16 deletions
diff --git a/harbour-sailchess.pro.user b/harbour-sailchess.pro.user
index 7ac6205..42ac1ca 100644
--- a/harbour-sailchess.pro.user
+++ b/harbour-sailchess.pro.user
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.9.1, 2020-04-09T16:11:40. -->
+<!-- Written by QtCreator 4.9.1, 2020-04-10T01:06:38. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@@ -8,7 +8,7 @@
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">0</value>
+ <value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
@@ -63,7 +63,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">SailfishOS-3.2.1.20-armv7hl (in Sailfish OS Build Engine)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">SailfishOS-3.2.1.20-armv7hl</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
- <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_armv7hl_in_Sailfish_OS_Build_Engine-Debug</value>
@@ -278,7 +278,13 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.MerRpmBuildStep</value>
</valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+ <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">RPM Validation</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.MerRpmValidationStep</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
@@ -393,12 +399,14 @@
<value type="int" key="MerRunConfiguration.QmlLiveIpcPort">-1</value>
<value type="int" key="MerRunConfiguration.QmlLiveOptions">3</value>
<value type="QString" key="MerRunConfiguration.QmlLiveTargetWorkspace"></value>
- <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+ <value type="int" key="PE.EnvironmentAspect.Base">1</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
- <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">harbour-sailchess (on Xperia X)</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.MerRunConfiguration:/home/melvin/code/harbour-sailchess/harbour-sailchess.pro</value>
+ <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+ <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+ <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
@@ -419,7 +427,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">SailfishOS-3.2.1.20-i486 (in Sailfish OS Build Engine)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">SailfishOS-3.2.1.20-i486</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
- <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+ <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">2</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/melvin/code/build-harbour-sailchess-SailfishOS_3_2_1_20_i486_in_Sailfish_OS_Build_Engine-Debug</value>
@@ -634,7 +642,13 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.MerRpmBuildStep</value>
</valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+ <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">RPM Validation</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.MerRpmValidationStep</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
@@ -749,12 +763,14 @@
<value type="int" key="MerRunConfiguration.QmlLiveIpcPort">-1</value>
<value type="int" key="MerRunConfiguration.QmlLiveOptions">3</value>
<value type="QString" key="MerRunConfiguration.QmlLiveTargetWorkspace"></value>
- <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+ <value type="int" key="PE.EnvironmentAspect.Base">1</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
- <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">harbour-sailchess (on Sailfish OS Emulator 3.2.1.20)</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QmakeProjectManager.MerRunConfiguration:/home/melvin/code/harbour-sailchess/harbour-sailchess.pro</value>
+ <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+ <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+ <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
diff --git a/qml/Functions.qml b/qml/Functions.qml
index 4b90cc7..dde1cc7 100644
--- a/qml/Functions.qml
+++ b/qml/Functions.qml
@@ -39,7 +39,14 @@ Item {
}
}
+ function convert(i) {
+ const first = (i % 8) + 'a'.charCodeAt(0);
+ const second = (7 - parseInt(i / 8)) + '1'.charCodeAt(0);
+ return String.fromCharCode(first, second);
+ }
+
function move(from, to) {
+ console.log(convert(from) + "-" + convert(to));
board.itemAt(to).piece = board.itemAt(from).piece;
board.itemAt(from).piece = "";
selected = [];