[pentobi] 01/04: New upstream version 12.2

Juhani Numminen jsonic-guest at moszumanska.debian.org
Thu Jan 5 20:31:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

jsonic-guest pushed a commit to branch master
in repository pentobi.

commit d80c0e8ccbbab7e5a66cb9ef9fe8493d431f2c29
Author: Juhani Numminen <juhaninumminen0 at gmail.com>
Date:   Thu Jan 5 21:28:24 2017 +0200

    New upstream version 12.2
---
 CMakeLists.txt                                     |   4 +--
 COPYING                                            |   2 +-
 INSTALL                                            |   2 +-
 NEWS                                               |  28 +++++++++++++++++--
 data/pentobi-mime.xml                              |   5 ++++
 data/pentobi.appdata.xml.in                        |   2 +-
 src/libboardgame_sgf/SgfTree.cpp                   |  16 +++++++----
 src/libboardgame_sgf/SgfTree.h                     |  13 +++++----
 src/libpentobi_base/PentobiTree.cpp                |  12 ++++----
 src/libpentobi_gui/GameInfoDialog.cpp              |   2 --
 src/libpentobi_mcts/AnalyzeGame.cpp                |  19 +++++++++----
 src/pentobi/AnalyzeGameWidget.cpp                  |  31 ++++++++++++---------
 src/pentobi/AnalyzeGameWidget.h                    |   2 +-
 src/pentobi/MainWindow.cpp                         |   9 +++---
 src/pentobi/help/C/pentobi/license.html            |   2 +-
 src/pentobi/help/de/pentobi/license.html           |   2 +-
 src/pentobi/help/de/pentobi/system.html            |   2 +-
 src/pentobi_qml/Pentobi.pro                        |   2 +-
 src/pentobi_qml/android/AndroidManifest.xml        |  10 +++----
 src/pentobi_qml/android/res/drawable-hdpi/icon.png | Bin 603 -> 409 bytes
 src/pentobi_qml/android/res/drawable-mdpi/icon.png | Bin 469 -> 324 bytes
 src/pentobi_qml/android/res/drawable/splash.xml    |  11 ++++++++
 src/pentobi_qml/android/res/values/theme.xml       |   6 ++++
 src/pentobi_qml/qml/AndroidToolButton.qml          |   9 +++---
 src/pentobi_qml/qml/Button.qml                     |   8 ++++--
 src/pentobi_qml/qml/GameDisplay.js                 |   2 +-
 src/pentobi_qml/qml/Main.js                        |   2 +-
 src/pentobi_qml/qml/Main.qml                       |  16 +++++------
 src/pentobi_qml/qml/OpenDialog.qml                 |   1 +
 src/pentobi_qml/qml/PieceList.qml                  |   4 ++-
 src/pentobi_qml/qml/SaveDialog.qml                 |   1 +
 31 files changed, 146 insertions(+), 79 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a05dde2..ff848ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,8 @@
 cmake_minimum_required(VERSION 3.0.2)
 
 project(Pentobi)
-set(PENTOBI_VERSION 12.1)
-set(PENTOBI_RELEASE_DATE 2016-11-30)
+set(PENTOBI_VERSION 12.2)
+set(PENTOBI_RELEASE_DATE 2017-01-05)
 
 cmake_policy(SET CMP0043 NEW)
 
diff --git a/COPYING b/COPYING
index 2f6d7a8..72591e1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-Copyright (C) 2011-2016 Markus Enzenberger <enz at users.sourceforge.net>
+Copyright (C) 2011-2017 Markus Enzenberger <enz at users.sourceforge.net>
 
 Pentobi 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
diff --git a/INSTALL b/INSTALL
index e735080..e60f9fc 100644
--- a/INSTALL
+++ b/INSTALL
@@ -3,7 +3,7 @@ This file explains how to compile and install Pentobi from the sources.
 
 == Requirements ==
 
-Pentobi requires the Qt libraries (>=5.1). The C++ compiler needs to support
+Pentobi requires the Qt libraries (>=5.2). The C++ compiler needs to support
 certain C++11 features (only features that are already implemented by
 GCC 4.9 and MSVC 2015). The build system uses CMake (>=3.0.2).
 
