diff --git a/ChangeLog b/ChangeLog index db02ed4..c1e36e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1.2.10 +------ +* FIXED: Window icon didn't work in Wayland. +* Improved loading locales. +* Improved Windows deployment. +* Replaced deprecated code. + 1.2.9 ----- * FIXED: Automatic high DPI support. diff --git a/connectagram.pro b/connectagram.pro index 9be94ec..312d5ad 100644 --- a/connectagram.pro +++ b/connectagram.pro @@ -1,8 +1,8 @@ lessThan(QT_MAJOR_VERSION, 5) { - error("Connectagram requires Qt 5.2 or greater") + error("Connectagram requires Qt 5.9 or greater") } -equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) { - error("Connectagram requires Qt 5.2 or greater") +equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 9) { + error("Connectagram requires Qt 5.9 or greater") } TEMPLATE = app @@ -12,7 +12,7 @@ CONFIG(debug, debug|release) { CONFIG += warn_on DEFINES += QT_DEPRECATED_WARNINGS - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x051100 + DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x051300 DEFINES += QT_NO_NARROWING_CONVERSIONS_IN_CONNECT } @@ -24,7 +24,7 @@ } # Set program version -VERSION = 1.2.9 +VERSION = 1.2.10 DEFINES += VERSIONSTR=\\\"$${VERSION}\\\" # Set program name @@ -85,7 +85,9 @@ QMAKE_BUNDLE_DATA += GAME_DATA } else:win32 { - RC_FILE = icons/icon.rc + RC_ICONS = icons/connectagram.ico + QMAKE_TARGET_DESCRIPTION = "Anagram game" + QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2019 Graeme Gott" } else:unix { RESOURCES += icons/icon.qrc diff --git a/debian/changelog b/debian/changelog index 9ad9240..09e7815 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +connectagram (1.2.10-1) unstable; urgency=medium + + * New upstream release + + -- Jonathan Carter Sat, 10 Aug 2019 18:33:38 +0200 + connectagram (1.2.9-6) unstable; urgency=medium * Upgrade to standards version 4.4.0 diff --git a/icons/connectagram.appdata.xml b/icons/connectagram.appdata.xml index 1b8f072..b5ab0cf 100644 --- a/icons/connectagram.appdata.xml +++ b/icons/connectagram.appdata.xml @@ -95,6 +95,16 @@ + + +
    +
  • FIXED: Window icon didn't work in Wayland
  • +
  • Improved loading locales
  • +
  • Improved Windows deployment
  • +
  • Replaced deprecated code
  • +
