From 87a6cb552fb116fe5ba21515db1a5a627ea60427 Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Sun, 23 Sep 2018 15:31:02 -0400 Subject: [PATCH 1/8] Add timer --- assets/time.svg | 59 ++++++++++++++++++++++++++++++++++++++++ po/mines.neothethird.pot | 40 +++++++++++++-------------- qml/Main.qml | 24 ++++++++++++++++ qml/MinefieldModel.qml | 13 +++++++++ 4 files changed, 116 insertions(+), 20 deletions(-) create mode 100644 assets/time.svg diff --git a/assets/time.svg b/assets/time.svg new file mode 100644 index 0000000..69994af --- /dev/null +++ b/assets/time.svg @@ -0,0 +1,59 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index 10208ab..ba36ce4 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-17 20:56+0000\n" +"POT-Creation-Date: 2018-09-23 19:29+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,7 +40,7 @@ msgstr "" #. TRANSLATORS: Title for dialog confirming if scores should be cleared #. TRANSLATORS: Button in clear scores dialog that clears scores #. TRANSLATORS: Action in high scores page that clears scores -#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:312 +#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:336 msgid "Clear scores" msgstr "" @@ -55,19 +55,19 @@ msgid "Keep existing scores" msgstr "" #. TRANSLATORS: Title of application -#: ../qml/Main.qml:145 ../qml/Main.qml:221 +#: ../qml/Main.qml:145 ../qml/Main.qml:245 msgid "Mines" msgstr "" #. TRANSLATORS: Action on main page that shows game instructions #. TRANSLATORS: Title of page with game instructions -#: ../qml/Main.qml:150 ../qml/Main.qml:200 +#: ../qml/Main.qml:150 ../qml/Main.qml:224 msgid "How to Play" msgstr "" #. TRANSLATORS: Action on main page that shows settings dialog #. TRANSLATORS: Title of page showing settings -#: ../qml/Main.qml:156 ../qml/Main.qml:323 +#: ../qml/Main.qml:156 ../qml/Main.qml:347 msgid "Settings" msgstr "" @@ -76,18 +76,18 @@ msgstr "" msgid "New Game" msgstr "" -#: ../qml/Main.qml:239 +#: ../qml/Main.qml:263 msgid "Version: " msgstr "" #. TRANSLATORS: Short description -#: ../qml/Main.qml:248 +#: ../qml/Main.qml:272 msgid "" "Mines is a puzzle game where the goal is to find the mines in a minefield." msgstr "" #. TRANSLATORS: Game instructions -#: ../qml/Main.qml:258 +#: ../qml/Main.qml:282 msgid "" "The minefield is divided into a grid of squares. Touch a square to check if " "there is a mine there. If no mine is present the square will show the number " @@ -97,7 +97,7 @@ msgid "" msgstr "" #. TRANSLATORS: GPL notice -#: ../qml/Main.qml:268 +#: ../qml/Main.qml:292 msgid "" "This program is free software: you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -109,52 +109,52 @@ msgid "" "License for more details." msgstr "" -#: ../qml/Main.qml:277 +#: ../qml/Main.qml:301 msgid "SOURCE" msgstr "" -#: ../qml/Main.qml:277 +#: ../qml/Main.qml:301 msgid "ISSUES" msgstr "" -#: ../qml/Main.qml:277 +#: ../qml/Main.qml:301 msgid "DONATE" msgstr "" -#: ../qml/Main.qml:287 +#: ../qml/Main.qml:311 msgid "Copyright (c) 2015 Robert Ancell" msgstr "" -#: ../qml/Main.qml:296 +#: ../qml/Main.qml:320 msgid "Copyright (c) 2017 Jan Sprinz " msgstr "" #. TRANSLATORS: Title of page showing high scores -#: ../qml/Main.qml:306 +#: ../qml/Main.qml:330 msgid "High Scores" msgstr "" #. TRANSLATORS: Label beside checkbox setting for controlling vibrations when placing flags -#: ../qml/Main.qml:329 +#: ../qml/Main.qml:353 msgid "Vibrate when placing flags" msgstr "" #. TRANSLATORS: Label above setting to choose the minefield size -#: ../qml/Main.qml:339 +#: ../qml/Main.qml:363 msgid "Minefield size:" msgstr "" #. TRANSLATORS: Setting name for small minefield -#: ../qml/Main.qml:346 +#: ../qml/Main.qml:370 msgid "Small" msgstr "" #. TRANSLATORS: Setting name for large minefield -#: ../qml/Main.qml:349 +#: ../qml/Main.qml:373 msgid "Large" msgstr "" #. TRANSLATORS: Description format for minefield size, %width%, %height% and %nmines% is replaced with the field width, height and number of mines -#: ../qml/Main.qml:355 +#: ../qml/Main.qml:379 msgid "%width%×%height%, %nmines% mines" msgstr "" diff --git a/qml/Main.qml b/qml/Main.qml index 7d62309..4607f4b 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -191,6 +191,30 @@ MainView { use_haptic_feedback: haptic_check.checked } } + + Rectangle { + id: statusBar + width: parent.width + height: units.gu(20) + anchors.bottom: parent.bottom + Image { + id: clockIcon + anchors { left:left.parent; verticalCenter: parent.verticalCenter} + source: "../assets/time.svg" + } + + Item { + Timer { + interval: 500; running: true; repeat: true + //onTriggered: time.text = Date() + onTriggered: time.text = minefield.update_time_elapsed() + } + } + Text { + id: time + anchors { left:clockIcon.right; verticalCenter: parent.verticalCenter} + } + } } Page { diff --git a/qml/MinefieldModel.qml b/qml/MinefieldModel.qml index 8502b01..63de4be 100644 --- a/qml/MinefieldModel.qml +++ b/qml/MinefieldModel.qml @@ -36,6 +36,7 @@ ListModel { property bool completed: false property var start_time property var end_time + property double time_elapsed signal solved() function set_size(n_columns, n_rows, n) { @@ -179,4 +180,16 @@ ListModel { } } } + + function update_time_elapsed() { + if (started) { + time_elapsed = new Date() - start_time + var minutes = Math.floor(time_elapsed / 60000) + var seconds = ((time_elapsed % 60000) / 1000).toFixed(0) + return (seconds == 60 ? (minutes+1) + ":00" : (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds) + } + else { + return "00:00" + } + } } From 851488df7d8859af02e182daa13d5180de1d9612 Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Sun, 23 Sep 2018 17:09:28 -0400 Subject: [PATCH 2/8] Complete French translation --- po/fr.po | 28 ++++++++++++++++++++++------ po/mines.neothethird.pot | 4 ++-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/po/fr.po b/po/fr.po index 7f35e03..03953b8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -79,13 +79,15 @@ msgstr "Nouvelle partie" #: ../qml/Main.qml:242 msgid "Version: " -msgstr "" +msgstr "Version : " #. TRANSLATORS: Short description #: ../qml/Main.qml:251 msgid "" "Mines is a puzzle game where the goal is to find the mines in a minefield." msgstr "" +"Démineur est un jeu de réflexion dont le but est de localiser les mines dans" +"un champ de mines." #. TRANSLATORS: Game instructions #: ../qml/Main.qml:261 @@ -96,6 +98,12 @@ msgid "" "a mine to check next. If you hit a mine it explodes and the game is over. " "You can flag where a mine is by touching and holding that square. Have fun!" msgstr "" +"Le champ de mines est représenté par une grille. Touchez une case pour " +"vérifier si elle cache une mine. S'il n'y a pas de mine, la case dévoilera le " +"nombre de mines autour de la case. Déduisez-en une case qui ne peut pas " +"contenir de mine et dévoilez-la. Si vous touchez une mine, celle-ci explose " +"et la partie est terminée. Vous pouvez marquer une case avec un drapeau en la " +"maintenant appuyée pour indiquer qu'elle contient une mine. Amusez-vous!" #. TRANSLATORS: GPL notice #: ../qml/Main.qml:271 @@ -109,26 +117,34 @@ msgid "" "href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU General Public " "License for more details." msgstr "" +"Ce programme est un logiciel libre : vous pouvez le partager et/ou le modifier" +" en respectant les termes de la licence GNU General Public License telle que " +"publiée par la Free Software Foundation, dans sa 3e version ou (au choix) dans" +" une version postérieure. Ce programme est partagé dans l'espoir qu'il soit " +"utile, mais SANS AUCUNE GARANTIE; sans même une garantie de MARCHANDISATION " +"ni de COMPATIBILITÉ POUR UN USAGE SPÉCIFIQUE. Consultez la GNU General Public " +"License pour plus de détails." #: ../qml/Main.qml:280 msgid "SOURCE" -msgstr "" +msgstr "SOURCE" #: ../qml/Main.qml:280 msgid "ISSUES" -msgstr "" +msgstr "BOGUE" #: ../qml/Main.qml:280 msgid "DONATE" -msgstr "" +msgstr "FAIRE UN DON" #: ../qml/Main.qml:290 msgid "Copyright (c) 2015 Robert Ancell" -msgstr "" +msgstr "Copyright (c) 2015 Robert Ancell" #: ../qml/Main.qml:299 msgid "Copyright (c) 2017 Jan Sprinz " -msgstr "" +msgstr "Copyright (c) 2017 Jan Sprinz " #. TRANSLATORS: Title of page showing high scores #: ../qml/Main.qml:309 diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index b17395f..e67396b 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -1,6 +1,6 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the mines.neothethird package. # FIRST AUTHOR , YEAR. # #, fuzzy @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-09-23 19:47+0000\n" +"POT-Creation-Date: 2018-09-23 21:06+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 675177fac07266bf5a199d2cb1c44cea5d18f7ee Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Mon, 24 Sep 2018 18:44:18 -0400 Subject: [PATCH 3/8] Set timer position --- po/mines.neothethird.pot | 120 +++++++-------------------------------- qml/Main.qml | 61 ++++++++++++++------ 2 files changed, 65 insertions(+), 116 deletions(-) diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index 275f540..5ec8ecc 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -8,11 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -<<<<<<< HEAD -"POT-Creation-Date: 2018-09-23 19:29+0000\n" -======= -"POT-Creation-Date: 2018-09-23 19:47+0000\n" ->>>>>>> master +"POT-Creation-Date: 2018-09-24 22:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -44,11 +40,7 @@ msgstr "" #. TRANSLATORS: Title for dialog confirming if scores should be cleared #. TRANSLATORS: Button in clear scores dialog that clears scores #. TRANSLATORS: Action in high scores page that clears scores -<<<<<<< HEAD -#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:336 -======= -#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:324 ->>>>>>> master +#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:377 msgid "Clear scores" msgstr "" @@ -63,31 +55,19 @@ msgid "Keep existing scores" msgstr "" #. TRANSLATORS: Title of application -<<<<<<< HEAD -#: ../qml/Main.qml:145 ../qml/Main.qml:245 -======= -#: ../qml/Main.qml:147 ../qml/Main.qml:234 ->>>>>>> master +#: ../qml/Main.qml:147 ../qml/Main.qml:287 msgid "Mines" msgstr "" #. TRANSLATORS: Action on main page that shows game instructions #. TRANSLATORS: Title of page with game instructions -<<<<<<< HEAD -#: ../qml/Main.qml:150 ../qml/Main.qml:224 -======= -#: ../qml/Main.qml:151 ../qml/Main.qml:208 ->>>>>>> master +#: ../qml/Main.qml:151 ../qml/Main.qml:261 msgid "How to Play" msgstr "" #. TRANSLATORS: Action on main page that shows settings dialog #. TRANSLATORS: Title of page showing settings -<<<<<<< HEAD -#: ../qml/Main.qml:156 ../qml/Main.qml:347 -======= -#: ../qml/Main.qml:157 ../qml/Main.qml:337 ->>>>>>> master +#: ../qml/Main.qml:157 ../qml/Main.qml:390 msgid "Settings" msgstr "" @@ -96,30 +76,18 @@ msgstr "" msgid "New Game" msgstr "" -<<<<<<< HEAD -#: ../qml/Main.qml:263 -======= -#: ../qml/Main.qml:252 ->>>>>>> master +#: ../qml/Main.qml:305 msgid "Version: " msgstr "" #. TRANSLATORS: Short description -<<<<<<< HEAD -#: ../qml/Main.qml:272 -======= -#: ../qml/Main.qml:261 ->>>>>>> master +#: ../qml/Main.qml:314 msgid "" "Mines is a puzzle game where the goal is to find the mines in a minefield." msgstr "" #. TRANSLATORS: Game instructions -<<<<<<< HEAD -#: ../qml/Main.qml:282 -======= -#: ../qml/Main.qml:271 ->>>>>>> master +#: ../qml/Main.qml:324 msgid "" "The minefield is divided into a grid of squares. Touch a square to check if " "there is a mine there. If no mine is present the square will show the number " @@ -129,11 +97,7 @@ msgid "" msgstr "" #. TRANSLATORS: GPL notice -<<<<<<< HEAD -#: ../qml/Main.qml:292 -======= -#: ../qml/Main.qml:281 ->>>>>>> master +#: ../qml/Main.qml:334 msgid "" "This program is free software: you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -145,96 +109,52 @@ msgid "" "License for more details." msgstr "" -<<<<<<< HEAD -#: ../qml/Main.qml:301 +#: ../qml/Main.qml:343 msgid "SOURCE" msgstr "" -#: ../qml/Main.qml:301 +#: ../qml/Main.qml:343 msgid "ISSUES" msgstr "" -#: ../qml/Main.qml:301 +#: ../qml/Main.qml:343 msgid "DONATE" msgstr "" -#: ../qml/Main.qml:311 -msgid "Copyright (c) 2015 Robert Ancell" -msgstr "" - -#: ../qml/Main.qml:320 -======= -#: ../qml/Main.qml:290 -msgid "SOURCE" -msgstr "" - -#: ../qml/Main.qml:290 -msgid "ISSUES" -msgstr "" - -#: ../qml/Main.qml:290 -msgid "DONATE" -msgstr "" - -#: ../qml/Main.qml:300 +#: ../qml/Main.qml:353 msgid "Copyright (c) 2015 Robert Ancell" msgstr "" -#: ../qml/Main.qml:309 ->>>>>>> master +#: ../qml/Main.qml:362 msgid "Copyright (c) 2017 Jan Sprinz " msgstr "" #. TRANSLATORS: Title of page showing high scores -<<<<<<< HEAD -#: ../qml/Main.qml:330 -======= -#: ../qml/Main.qml:321 ->>>>>>> master +#: ../qml/Main.qml:374 msgid "High Scores" msgstr "" #. TRANSLATORS: Label beside checkbox setting for controlling vibrations when placing flags -<<<<<<< HEAD -#: ../qml/Main.qml:353 -======= -#: ../qml/Main.qml:349 ->>>>>>> master +#: ../qml/Main.qml:402 msgid "Vibrate when placing flags" msgstr "" #. TRANSLATORS: Label above setting to choose the minefield size -<<<<<<< HEAD -#: ../qml/Main.qml:363 -======= -#: ../qml/Main.qml:359 ->>>>>>> master +#: ../qml/Main.qml:412 msgid "Minefield size:" msgstr "" #. TRANSLATORS: Setting name for small minefield -<<<<<<< HEAD -#: ../qml/Main.qml:370 -======= -#: ../qml/Main.qml:366 ->>>>>>> master +#: ../qml/Main.qml:419 msgid "Small" msgstr "" #. TRANSLATORS: Setting name for large minefield -<<<<<<< HEAD -#: ../qml/Main.qml:373 -======= -#: ../qml/Main.qml:369 ->>>>>>> master +#: ../qml/Main.qml:422 msgid "Large" msgstr "" #. TRANSLATORS: Description format for minefield size, %width%, %height% and %nmines% is replaced with the field width, height and number of mines -<<<<<<< HEAD -#: ../qml/Main.qml:379 -======= -#: ../qml/Main.qml:375 ->>>>>>> master +#: ../qml/Main.qml:428 msgid "%width%×%height%, %nmines% mines" msgstr "" diff --git a/qml/Main.qml b/qml/Main.qml index d664f1e..2d5acb3 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -187,7 +187,7 @@ MainView { width: parent.width anchors { top: main_header.bottom - bottom: parent.bottom + bottom: statBar.top } anchors.margins: units.gu(2) MinefieldView { @@ -199,26 +199,55 @@ MainView { } Rectangle { - id: statusBar + id: statBar width: parent.width height: units.gu(20) - anchors.bottom: parent.bottom - Image { - id: clockIcon - anchors { left:left.parent; verticalCenter: parent.verticalCenter} - source: "../assets/time.svg" + anchors { + bottom: parent.bottom } - Item { - Timer { - interval: 500; running: true; repeat: true - //onTriggered: time.text = Date() - onTriggered: time.text = minefield.update_time_elapsed() + Row { + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter: parent.verticalCenter + } + + Image { + id: time_icon + anchors { + verticalCenter: parent.verticalCenter + margins: units.gu(2) + } + source: "../assets/time.svg" + } + Rectangle{ + width: units.gu(8) + height: parent.height + anchors.verticalCenter: parent.verticalCenter + + Item { + // anchors { + // verticalCenter: parent.verticalCenter + // horizontalCenter: parent.horizontalCenter + // margins: units.gu(2) + // } + Timer { + interval: 500; running: true; repeat: true + onTriggered: time.text = minefield.update_time_elapsed() + } + // Text { + // id: time + // } + } + Text { + id: time + transformOrigin: Center + anchors { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + } } - } - Text { - id: time - anchors { left:clockIcon.right; verticalCenter: parent.verticalCenter} } } } From c7ae23ecc93e9f60f585a98acac252d2491d235a Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Mon, 24 Sep 2018 21:30:44 -0400 Subject: [PATCH 4/8] Add mines counter --- po/mines.neothethird.pot | 40 +++++++-------- qml/Main.qml | 104 ++++++++++++++++++++++++++++----------- qml/MinefieldModel.qml | 4 ++ 3 files changed, 98 insertions(+), 50 deletions(-) diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index 5ec8ecc..ef00e20 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-09-24 22:43+0000\n" +"POT-Creation-Date: 2018-09-25 01:28+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,7 +40,7 @@ msgstr "" #. TRANSLATORS: Title for dialog confirming if scores should be cleared #. TRANSLATORS: Button in clear scores dialog that clears scores #. TRANSLATORS: Action in high scores page that clears scores -#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:377 +#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:421 msgid "Clear scores" msgstr "" @@ -55,19 +55,19 @@ msgid "Keep existing scores" msgstr "" #. TRANSLATORS: Title of application -#: ../qml/Main.qml:147 ../qml/Main.qml:287 +#: ../qml/Main.qml:147 ../qml/Main.qml:331 msgid "Mines" msgstr "" #. TRANSLATORS: Action on main page that shows game instructions #. TRANSLATORS: Title of page with game instructions -#: ../qml/Main.qml:151 ../qml/Main.qml:261 +#: ../qml/Main.qml:151 ../qml/Main.qml:305 msgid "How to Play" msgstr "" #. TRANSLATORS: Action on main page that shows settings dialog #. TRANSLATORS: Title of page showing settings -#: ../qml/Main.qml:157 ../qml/Main.qml:390 +#: ../qml/Main.qml:157 ../qml/Main.qml:434 msgid "Settings" msgstr "" @@ -76,18 +76,18 @@ msgstr "" msgid "New Game" msgstr "" -#: ../qml/Main.qml:305 +#: ../qml/Main.qml:349 msgid "Version: " msgstr "" #. TRANSLATORS: Short description -#: ../qml/Main.qml:314 +#: ../qml/Main.qml:358 msgid "" "Mines is a puzzle game where the goal is to find the mines in a minefield." msgstr "" #. TRANSLATORS: Game instructions -#: ../qml/Main.qml:324 +#: ../qml/Main.qml:368 msgid "" "The minefield is divided into a grid of squares. Touch a square to check if " "there is a mine there. If no mine is present the square will show the number " @@ -97,7 +97,7 @@ msgid "" msgstr "" #. TRANSLATORS: GPL notice -#: ../qml/Main.qml:334 +#: ../qml/Main.qml:378 msgid "" "This program is free software: you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -109,52 +109,52 @@ msgid "" "License for more details." msgstr "" -#: ../qml/Main.qml:343 +#: ../qml/Main.qml:387 msgid "SOURCE" msgstr "" -#: ../qml/Main.qml:343 +#: ../qml/Main.qml:387 msgid "ISSUES" msgstr "" -#: ../qml/Main.qml:343 +#: ../qml/Main.qml:387 msgid "DONATE" msgstr "" -#: ../qml/Main.qml:353 +#: ../qml/Main.qml:397 msgid "Copyright (c) 2015 Robert Ancell" msgstr "" -#: ../qml/Main.qml:362 +#: ../qml/Main.qml:406 msgid "Copyright (c) 2017 Jan Sprinz " msgstr "" #. TRANSLATORS: Title of page showing high scores -#: ../qml/Main.qml:374 +#: ../qml/Main.qml:418 msgid "High Scores" msgstr "" #. TRANSLATORS: Label beside checkbox setting for controlling vibrations when placing flags -#: ../qml/Main.qml:402 +#: ../qml/Main.qml:446 msgid "Vibrate when placing flags" msgstr "" #. TRANSLATORS: Label above setting to choose the minefield size -#: ../qml/Main.qml:412 +#: ../qml/Main.qml:456 msgid "Minefield size:" msgstr "" #. TRANSLATORS: Setting name for small minefield -#: ../qml/Main.qml:419 +#: ../qml/Main.qml:463 msgid "Small" msgstr "" #. TRANSLATORS: Setting name for large minefield -#: ../qml/Main.qml:422 +#: ../qml/Main.qml:466 msgid "Large" msgstr "" #. TRANSLATORS: Description format for minefield size, %width%, %height% and %nmines% is replaced with the field width, height and number of mines -#: ../qml/Main.qml:428 +#: ../qml/Main.qml:472 msgid "%width%×%height%, %nmines% mines" msgstr "" diff --git a/qml/Main.qml b/qml/Main.qml index 2d5acb3..305f71a 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -198,53 +198,97 @@ MainView { } } - Rectangle { + Grid { id: statBar width: parent.width height: units.gu(20) anchors { bottom: parent.bottom } - - Row { + //anchors.fill: parent + horizontalItemAlignment: Grid.AlignHCenter + verticalItemAlignment: Grid.AlignVCenter + columns: 2 + + Rectangle { + id: time_elapsed_rectangle + height: parent.height + width: parent.width/2 anchors { - horizontalCenter: parent.horizontalCenter + left: parent.left verticalCenter: parent.verticalCenter } - Image { - id: time_icon + Row { anchors { + horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter - margins: units.gu(2) } - source: "../assets/time.svg" - } - Rectangle{ - width: units.gu(8) - height: parent.height - anchors.verticalCenter: parent.verticalCenter - - Item { - // anchors { - // verticalCenter: parent.verticalCenter - // horizontalCenter: parent.horizontalCenter - // margins: units.gu(2) - // } - Timer { - interval: 500; running: true; repeat: true - onTriggered: time.text = minefield.update_time_elapsed() + + Image { + id: time_icon + anchors { + verticalCenter: parent.verticalCenter + margins: units.gu(2) } - // Text { - // id: time - // } + source: "../assets/time.svg" + } + Rectangle{ + width: units.gu(8) + height: parent.height + anchors.verticalCenter: parent.verticalCenter + + Item { + Timer { + interval: 500; running: true; repeat: true + onTriggered: time.text = minefield.update_time_elapsed() + } + } + Text { + id: time + anchors { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + } + } + } + } + + Rectangle { + height: parent.height + anchors { + right: parent.right + left: time_elapsed_rectangle.right + verticalCenter: parent.verticalCenter + } + + Row { + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter: parent.verticalCenter } - Text { - id: time - transformOrigin: Center + + Image { + id: mine_icon anchors { verticalCenter: parent.verticalCenter - horizontalCenter: parent.horizontalCenter + margins: units.gu(2) + } + source: "../assets/mine.svg" + } + + Rectangle{ + width: units.gu(8) + height: parent.height + anchors.verticalCenter: parent.verticalCenter + + Text { + anchors { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + text: minefield.n_flags + "/" + minefield.n_mines } } } diff --git a/qml/MinefieldModel.qml b/qml/MinefieldModel.qml index 63de4be..3c053c0 100644 --- a/qml/MinefieldModel.qml +++ b/qml/MinefieldModel.qml @@ -33,6 +33,7 @@ ListModel { property bool started: false property int n_checked: 0 property int n_mines + property int n_flags: 0 property bool completed: false property var start_time property var end_time @@ -72,6 +73,9 @@ ListModel { // Can only flag unknown cells if(cell.checked) { return false } + // Update n_flags + if(cell.flagged) { n_flags-- } + else { n_flags++ } // toggle flag status cell.flagged = !cell.flagged From be2a80d97e18701c9d98c35187abd3ae3395a190 Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Thu, 27 Sep 2018 19:22:34 -0400 Subject: [PATCH 5/8] Functionnal timer and mines counter --- po/mines.neothethird.pot | 54 ++++++++++++++++++++-------------------- qml/Main.qml | 29 ++++++++++++++++----- qml/MinefieldModel.qml | 4 +++ 3 files changed, 54 insertions(+), 33 deletions(-) diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index ef00e20..41f61a0 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-09-25 01:28+0000\n" +"POT-Creation-Date: 2018-09-27 23:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,76 +18,76 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #. TRANSLATORS: Title for dialog shown when starting a new game while one in progress -#: ../qml/Main.qml:92 +#: ../qml/Main.qml:98 msgid "Game in progress" msgstr "" #. TRANSLATORS: Content for dialog shown when starting a new game while one in progress -#: ../qml/Main.qml:94 +#: ../qml/Main.qml:100 msgid "Are you sure you want to restart this game?" msgstr "" #. TRANSLATORS: Button in new game dialog that cancels the current game and starts a new one -#: ../qml/Main.qml:97 +#: ../qml/Main.qml:103 msgid "Restart game" msgstr "" #. TRANSLATORS: Button in new game dialog that cancels new game request -#: ../qml/Main.qml:106 +#: ../qml/Main.qml:112 msgid "Continue current game" msgstr "" #. TRANSLATORS: Title for dialog confirming if scores should be cleared #. TRANSLATORS: Button in clear scores dialog that clears scores #. TRANSLATORS: Action in high scores page that clears scores -#: ../qml/Main.qml:117 ../qml/Main.qml:122 ../qml/Main.qml:421 +#: ../qml/Main.qml:123 ../qml/Main.qml:128 ../qml/Main.qml:433 msgid "Clear scores" msgstr "" #. TRANSLATORS: Content for dialog confirming if scores should be cleared -#: ../qml/Main.qml:119 +#: ../qml/Main.qml:125 msgid "Existing scores will be deleted. This cannot be undone." msgstr "" #. TRANSLATORS: Button in clear scores dialog that cancels clear scores request -#: ../qml/Main.qml:131 +#: ../qml/Main.qml:137 msgid "Keep existing scores" msgstr "" #. TRANSLATORS: Title of application -#: ../qml/Main.qml:147 ../qml/Main.qml:331 +#: ../qml/Main.qml:153 ../qml/Main.qml:343 msgid "Mines" msgstr "" #. TRANSLATORS: Action on main page that shows game instructions #. TRANSLATORS: Title of page with game instructions -#: ../qml/Main.qml:151 ../qml/Main.qml:305 +#: ../qml/Main.qml:157 ../qml/Main.qml:317 msgid "How to Play" msgstr "" #. TRANSLATORS: Action on main page that shows settings dialog #. TRANSLATORS: Title of page showing settings -#: ../qml/Main.qml:157 ../qml/Main.qml:434 +#: ../qml/Main.qml:163 ../qml/Main.qml:446 msgid "Settings" msgstr "" #. TRANSLATORS: Action on main page that starts a new game -#: ../qml/Main.qml:163 +#: ../qml/Main.qml:169 msgid "New Game" msgstr "" -#: ../qml/Main.qml:349 +#: ../qml/Main.qml:361 msgid "Version: " msgstr "" #. TRANSLATORS: Short description -#: ../qml/Main.qml:358 +#: ../qml/Main.qml:370 msgid "" "Mines is a puzzle game where the goal is to find the mines in a minefield." msgstr "" #. TRANSLATORS: Game instructions -#: ../qml/Main.qml:368 +#: ../qml/Main.qml:380 msgid "" "The minefield is divided into a grid of squares. Touch a square to check if " "there is a mine there. If no mine is present the square will show the number " @@ -97,7 +97,7 @@ msgid "" msgstr "" #. TRANSLATORS: GPL notice -#: ../qml/Main.qml:378 +#: ../qml/Main.qml:390 msgid "" "This program is free software: you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -109,52 +109,52 @@ msgid "" "License for more details." msgstr "" -#: ../qml/Main.qml:387 +#: ../qml/Main.qml:399 msgid "SOURCE" msgstr "" -#: ../qml/Main.qml:387 +#: ../qml/Main.qml:399 msgid "ISSUES" msgstr "" -#: ../qml/Main.qml:387 +#: ../qml/Main.qml:399 msgid "DONATE" msgstr "" -#: ../qml/Main.qml:397 +#: ../qml/Main.qml:409 msgid "Copyright (c) 2015 Robert Ancell" msgstr "" -#: ../qml/Main.qml:406 +#: ../qml/Main.qml:418 msgid "Copyright (c) 2017 Jan Sprinz " msgstr "" #. TRANSLATORS: Title of page showing high scores -#: ../qml/Main.qml:418 +#: ../qml/Main.qml:430 msgid "High Scores" msgstr "" #. TRANSLATORS: Label beside checkbox setting for controlling vibrations when placing flags -#: ../qml/Main.qml:446 +#: ../qml/Main.qml:458 msgid "Vibrate when placing flags" msgstr "" #. TRANSLATORS: Label above setting to choose the minefield size -#: ../qml/Main.qml:456 +#: ../qml/Main.qml:468 msgid "Minefield size:" msgstr "" #. TRANSLATORS: Setting name for small minefield -#: ../qml/Main.qml:463 +#: ../qml/Main.qml:475 msgid "Small" msgstr "" #. TRANSLATORS: Setting name for large minefield -#: ../qml/Main.qml:466 +#: ../qml/Main.qml:478 msgid "Large" msgstr "" #. TRANSLATORS: Description format for minefield size, %width%, %height% and %nmines% is replaced with the field width, height and number of mines -#: ../qml/Main.qml:472 +#: ../qml/Main.qml:484 msgid "%width%×%height%, %nmines% mines" msgstr "" diff --git a/qml/Main.qml b/qml/Main.qml index 305f71a..ce99748 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -82,6 +82,12 @@ MainView { { var grid_options = size_selector.model.get(size_selector.selectedIndex) minefield.set_size(grid_options.grid_width, grid_options.grid_height, grid_options.n_mines) + reset_timer() + } + + function reset_timer() + { + if (!minefield.completed && !timer.running) { timer.start() } } Component { @@ -175,11 +181,14 @@ MainView { MinefieldModel { id: minefield onSolved: { - get_history_database().transaction(function(t) { - t.executeSql("CREATE TABLE IF NOT EXISTS History(grid_width INTEGER, grid_height INTEGER, n_mines INTEGER, date TEXT, duration INTEGER)") - var duration = minefield.end_time - minefield.start_time - t.executeSql("INSERT INTO History VALUES(?, ?, ?, ?, ?)", [minefield.columns, minefield.rows, minefield.n_mines, minefield.start_time.toISOString(), duration]) - }) + if (minefield.loosed != true) { + get_history_database().transaction(function(t) { + t.executeSql("CREATE TABLE IF NOT EXISTS History(grid_width INTEGER, grid_height INTEGER, n_mines INTEGER, date TEXT, duration INTEGER)") + var duration = minefield.end_time - minefield.start_time + t.executeSql("INSERT INTO History VALUES(?, ?, ?, ?, ?)", [minefield.columns, minefield.rows, minefield.n_mines, minefield.start_time.toISOString(), duration]) + }) + } + timer.stop() } } @@ -239,8 +248,10 @@ MainView { anchors.verticalCenter: parent.verticalCenter Item { + Component.onCompleted: reset_timer() Timer { - interval: 500; running: true; repeat: true + id: timer + interval: 500; running: false; repeat: true onTriggered: time.text = minefield.update_time_elapsed() } } @@ -493,6 +504,12 @@ MainView { grid_height: 16 n_mines: 25 } + // ListElement { + // name: "test" + // grid_width: 3 + // grid_height: 3 + // n_mines: 2 + // } } } } diff --git a/qml/MinefieldModel.qml b/qml/MinefieldModel.qml index 3c053c0..19e93c3 100644 --- a/qml/MinefieldModel.qml +++ b/qml/MinefieldModel.qml @@ -35,6 +35,7 @@ ListModel { property int n_mines property int n_flags: 0 property bool completed: false + property bool loosed: false property var start_time property var end_time property double time_elapsed @@ -47,6 +48,7 @@ ListModel { n_checked = 0 n_mines = n completed = false + loosed = false clear() for(var row = 0; row < n_rows; row++) { for(var column = 0; column < n_columns; column++) { @@ -114,6 +116,8 @@ ListModel { if(cell.has_mine) { completed = true + loosed = true + solved() } else { var n_flagged_mines = n_surrounding_flagged(cell.column, cell.row) if(cell.n_surrounding <= n_flagged_mines) { From a4594b764ffe6ee9386cf293f31deee4cd303ee1 Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Sun, 30 Sep 2018 11:34:12 -0400 Subject: [PATCH 6/8] Functionnal timer and mine counter --- po/mines.neothethird.pot | 40 ++++++++++++++++++++-------------------- qml/Main.qml | 17 +++++------------ 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index 41f61a0..eaeff68 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-09-27 23:20+0000\n" +"POT-Creation-Date: 2018-09-30 15:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,7 +40,7 @@ msgstr "" #. TRANSLATORS: Title for dialog confirming if scores should be cleared #. TRANSLATORS: Button in clear scores dialog that clears scores #. TRANSLATORS: Action in high scores page that clears scores -#: ../qml/Main.qml:123 ../qml/Main.qml:128 ../qml/Main.qml:433 +#: ../qml/Main.qml:123 ../qml/Main.qml:128 ../qml/Main.qml:425 msgid "Clear scores" msgstr "" @@ -55,19 +55,19 @@ msgid "Keep existing scores" msgstr "" #. TRANSLATORS: Title of application -#: ../qml/Main.qml:153 ../qml/Main.qml:343 +#: ../qml/Main.qml:153 ../qml/Main.qml:335 msgid "Mines" msgstr "" #. TRANSLATORS: Action on main page that shows game instructions #. TRANSLATORS: Title of page with game instructions -#: ../qml/Main.qml:157 ../qml/Main.qml:317 +#: ../qml/Main.qml:157 ../qml/Main.qml:309 msgid "How to Play" msgstr "" #. TRANSLATORS: Action on main page that shows settings dialog #. TRANSLATORS: Title of page showing settings -#: ../qml/Main.qml:163 ../qml/Main.qml:446 +#: ../qml/Main.qml:163 ../qml/Main.qml:438 msgid "Settings" msgstr "" @@ -76,18 +76,18 @@ msgstr "" msgid "New Game" msgstr "" -#: ../qml/Main.qml:361 +#: ../qml/Main.qml:353 msgid "Version: " msgstr "" #. TRANSLATORS: Short description -#: ../qml/Main.qml:370 +#: ../qml/Main.qml:362 msgid "" "Mines is a puzzle game where the goal is to find the mines in a minefield." msgstr "" #. TRANSLATORS: Game instructions -#: ../qml/Main.qml:380 +#: ../qml/Main.qml:372 msgid "" "The minefield is divided into a grid of squares. Touch a square to check if " "there is a mine there. If no mine is present the square will show the number " @@ -97,7 +97,7 @@ msgid "" msgstr "" #. TRANSLATORS: GPL notice -#: ../qml/Main.qml:390 +#: ../qml/Main.qml:382 msgid "" "This program is free software: you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -109,52 +109,52 @@ msgid "" "License for more details." msgstr "" -#: ../qml/Main.qml:399 +#: ../qml/Main.qml:391 msgid "SOURCE" msgstr "" -#: ../qml/Main.qml:399 +#: ../qml/Main.qml:391 msgid "ISSUES" msgstr "" -#: ../qml/Main.qml:399 +#: ../qml/Main.qml:391 msgid "DONATE" msgstr "" -#: ../qml/Main.qml:409 +#: ../qml/Main.qml:401 msgid "Copyright (c) 2015 Robert Ancell" msgstr "" -#: ../qml/Main.qml:418 +#: ../qml/Main.qml:410 msgid "Copyright (c) 2017 Jan Sprinz " msgstr "" #. TRANSLATORS: Title of page showing high scores -#: ../qml/Main.qml:430 +#: ../qml/Main.qml:422 msgid "High Scores" msgstr "" #. TRANSLATORS: Label beside checkbox setting for controlling vibrations when placing flags -#: ../qml/Main.qml:458 +#: ../qml/Main.qml:450 msgid "Vibrate when placing flags" msgstr "" #. TRANSLATORS: Label above setting to choose the minefield size -#: ../qml/Main.qml:468 +#: ../qml/Main.qml:460 msgid "Minefield size:" msgstr "" #. TRANSLATORS: Setting name for small minefield -#: ../qml/Main.qml:475 +#: ../qml/Main.qml:467 msgid "Small" msgstr "" #. TRANSLATORS: Setting name for large minefield -#: ../qml/Main.qml:478 +#: ../qml/Main.qml:470 msgid "Large" msgstr "" #. TRANSLATORS: Description format for minefield size, %width%, %height% and %nmines% is replaced with the field width, height and number of mines -#: ../qml/Main.qml:484 +#: ../qml/Main.qml:476 msgid "%width%×%height%, %nmines% mines" msgstr "" diff --git a/qml/Main.qml b/qml/Main.qml index ce99748..f126e06 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -207,28 +207,21 @@ MainView { } } - Grid { + Rectangle { id: statBar width: parent.width height: units.gu(20) - anchors { - bottom: parent.bottom - } - //anchors.fill: parent - horizontalItemAlignment: Grid.AlignHCenter - verticalItemAlignment: Grid.AlignVCenter - columns: 2 + anchors.bottom: parent.bottom Rectangle { - id: time_elapsed_rectangle height: parent.height width: parent.width/2 anchors { left: parent.left - verticalCenter: parent.verticalCenter } Row { + height: parent.height anchors { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter @@ -268,13 +261,13 @@ MainView { Rectangle { height: parent.height + width: parent.width/2 anchors { right: parent.right - left: time_elapsed_rectangle.right - verticalCenter: parent.verticalCenter } Row { + height: parent.height anchors { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter From 33288539b5921cae72ee6a6e6de554e26e6997c8 Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Sun, 30 Sep 2018 11:34:12 -0400 Subject: [PATCH 7/8] Remove grid layout to prevent a warning. Final code --- po/mines.neothethird.pot | 40 ++++++++++++++++++++-------------------- qml/Main.qml | 17 +++++------------ 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index 41f61a0..eaeff68 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-09-27 23:20+0000\n" +"POT-Creation-Date: 2018-09-30 15:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,7 +40,7 @@ msgstr "" #. TRANSLATORS: Title for dialog confirming if scores should be cleared #. TRANSLATORS: Button in clear scores dialog that clears scores #. TRANSLATORS: Action in high scores page that clears scores -#: ../qml/Main.qml:123 ../qml/Main.qml:128 ../qml/Main.qml:433 +#: ../qml/Main.qml:123 ../qml/Main.qml:128 ../qml/Main.qml:425 msgid "Clear scores" msgstr "" @@ -55,19 +55,19 @@ msgid "Keep existing scores" msgstr "" #. TRANSLATORS: Title of application -#: ../qml/Main.qml:153 ../qml/Main.qml:343 +#: ../qml/Main.qml:153 ../qml/Main.qml:335 msgid "Mines" msgstr "" #. TRANSLATORS: Action on main page that shows game instructions #. TRANSLATORS: Title of page with game instructions -#: ../qml/Main.qml:157 ../qml/Main.qml:317 +#: ../qml/Main.qml:157 ../qml/Main.qml:309 msgid "How to Play" msgstr "" #. TRANSLATORS: Action on main page that shows settings dialog #. TRANSLATORS: Title of page showing settings -#: ../qml/Main.qml:163 ../qml/Main.qml:446 +#: ../qml/Main.qml:163 ../qml/Main.qml:438 msgid "Settings" msgstr "" @@ -76,18 +76,18 @@ msgstr "" msgid "New Game" msgstr "" -#: ../qml/Main.qml:361 +#: ../qml/Main.qml:353 msgid "Version: " msgstr "" #. TRANSLATORS: Short description -#: ../qml/Main.qml:370 +#: ../qml/Main.qml:362 msgid "" "Mines is a puzzle game where the goal is to find the mines in a minefield." msgstr "" #. TRANSLATORS: Game instructions -#: ../qml/Main.qml:380 +#: ../qml/Main.qml:372 msgid "" "The minefield is divided into a grid of squares. Touch a square to check if " "there is a mine there. If no mine is present the square will show the number " @@ -97,7 +97,7 @@ msgid "" msgstr "" #. TRANSLATORS: GPL notice -#: ../qml/Main.qml:390 +#: ../qml/Main.qml:382 msgid "" "This program is free software: you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -109,52 +109,52 @@ msgid "" "License for more details." msgstr "" -#: ../qml/Main.qml:399 +#: ../qml/Main.qml:391 msgid "SOURCE" msgstr "" -#: ../qml/Main.qml:399 +#: ../qml/Main.qml:391 msgid "ISSUES" msgstr "" -#: ../qml/Main.qml:399 +#: ../qml/Main.qml:391 msgid "DONATE" msgstr "" -#: ../qml/Main.qml:409 +#: ../qml/Main.qml:401 msgid "Copyright (c) 2015 Robert Ancell" msgstr "" -#: ../qml/Main.qml:418 +#: ../qml/Main.qml:410 msgid "Copyright (c) 2017 Jan Sprinz " msgstr "" #. TRANSLATORS: Title of page showing high scores -#: ../qml/Main.qml:430 +#: ../qml/Main.qml:422 msgid "High Scores" msgstr "" #. TRANSLATORS: Label beside checkbox setting for controlling vibrations when placing flags -#: ../qml/Main.qml:458 +#: ../qml/Main.qml:450 msgid "Vibrate when placing flags" msgstr "" #. TRANSLATORS: Label above setting to choose the minefield size -#: ../qml/Main.qml:468 +#: ../qml/Main.qml:460 msgid "Minefield size:" msgstr "" #. TRANSLATORS: Setting name for small minefield -#: ../qml/Main.qml:475 +#: ../qml/Main.qml:467 msgid "Small" msgstr "" #. TRANSLATORS: Setting name for large minefield -#: ../qml/Main.qml:478 +#: ../qml/Main.qml:470 msgid "Large" msgstr "" #. TRANSLATORS: Description format for minefield size, %width%, %height% and %nmines% is replaced with the field width, height and number of mines -#: ../qml/Main.qml:484 +#: ../qml/Main.qml:476 msgid "%width%×%height%, %nmines% mines" msgstr "" diff --git a/qml/Main.qml b/qml/Main.qml index ce99748..f126e06 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -207,28 +207,21 @@ MainView { } } - Grid { + Rectangle { id: statBar width: parent.width height: units.gu(20) - anchors { - bottom: parent.bottom - } - //anchors.fill: parent - horizontalItemAlignment: Grid.AlignHCenter - verticalItemAlignment: Grid.AlignVCenter - columns: 2 + anchors.bottom: parent.bottom Rectangle { - id: time_elapsed_rectangle height: parent.height width: parent.width/2 anchors { left: parent.left - verticalCenter: parent.verticalCenter } Row { + height: parent.height anchors { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter @@ -268,13 +261,13 @@ MainView { Rectangle { height: parent.height + width: parent.width/2 anchors { right: parent.right - left: time_elapsed_rectangle.right - verticalCenter: parent.verticalCenter } Row { + height: parent.height anchors { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter From 513b78b50da28122b97e30cffb0b03c2afcd84d2 Mon Sep 17 00:00:00 2001 From: Ellypsis Date: Tue, 23 Oct 2018 21:28:57 -0400 Subject: [PATCH 8/8] bug fix : reset flag counter on new game --- po/mines.neothethird.pot | 4 ++-- qml/MinefieldModel.qml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/po/mines.neothethird.pot b/po/mines.neothethird.pot index eaeff68..d1b4db8 100644 --- a/po/mines.neothethird.pot +++ b/po/mines.neothethird.pot @@ -1,6 +1,6 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the mines.neothethird package. # FIRST AUTHOR , YEAR. # #, fuzzy @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mines.neothethird\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-09-30 15:33+0000\n" +"POT-Creation-Date: 2018-10-24 01:26+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/qml/MinefieldModel.qml b/qml/MinefieldModel.qml index 19e93c3..dd0d7a8 100644 --- a/qml/MinefieldModel.qml +++ b/qml/MinefieldModel.qml @@ -47,6 +47,7 @@ ListModel { started = false n_checked = 0 n_mines = n + n_flags = 0 completed = false loosed = false clear()