diff --git a/components/Notifier.qml b/components/Notifier.qml index 1e842e84..127de390 100644 --- a/components/Notifier.qml +++ b/components/Notifier.qml @@ -29,13 +29,14 @@ import QtQuick 2.9 import QtQuick.Controls 1.4 import moneroComponents.Wallet 1.0 +import "." as MoneroComponents Item { id: item property string message: "" property bool active: false - height: 120 - width: 240 + height: 180 + width: 320 property int margin: 15 x: parent.width - width - margin y: parent.height - height * scale.yScale - margin * scale.yScale @@ -51,11 +52,12 @@ Item { backgroundVisible: false textFormat: TextEdit.AutoText anchors.fill: parent - font.family: "Arial" + font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 12 textMargin: 20 textColor: "white" text: item.message + wrapMode: Text.WrapAnywhere } } @@ -70,7 +72,7 @@ Item { Timer { id: hider - interval: 12000; running: false; repeat: false + interval: 30000; running: false; repeat: false onTriggered: { item.active = false } } diff --git a/main.cpp b/main.cpp index e74dada3..38125988 100644 --- a/main.cpp +++ b/main.cpp @@ -77,9 +77,10 @@ bool isIOS = false; bool isAndroid = false; bool isWindows = false; +bool isMac = false; +bool isLinux = false; bool isDesktop = false; bool isOpenGL = true; -bool isLinux = false; int main(int argc, char *argv[]) { @@ -97,6 +98,8 @@ int main(int argc, char *argv[]) bool isWindows = true; #elif defined(Q_OS_LINUX) bool isLinux = true; +#elif defined(Q_OS_MAC) + bool isMac = true; #endif // detect low graphics mode (start-low-graphics-mode.bat) @@ -311,6 +314,8 @@ int main(int argc, char *argv[]) #endif engine.rootContext()->setContextProperty("isWindows", isWindows); + engine.rootContext()->setContextProperty("isMac", isMac); + engine.rootContext()->setContextProperty("isLinux", isLinux); engine.rootContext()->setContextProperty("isIOS", isIOS); engine.rootContext()->setContextProperty("isAndroid", isAndroid); engine.rootContext()->setContextProperty("isOpenGL", isOpenGL); diff --git a/main.qml b/main.qml index 17d027e8..1688e38d 100644 --- a/main.qml +++ b/main.qml @@ -2001,15 +2001,23 @@ ApplicationWindow { print("Update found: " + update) var parts = update.split("|") if (parts.length == 4) { - var version = parts[0] - var hash = parts[1] - var user_url = parts[2] - var auto_url = parts[3] - var msg = qsTr("New version of monero-wallet-gui is available: %1
%2").arg(version).arg(user_url) + translationManager.emptyString - notifier.show(msg) - } - else { - print("Failed to parse update spec") + var version = parts[0] + var hash = parts[1] + //var user_url = parts[2] + //var auto_url = parts[3] + var osBuildTag = isMac ? "mac-x64" : isWindows ? "win-x64" : isLinux ? "linux-x64" : "unknownBuildTag" + var extension = isMac || isLinux ? ".tar.bz2" : isWindows ? ".zip" : ".unknownExtension" + var base_url = "https://downloads.getmonero.org/gui/monero-gui-" + var download_url = base_url + osBuildTag + "-v" + version + extension + var msg = "" + if (osBuildTag !== "unknownBuildTag") { + msg = qsTr("New version of Monero v.%1 is available.

Download:
%2

SHA256 Hash:
%3").arg(version).arg(download_url).arg(hash) + translationManager.emptyString + } else { + msg = qsTr("New version of Monero is available. Check out getmonero.org") + translationManager.emptyString + } + notifier.show(msg) + } else { + print("Failed to parse update spec") } }