diff --git a/NEWS b/NEWS
index 399e69d..4667f33 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,27 @@
+Version 12.2 (05 Jan 2017)
+==========================
+
+General:
+
+* Added patterns for Nexos and Callisto SGF files to MIME type
+  specification for detecting them independent of the file ending.
+
+Desktop version:
+
+* Game info properties were not removed from file if the corresponding
+  text in the game info dialog was deleted.
+* New Game/Save As was not enabled if no move had been played but game
+  was modified by editing the comment in the root node or the game info.
+* Fixed a race condition that could cause a crash when updating the
+  analysis window while a game analysis was running.
+* Game analysis progress dialog was not closed if analysis was canceled.
+
+Android version:
+
+* Toolbuttons were too small on very high DPI devices.
+* Open/Save did not show error message on failure.
+
+
 Version 12.1 (30 Nov 2016)
 ==========================
 
@@ -11,7 +35,7 @@ General:
 
 Desktop version:
 
-* Compilations on Windows is no longer tested or supported.
+* Compilation on Windows is no longer tested or supported.
 * Keep Only Position and Keep Only Subtree did not work correctly in Nexos and
   in multi-player Callisto.
 * Delete All Variations did not mark the file as modified.
@@ -44,7 +68,7 @@ Bug fixes Desktop version:
 * Icon for undo did not have a high-DPI version.
 * Option --verbose was broken on Windows.
 
-Android version
+Android version:
 
 * The compilation now requires Qt 5.6.
 * Support for game variant Nexos.
diff --git a/data/pentobi-mime.xml b/data/pentobi-mime.xml
index a1e71af..fe420d7 100644
--- a/data/pentobi-mime.xml
+++ b/data/pentobi-mime.xml
@@ -11,6 +11,11 @@
 <match type="string" offset="0:256" value="GM[Blokus Trigon Three-Player]"/>
 <match type="string" offset="0:256" value="GM[Blokus Trigon Two-Player]"/>
 <match type="string" offset="0:256" value="GM[Blokus Two-Player]"/>
+<match type="string" offset="0:256" value="GM[Callisto]"/>
+<match type="string" offset="0:256" value="GM[Callisto Three-Player]"/>
+<match type="string" offset="0:256" value="GM[Callisto Two-Player]"/>
+<match type="string" offset="0:256" value="GM[Nexos]"/>
+<match type="string" offset="0:256" value="GM[Nexos Two-Player]"/>
 </magic>
 <sub-class-of type="text/plain"/>
 <glob pattern="*.blksgf"/>
diff --git a/data/pentobi.appdata.xml.in b/data/pentobi.appdata.xml.in
index d73ff14..c3c691b 100644
--- a/data/pentobi.appdata.xml.in
+++ b/data/pentobi.appdata.xml.in
@@ -28,7 +28,7 @@
     <p>System requirements: 1 GB RAM, 1 GHz CPU (4 GB RAM, 2 GHz dual-core or
     faster CPU recommended for playing level 9).</p>
     <p xml:lang="de">Systemminima: 1 GB RAM, 1 GHz CPU (4 GB RAM, 2 GHz
-    dual-core oder schnellere CPU empfohlen für Spielstufe 9).</p>
+    Dual-Core- oder schnellere CPU empfohlen für Spielstufe 9).</p>
 
     <p>Trademark disclaimer: The trademark Blokus and other trademarks referred
     to are property of their respective trademark holders. The trademark
diff --git a/src/libboardgame_sgf/SgfTree.cpp b/src/libboardgame_sgf/SgfTree.cpp
index f3c5fb2..f2c1886 100644
--- a/src/libboardgame_sgf/SgfTree.cpp
+++ b/src/libboardgame_sgf/SgfTree.cpp
@@ -207,6 +207,16 @@ void SgfTree::set_property(const SgfNode& node, const string& id, const char* va
         m_modified = true;
 }
 