+
+
    diff --git a/icons/icon.rc b/icons/icon.rc deleted file mode 100644 index a42b04c..0000000 --- a/icons/icon.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "connectagram.ico" diff --git a/mac_deploy.sh b/mac_deploy.sh index 19d8fe4..4abf742 100755 --- a/mac_deploy.sh +++ b/mac_deploy.sh @@ -2,7 +2,7 @@ APP='Connectagram' BUNDLE="$APP.app" -VERSION='1.2.9' +VERSION='1.2.10' # Remove any previous disk folder or DMG echo -n 'Preparing... ' diff --git a/src/locale_dialog.cpp b/src/locale_dialog.cpp index 5cecd97..c3545e5 100644 --- a/src/locale_dialog.cpp +++ b/src/locale_dialog.cpp @@ -1,6 +1,6 @@ /*********************************************************************** * - * Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2018 Graeme Gott + * Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2018, 2019 Graeme Gott * * 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 @@ -98,50 +98,38 @@ // Find current locale m_current = QSettings().value("Locale/Language").toString(); - QString current = !m_current.isEmpty() ? m_current : QLocale::system().name(); - QStringList translations = findTranslations(); - if (!translations.contains(m_appname + current)) { - current = current.left(2); - if (!translations.contains(m_appname + current)) { - current.clear(); + if (!m_current.isEmpty()) { + QLocale::setDefault(m_current); + } + const QLocale locale; + + // Load translators + static QTranslator translator; + if (translator.load(locale, m_appname, "", m_path)) { + QCoreApplication::installTranslator(&translator); + + const QString path = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + + static QTranslator qtbase_translator; + if (qtbase_translator.load(locale, "qtbase", "_", m_path) || qtbase_translator.load(locale, "qtbase", "_", path)) { + QCoreApplication::installTranslator(&qtbase_translator); + } + + static QTranslator qt_translator; + if (qt_translator.load(locale, "qt", "_", m_path) || qt_translator.load(locale, "qt", "_", path)) { + QCoreApplication::installTranslator(&qt_translator); } } - if (!current.isEmpty()) { - QLocale::setDefault(current); - } else { - current = "en"; - } - - // Load translators - static QTranslator qt_translator; - qt_translator.load("qt_" + current, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - QCoreApplication::installTranslator(&qt_translator); - - static QTranslator qtbase_translator; - if (translations.contains("qtbase_" + current) || translations.contains("qtbase_" + current.left(2))) { - qtbase_translator.load("qtbase_" + current, m_path); - } else { - qtbase_translator.load("qtbase_" + current, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - } - QCoreApplication::installTranslator(&qtbase_translator); - - static QTranslator translator; - translator.load(m_appname + current, m_path); - QCoreApplication::installTranslator(&translator); - - // Work around bug in Qt 5 where text direction is not loaded - QGuiApplication::setLayoutDirection(QLocale(current).textDirection()); } //----------------------------------------------------------------------------- QString LocaleDialog::languageName(const QString& language) { - QString lang_code = language.left(5); - QLocale locale(lang_code); QString name; - if (lang_code.length() > 2) { - if (locale.name() == lang_code) { + const QLocale locale(language); + if (language.contains('_')) { + if (locale.name() == language) { name = locale.nativeLanguageName() + " (" + locale.nativeCountryName() + ")"; } else { name = locale.nativeLanguageName() + " (" + language + ")"; diff --git a/src/main.cpp b/src/main.cpp index 974404f..bf16c65 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ /*********************************************************************** * - * Copyright (C) 2009, 2012, 2013, 2014, 2015, 2018 Graeme Gott + * Copyright (C) 2009, 2012, 2013, 2014, 2015, 2018, 2019 Graeme Gott * * 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 @@ -24,7 +24,7 @@ #include int main(int argc, char** argv) { -#if !defined(Q_OS_MAC) && (QT_VERSION >= QT_VERSION_CHECK(5,6,0)) +#if !defined(Q_OS_MAC) if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO") && !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") && !qEnvironmentVariableIsSet("QT_SCALE_FACTOR") @@ -40,6 +40,7 @@ app.setOrganizationName("GottCode"); #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) app.setWindowIcon(QIcon::fromTheme("connectagram", QIcon(":/connectagram.png"))); + app.setDesktopFileName("connectagram"); #endif app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); diff --git a/src/new_game_dialog.cpp b/src/new_game_dialog.cpp index b3fc193..3b06621 100644 --- a/src/new_game_dialog.cpp +++ b/src/new_game_dialog.cpp @@ -1,6 +1,6 @@ /*********************************************************************** * - * Copyright (C) 2009, 2013, 2014, 2015 Graeme Gott + * Copyright (C) 2009, 2013, 2014, 2015, 2019 Graeme Gott * * 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 @@ -95,10 +95,11 @@ contents_layout->addRow(tr("Word Length:"), m_word_length_box); QVBoxLayout* layout = new QVBoxLayout(this); + const int margin = layout->contentsMargins().top(); layout->addLayout(contents_layout); - layout->addSpacing(layout->margin()); + layout->addSpacing(margin); layout->addWidget(patterns); - layout->addSpacing(layout->margin()); + layout->addSpacing(margin); layout->addWidget(buttons); // Load settings diff --git a/src/window.cpp b/src/window.cpp index 4689ef9..16a5127 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1,6 +1,6 @@ /*********************************************************************** * - * Copyright (C) 2009, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Graeme Gott + * Copyright (C) 2009, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Graeme Gott * * 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 @@ -138,7 +138,7 @@ connect(m_board, &Board::loading, m_clock, &Clock::setLoading); QHBoxLayout* overlay_layout = new QHBoxLayout(overlay); - overlay_layout->setMargin(0); + overlay_layout->setContentsMargins(0, 0, 0, 0); overlay_layout->setSpacing(0); overlay_layout->addSpacing(10); overlay_layout->addWidget(m_definitions_button); @@ -150,7 +150,7 @@ // Lay out board QGridLayout* layout = new QGridLayout(contents); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addWidget(view, 0, 0); layout->addWidget(m_success, 0, 0, Qt::AlignCenter); @@ -262,7 +262,7 @@ QMessageBox::about(this, tr("About"), QString("

    %1 %2
    %3
    %4
    %5

    %6

    ") .arg(tr("Connectagram"), QCoreApplication::applicationVersion(), tr("A word unscrambling game"), - tr("Copyright © 2009-%1 by Graeme Gott").arg("2018"), + tr("Copyright © 2009-%1 by Graeme Gott").arg("2019"), tr("Released under the GPL 3 license"), tr("Definitions are from Wiktionary")) ); diff --git a/windows/installer.nsi b/windows/installer.nsi index 7aa64b2..1443938 100644 --- a/windows/installer.nsi +++ b/windows/installer.nsi @@ -4,7 +4,7 @@ !define APPNAME "Connectagram" !define VERSIONMAJOR 1 !define VERSIONMINOR 2 -!define VERSIONPATCH 9 +!define VERSIONPATCH 10 !define APPVERSION "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONPATCH}" !define ABOUTURL "https://gottcode.org/connectagram/" @@ -26,7 +26,7 @@ OutFile "${APPNAME}_${APPVERSION}.exe" ;Default installation folder -InstallDir "$PROGRAMFILES\${APPNAME}" +InstallDir "$PROGRAMFILES64\${APPNAME}" InstallDirRegKey HKLM "Software\${APPNAME}" "" ;Request application privileges for Windows Vista diff --git a/windows_deploy.bat b/windows_deploy.bat index 8751f8e..bc7c63c 100644 --- a/windows_deploy.bat +++ b/windows_deploy.bat @@ -3,7 +3,7 @@ @ECHO OFF SET APP=Connectagram -SET VERSION=1.2.9 +SET VERSION=1.2.10 ECHO Copying executable MKDIR %APP%