+void SgfTree::set_property_remove_empty(const SgfNode& node, const string& id,
+                                        const string& value)
+{
+    string trimmed = trim(value);
+    if (trimmed.empty())
+        remove_property(node, id);
+    else
+        set_property(node, id, value);
+}
+
 void SgfTree::set_bad_move(const SgfNode& node, double value)
 {
     remove_move_annotation(node);
@@ -215,11 +225,7 @@ void SgfTree::set_bad_move(const SgfNode& node, double value)
 
 void SgfTree::set_comment(const SgfNode& node, const string& s)
 {
-    string trimmed = trim(s);
-    if (trimmed.empty())
-        remove_property(node, "C");
-    else
-        set_property(node, "C", s);
+    set_property_remove_empty(node, "C", s);
 }
 
 void SgfTree::set_date_today()
diff --git a/src/libboardgame_sgf/SgfTree.h b/src/libboardgame_sgf/SgfTree.h
index 653a170..8b9a4f9 100644
--- a/src/libboardgame_sgf/SgfTree.h
+++ b/src/libboardgame_sgf/SgfTree.h
@@ -98,6 +98,9 @@ public:
     void set_property(const SgfNode& node, const string& id,
                       const vector<T>& values);
 
+    void set_property_remove_empty(const SgfNode& node,
+                                   const string& id, const string& value);
+
     bool remove_property(const SgfNode& node, const string& id);
 
     void move_property_to_front(const SgfNode& node, const string& id);
@@ -224,17 +227,17 @@ inline unique_ptr<SgfNode> SgfTree::remove_children(const SgfNode& node)
 
 inline void SgfTree::set_charset(const string& charset)
 {
-    set_property(get_root(), "CA", charset);
+    set_property_remove_empty(get_root(), "CA", charset);
 }
 
 inline void SgfTree::set_date(const string& date)
 {
-    set_property(get_root(), "DT", date);
+    set_property_remove_empty(get_root(), "DT", date);
 }
 
 inline void SgfTree::set_event(const string& event)
 {
-    set_property(get_root(), "EV", event);
+    set_property_remove_empty(get_root(), "EV", event);
 }
 
 inline void SgfTree::set_modified()
@@ -261,12 +264,12 @@ void SgfTree::set_property(const SgfNode& node, const string& id,
 
 inline void SgfTree::set_round(const string& round)
 {
-    set_property(get_root(), "RO", round);
+    set_property_remove_empty(get_root(), "RO", round);
 }
 
 inline void SgfTree::set_time(const string& time)
 {
-    set_property(get_root(), "TM", time);
+    set_property_remove_empty(get_root(), "TM", time);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/src/libpentobi_base/PentobiTree.cpp b/src/libpentobi_base/PentobiTree.cpp
index 594c47b..b684b5e 100644
--- a/src/libpentobi_base/PentobiTree.cpp
+++ b/src/libpentobi_base/PentobiTree.cpp
@@ -278,20 +278,20 @@ void PentobiTree::set_player_name(Color c, const string& name)
     if (get_nu_players(m_variant) == 2)
     {
         if (c == Color(0) || c == Color(2))
-            set_property(root, "PB", name);
+            set_property_remove_empty(root, "PB", name);
         else if (c == Color(1) || c == Color(3))
-            set_property(root, "PW", name);
+            set_property_remove_empty(root, "PW", name);
     }
     else
     {
         if (c == Color(0))
-            set_property(root, "P1", name);
+            set_property_remove_empty(root, "P1", name);
         else if (c == Color(1))
-            set_property(root, "P2", name);
+            set_property_remove_empty(root, "P2", name);
         else if (c == Color(2))
-            set_property(root, "P3", name);
+            set_property_remove_empty(root, "P3", name);
         else if (c == Color(3))
-            set_property(root, "P4", name);
+            set_property_remove_empty(root, "P4", name);
     }
 }
 
diff --git a/src/libpentobi_gui/GameInfoDialog.cpp b/src/libpentobi_gui/GameInfoDialog.cpp
index 74e3ef9..06bad4b 100644
--- a/src/libpentobi_gui/GameInfoDialog.cpp
+++ b/src/libpentobi_gui/GameInfoDialog.cpp
@@ -125,8 +125,6 @@ bool GameInfoDialog::acceptLine(QLineEdit* lineEdit, string& value)
     if (! lineEdit->isModified())
         return false;
     QString text = lineEdit->text();
-    if (text.trimmed().isEmpty())
-        return false;
     value = Util::convertSgfValueFromQString(text, m_charset);
     return true;
 }
diff --git a/src/libpentobi_mcts/AnalyzeGame.cpp b/src/libpentobi_mcts/AnalyzeGame.cpp
index 01fd293..f4d68b9 100644
--- a/src/libpentobi_mcts/AnalyzeGame.cpp
+++ b/src/libpentobi_mcts/AnalyzeGame.cpp
@@ -16,6 +16,7 @@
 
 namespace libpentobi_mcts {
 
+using libboardgame_sgf::InvalidTree;
 using libboardgame_sgf::SgfNode;
 using libboardgame_util::clear_abort;
 using libboardgame_util::get_abort;
@@ -36,11 +37,19 @@ void AnalyzeGame::run(const Game& game, Search& search, size_t nu_simulations,
     auto& root = game.get_root();
     auto node = &root;
     unsigned total_moves = 0;
-    while (node)
+    try {
+        while (node)
+        {
+            if (tree.has_move(*node))
+                ++total_moves;
+            node = node->get_first_child_or_null();
+        }
+    }
+    catch (const InvalidTree&)
     {
-        if (tree.has_move(*node))
-            ++total_moves;
-        node = node->get_first_child_or_null();
+        // PentobiTree::has_move() can throw on invalid SGF tree read from
+        // external file. We simply abort the analysis.
+        return;
     }
     WallTimeSource time_source;
     clear_abort();
@@ -81,7 +90,7 @@ void AnalyzeGame::run(const Game& game, Search& search, size_t nu_simulations,
                     m_moves.push_back(mv);
                     m_values.push_back(search.get_root_val().get_mean());
                 }
-                catch (const runtime_error&)
+                catch (const InvalidTree&)
                 {
                     // BoardUpdater::update() can throw on invalid SGF tree
                     // read from external file. We simply abort the analysis.
diff --git a/src/pentobi/AnalyzeGameWidget.cpp b/src/pentobi/AnalyzeGameWidget.cpp
index 4b31bb3..0e762fb 100644
--- a/src/pentobi/AnalyzeGameWidget.cpp
+++ b/src/pentobi/AnalyzeGameWidget.cpp
@@ -169,7 +169,10 @@ void AnalyzeGameWidget::setCurrentPosition(const Game& game,
 
 void AnalyzeGameWidget::showProgress(int progress)
 {
-    m_progressDialog->setValue(progress);
+    // m_progressDialog might already be closed if cancel was pressed and
+    // setValue makes it visible again (only with some Qt versions/platforms?)
+    if (m_progressDialog->isVisible())
+        m_progressDialog->setValue(progress);
     // Repaint the window with the current status of the analysis
     update();
 }
@@ -188,15 +191,18 @@ void AnalyzeGameWidget::start(const Game& game, Search& search,
     m_search = &search;
     m_nuSimulations = nuSimulations;
     initSize();
-    m_progressDialog = new QProgressDialog(this);
-    m_progressDialog->setWindowModality(Qt::WindowModal);
-    m_progressDialog->setWindowFlags(m_progressDialog->windowFlags()
-                                     & ~Qt::WindowContextHelpButtonHint);
-    m_progressDialog->setLabel(new QLabel(tr("Running game analysis..."),
-                                          this));
-    Util::setNoTitle(*m_progressDialog);
-    m_progressDialog->setMinimumDuration(0);
-    connect(m_progressDialog, SIGNAL(canceled()), SLOT(cancel()));
+    if (! m_progressDialog)
+    {
+        m_progressDialog = new QProgressDialog(this);
+        m_progressDialog->setWindowModality(Qt::WindowModal);
+        m_progressDialog->setWindowFlags(m_progressDialog->windowFlags()
+                                         & ~Qt::WindowContextHelpButtonHint);
+        m_progressDialog->setLabel(new QLabel(tr("Running game analysis..."),
+                                              this));
+        Util::setNoTitle(*m_progressDialog);
+        m_progressDialog->setMinimumDuration(0);
+        connect(m_progressDialog, SIGNAL(canceled()), SLOT(cancel()));
+    }
     m_progressDialog->show();
     m_isRunning = true;
     m_future = QtConcurrent::run(this, &AnalyzeGameWidget::threadFunction);
@@ -213,12 +219,11 @@ void AnalyzeGameWidget::threadFunction()
                 return;
             int progress = 100 * movesAnalyzed / totalMoves;
             QMetaObject::invokeMethod(this, "showProgress",
-                                      Qt::QueuedConnection,
+                                      Qt::BlockingQueuedConnection,
                                       Q_ARG(int, progress));
         };
     m_analyzeGame.run(*m_game, *m_search, m_nuSimulations, progressCallback);
-    QMetaObject::invokeMethod(this, "showProgress", Qt::QueuedConnection,
-                              Q_ARG(int, 100));
+    QMetaObject::invokeMethod(m_progressDialog, "hide", Qt::QueuedConnection);
     m_isRunning = false;
     emit finished();
 }
diff --git a/src/pentobi/AnalyzeGameWidget.h b/src/pentobi/AnalyzeGameWidget.h
index 259a072..a549a26 100644
--- a/src/pentobi/AnalyzeGameWidget.h
+++ b/src/pentobi/AnalyzeGameWidget.h
@@ -90,7 +90,7 @@ private:
 
     AnalyzeGame m_analyzeGame;
 
-    QProgressDialog* m_progressDialog;
+    QProgressDialog* m_progressDialog = nullptr;
 
     QFuture<void> m_future;
 
diff --git a/src/pentobi/MainWindow.cpp b/src/pentobi/MainWindow.cpp
index e6bf341..b74b6eb 100644
--- a/src/pentobi/MainWindow.cpp
+++ b/src/pentobi/MainWindow.cpp
@@ -314,7 +314,7 @@ void MainWindow::about()
                        "<p>" +
                        tr("Computer opponent for the board game Blokus.")
                        + "<br>" +
-                       tr("© 2011–%1 Markus Enzenberger").arg(2016) +
+                       tr("© 2011–%1 Markus Enzenberger").arg(2017) +
                        + "<br>" +
                        "<a href=\"http://pentobi.sourceforge.net\">http://pentobi.sourceforge.net</a>"
                        "</p>");
@@ -577,7 +577,7 @@ void MainWindow::commentChanged()
         value = trim_right(value);
         m_game.set_comment(value);
     }
-    updateWindowModified();
+    updateWindow(false);
 }
 
 void MainWindow::computerColors()
@@ -1906,7 +1906,6 @@ void MainWindow::goodMove(bool checked)
 
 void MainWindow::gotoMove()
 {
-    QSettings settings;
     vector<const SgfNode*> nodes;
     auto& tree = m_game.get_tree();
     auto node = &m_game.get_current();
@@ -2270,7 +2269,6 @@ void MainWindow::open()
 {
     if (! checkSave())
         return;
-    QSettings settings;
     QString file = QFileDialog::getOpenFileName(this, tr("Open"), getLastDir(),
                                                 getFilter());
     if (file.isEmpty())
@@ -2790,6 +2788,7 @@ void MainWindow::setCommentText(const QString& text)
     if (! text.isEmpty())
         m_comment->ensureCursorVisible();
     m_comment->clearFocus();
+    updateWindow(false);
 }
 
 void MainWindow::setNoDelay()
@@ -3396,7 +3395,7 @@ void MainWindow::updateWindow(bool currentNodeChanged)
     m_actionPreviousVariation->setEnabled(hasPrevVar);
     m_actionRatedGame->setEnabled(! m_isRated);
     m_actionSave->setEnabled(! m_file.isEmpty() && m_game.is_modified());
-    m_actionSaveAs->setEnabled(! isEmpty);
+    m_actionSaveAs->setEnabled(! isEmpty || m_game.is_modified());
     // See also comment in setupMode()
     m_actionSetupMode->setEnabled(! m_isRated && ! hasParent && ! hasChildren);
     m_actionNextColor->setEnabled(! m_isRated);
diff --git a/src/pentobi/help/C/pentobi/license.html b/src/pentobi/help/C/pentobi/license.html
index d88a0d2..6e97dcf 100644
--- a/src/pentobi/help/C/pentobi/license.html
+++ b/src/pentobi/help/C/pentobi/license.html
@@ -8,7 +8,7 @@
 <body>
 <p align="right"><a href="system.html">Previous</a></p>
 <h2>License</h2>
-<p>Copyright © 2011–2016 Markus Enzenberger</p>
+<p>Copyright © 2011–2017 Markus Enzenberger</p>
 <p>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
 Software Foundation, either version 3 of the License, or (at your option) any
diff --git a/src/pentobi/help/de/pentobi/license.html b/src/pentobi/help/de/pentobi/license.html
index d228ae0..e4e2b74 100644
--- a/src/pentobi/help/de/pentobi/license.html
+++ b/src/pentobi/help/de/pentobi/license.html
@@ -8,7 +8,7 @@
 <body>
 <p align="right"><a href="system.html">Zurück</a></p>
 <h2>Lizenz</h2>
-<p>Copyright © 2011–2016 Markus Enzenberger</p>
+<p>Copyright © 2011–2017 Markus Enzenberger</p>
 <p>Dieses Programm ist freie Software. Sie können es unter den Bedingungen der
 GNU General Public License, wie von der Free Software Foundation
 veröffentlicht, weitergeben und/oder modifizieren, entweder gemäß Version 3 der
diff --git a/src/pentobi/help/de/pentobi/system.html b/src/pentobi/help/de/pentobi/system.html
index 38ccbc0..26ed70c 100644
--- a/src/pentobi/help/de/pentobi/system.html
+++ b/src/pentobi/help/de/pentobi/system.html
@@ -10,7 +10,7 @@
 "license.html">Weiter</a></p>
 <h2>Systemvoraussetzungen</h2>
 <p>Minimum: 1 GB RAM, 1 GHz CPU<br>
-Empfohlen für Spielstufe 9: 4 GB RAM, 2 GHz dual-core oder schnellere
+Empfohlen für Spielstufe 9: 4 GB RAM, 2 GHz Dual-Core- oder schnellere
 CPU</p>
 <p>Pentobi funktioniert auch auf Systemen, die das Systemminimum nicht
 erfüllen, aber die höchste Spielstufe kann auf diesen Systemen sehr langsam
diff --git a/src/pentobi_qml/Pentobi.pro b/src/pentobi_qml/Pentobi.pro
index e626184..b4ba11f 100644
--- a/src/pentobi_qml/Pentobi.pro
+++ b/src/pentobi_qml/Pentobi.pro
@@ -4,7 +4,7 @@ QT += qml quick svg concurrent
 
 INCLUDEPATH += ..
 CONFIG += c++11
-QMAKE_CXXFLAGS += -DVERSION=\"\\\"12.1\\\"\"
+QMAKE_CXXFLAGS += -DVERSION=\"\\\"12.2\\\"\"
 QMAKE_CXXFLAGS += -DPENTOBI_LOW_RESOURCES
 android {
     QMAKE_CXXFLAGS_RELEASE += -DLIBBOARDGAME_DISABLE_LOG
diff --git a/src/pentobi_qml/android/AndroidManifest.xml b/src/pentobi_qml/android/AndroidManifest.xml
index 0dfff3f..60bb1c7 100644
--- a/src/pentobi_qml/android/AndroidManifest.xml
+++ b/src/pentobi_qml/android/AndroidManifest.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<manifest package="net.sf.pentobi" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="12.1" android:versionCode="12001" android:installLocation="auto">
-    <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Pentobi" android:icon="@drawable/icon">
+<manifest package="net.sf.pentobi" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="12.2" android:versionCode="12002" android:installLocation="auto">
+    <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Pentobi" android:theme="@style/AppTheme" android:icon="@drawable/icon">
         <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:launchMode="singleTop">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
@@ -28,13 +28,11 @@
             <!--  Messages maps -->
 
             <!-- Splash screen -->
-            <!--
-            <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/>
-            -->
+            <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
             <!-- Splash screen -->
         </activity>
     </application>
-    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21"/>
+    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9"/>
     <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
 
     <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
diff --git a/src/pentobi_qml/android/res/drawable-hdpi/icon.png b/src/pentobi_qml/android/res/drawable-hdpi/icon.png
index 48dc130..4a5bd8e 100644
Binary files a/src/pentobi_qml/android/res/drawable-hdpi/icon.png and b/src/pentobi_qml/android/res/drawable-hdpi/icon.png differ
diff --git a/src/pentobi_qml/android/res/drawable-mdpi/icon.png b/src/pentobi_qml/android/res/drawable-mdpi/icon.png
index 74d6a76..4fb4397 100644
Binary files a/src/pentobi_qml/android/res/drawable-mdpi/icon.png and b/src/pentobi_qml/android/res/drawable-mdpi/icon.png differ
diff --git a/src/pentobi_qml/android/res/drawable/splash.xml b/src/pentobi_qml/android/res/drawable/splash.xml
new file mode 100644
index 0000000..32f67f9
--- /dev/null
+++ b/src/pentobi_qml/android/res/drawable/splash.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape android:shape="rectangle" >
+            <solid android:color="#131313"/>
+        </shape>
+    </item>
+    <item>
+         <bitmap android:src="@drawable/icon" android:gravity="center" />
+    </item>
+</layer-list>
diff --git a/src/pentobi_qml/android/res/values/theme.xml b/src/pentobi_qml/android/res/values/theme.xml
new file mode 100644
index 0000000..adec232
--- /dev/null
+++ b/src/pentobi_qml/android/res/values/theme.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
+        <item name="android:windowBackground">@drawable/splash</item>
+    </style>
+</resources>
diff --git a/src/pentobi_qml/qml/AndroidToolButton.qml b/src/pentobi_qml/qml/AndroidToolButton.qml
index 68c07ed..44f21b3 100644
--- a/src/pentobi_qml/qml/AndroidToolButton.qml
+++ b/src/pentobi_qml/qml/AndroidToolButton.qml
@@ -2,15 +2,14 @@ import QtQuick 2.0
 import QtQuick.Controls 1.1
 import QtQuick.Window 2.0
 
-/** ToolButton with a dynamically sized image.
-    The size of the image depends on the pixel density of the screen. Works
-    around missing support for multi-size icons in QtQuick.Controls 1.1.
-    The image source should be a SVG file with size 22x22. */
 ToolButton {
     property string imageSource
 
     Image {
-        width: Screen.pixelDensity < 5 ? 22 : 44; height: width
+        // We currently use 22x22 SVG files, try to use 22x22 or 44x44, unless
+        // very high DPI
+        width: Screen.pixelDensity < 5 ? 22 : Screen.pixelDensity < 10 ? 44 : 5 * Screen.pixelDensity
+        height: width
         sourceSize { width: width; height: height }
         anchors.centerIn: parent
         source: imageSource
diff --git a/src/pentobi_qml/qml/Button.qml b/src/pentobi_qml/qml/Button.qml
index 7263301..172c5b0 100644
--- a/src/pentobi_qml/qml/Button.qml
+++ b/src/pentobi_qml/qml/Button.qml
@@ -11,10 +11,12 @@ Controls2.Button {
 
     label: Image {
         sourceSize {
-            width: Screen.pixelDensity < 5 ? 22 : 44
-            height: width
+            // We currently use 22x22 SVG files, try to use 22x22 or 44x44, unless
+            // very high DPI
+            width: Screen.pixelDensity < 5 ? 22 : Screen.pixelDensity < 10 ? 44 : 5 * Screen.pixelDensity
+            height: Screen.pixelDensity < 5 ? 22 : Screen.pixelDensity < 10 ? 44 : 5 * Screen.pixelDensity
         }
-        anchors.centerIn: parent
+        fillMode: Image.PreserveAspectFit
         source: imageSource
         opacity: root.enabled ? 1 : 0.4
         cache: false
diff --git a/src/pentobi_qml/qml/GameDisplay.js b/src/pentobi_qml/qml/GameDisplay.js
index 2aa3aca..58e3d0f 100644
--- a/src/pentobi_qml/qml/GameDisplay.js
+++ b/src/pentobi_qml/qml/GameDisplay.js
@@ -21,7 +21,7 @@ function createColorPieces(component, pieceModels) {
     var pieces = []
     for (var i = 0; i < pieceModels.length; ++i) {
         properties["pieceModel"] = pieceModels[i]
-        pieces.push(component.createObject(this, properties))
+        pieces.push(component.createObject(gameDisplay, properties))
     }
     return pieces
 }
diff --git a/src/pentobi_qml/qml/Main.js b/src/pentobi_qml/qml/Main.js
index c8e3178..d6a3963 100644
--- a/src/pentobi_qml/qml/Main.js
+++ b/src/pentobi_qml/qml/Main.js
@@ -3,7 +3,7 @@ function about() {
     showInfo("<h2>" + qsTr("Pentobi") + "</h2><p>" +
              qsTr("Version %1").arg(Qt.application.version) + "</p><p>" +
              qsTr("Computer opponent for the board game Blokus.") + "<br>" +
-             qsTr("© 2011–%1 Markus Enzenberger").arg(2016) +
+             qsTr("© 2011–%1 Markus Enzenberger").arg(2017) +
              "<br><a href=\"" + url + "\">" + url + "</a></p>")
 }
 
diff --git a/src/pentobi_qml/qml/Main.qml b/src/pentobi_qml/qml/Main.qml
index 9caee50..a90ba50 100644
--- a/src/pentobi_qml/qml/Main.qml
+++ b/src/pentobi_qml/qml/Main.qml
@@ -36,10 +36,6 @@ ApplicationWindow {
     minimumWidth: 240; minimumHeight: 320
     width: isAndroid ? Screen.desktopAvailableWidth : defaultWidth
     height: isAndroid ? Screen.desktopAvailableHeight : defaultHeight
-    // On Android, initialize visible to true because startup time is slow and
-    // we want to show the window as soon as possible. On the desktop, visible
-    // is set to true in Component.onCompleted to reduce flickering.
-    visible: isAndroid
     color: theme.backgroundColor
     title: qsTr("Pentobi")
     onClosing: Qt.quit()
@@ -144,12 +140,14 @@ ApplicationWindow {
         id: computerColorDialogComponent
 
         ComputerColorDialog {
+            id: computerColorDialog
+
             gameVariant: gameModel.gameVariant
             onAccepted: {
-                root.computerPlays0 = this.computerPlays0
-                root.computerPlays1 = this.computerPlays1
-                root.computerPlays2 = this.computerPlays2
-                root.computerPlays3 = this.computerPlays3
+                root.computerPlays0 = computerColorDialog.computerPlays0
+                root.computerPlays1 = computerColorDialog.computerPlays1
+                root.computerPlays2 = computerColorDialog.computerPlays2
+                root.computerPlays3 = computerColorDialog.computerPlays3
                 if (! Logic.isComputerToPlay())
                     cancelGenMove()
                 else if (! gameModel.isGameOver)
@@ -216,7 +214,7 @@ ApplicationWindow {
         property var func
 
         function run(func) {
-            this.func = func
+            lengthyCommand.func = func
             isRunning = true
             restart()
         }
diff --git a/src/pentobi_qml/qml/OpenDialog.qml b/src/pentobi_qml/qml/OpenDialog.qml
index 5cad802..c9076c7 100644
--- a/src/pentobi_qml/qml/OpenDialog.qml
+++ b/src/pentobi_qml/qml/OpenDialog.qml
@@ -1,3 +1,4 @@
+import QtQuick 2.0
 import QtQuick.Dialogs 1.2
 import "Main.js" as Logic
 
diff --git a/src/pentobi_qml/qml/PieceList.qml b/src/pentobi_qml/qml/PieceList.qml
index 8a53f36..4caa196 100644
--- a/src/pentobi_qml/qml/PieceList.qml
+++ b/src/pentobi_qml/qml/PieceList.qml
@@ -13,12 +13,14 @@ Grid {
         model: pieces
 
         MouseArea {
+            id: mouseArea
+
             property var piece: modelData
 
             width: root.width / columns; height: width
             visible: ! piece.pieceModel.isPlayed
             onClicked: piecePicked(piece)
-            Component.onCompleted: piece.parentUnplayed = this
+            Component.onCompleted: piece.parentUnplayed = mouseArea
         }
     }
 }
diff --git a/src/pentobi_qml/qml/SaveDialog.qml b/src/pentobi_qml/qml/SaveDialog.qml
index 707a4aa..1a59687 100644
--- a/src/pentobi_qml/qml/SaveDialog.qml
+++ b/src/pentobi_qml/qml/SaveDialog.qml
@@ -1,3 +1,4 @@
+import QtQuick 2.0
 import QtQuick.Dialogs 1.2
 import "Main.js" as Logic
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/pentobi.git



More information about the Pkg-games-commits mailing list