Merge pull request #2100

171e1fc Fix checking for gui updates (mmbyday)
This commit is contained in:
luigi1111 2019-05-03 12:46:42 -05:00
commit 34e46eda64
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010
3 changed files with 29 additions and 14 deletions

View File

@ -29,13 +29,14 @@
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import moneroComponents.Wallet 1.0 import moneroComponents.Wallet 1.0
import "." as MoneroComponents
Item { Item {
id: item id: item
property string message: "" property string message: ""
property bool active: false property bool active: false
height: 120 height: 180
width: 240 width: 320
property int margin: 15 property int margin: 15
x: parent.width - width - margin x: parent.width - width - margin
y: parent.height - height * scale.yScale - margin * scale.yScale y: parent.height - height * scale.yScale - margin * scale.yScale
@ -51,11 +52,12 @@ Item {
backgroundVisible: false backgroundVisible: false
textFormat: TextEdit.AutoText textFormat: TextEdit.AutoText
anchors.fill: parent anchors.fill: parent
font.family: "Arial" font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: 12 font.pixelSize: 12
textMargin: 20 textMargin: 20
textColor: "white" textColor: "white"
text: item.message text: item.message
wrapMode: Text.WrapAnywhere
} }
} }
@ -70,7 +72,7 @@ Item {
Timer { Timer {
id: hider id: hider
interval: 12000; running: false; repeat: false interval: 30000; running: false; repeat: false
onTriggered: { item.active = false } onTriggered: { item.active = false }
} }

View File

@ -78,9 +78,10 @@
bool isIOS = false; bool isIOS = false;
bool isAndroid = false; bool isAndroid = false;
bool isWindows = false; bool isWindows = false;
bool isMac = false;
bool isLinux = false;
bool isDesktop = false; bool isDesktop = false;
bool isOpenGL = true; bool isOpenGL = true;
bool isLinux = false;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -98,6 +99,8 @@ int main(int argc, char *argv[])
bool isWindows = true; bool isWindows = true;
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
bool isLinux = true; bool isLinux = true;
#elif defined(Q_OS_MAC)
bool isMac = true;
#endif #endif
// detect low graphics mode (start-low-graphics-mode.bat) // detect low graphics mode (start-low-graphics-mode.bat)
@ -316,6 +319,8 @@ int main(int argc, char *argv[])
#endif #endif
engine.rootContext()->setContextProperty("isWindows", isWindows); engine.rootContext()->setContextProperty("isWindows", isWindows);
engine.rootContext()->setContextProperty("isMac", isMac);
engine.rootContext()->setContextProperty("isLinux", isLinux);
engine.rootContext()->setContextProperty("isIOS", isIOS); engine.rootContext()->setContextProperty("isIOS", isIOS);
engine.rootContext()->setContextProperty("isAndroid", isAndroid); engine.rootContext()->setContextProperty("isAndroid", isAndroid);
engine.rootContext()->setContextProperty("isOpenGL", isOpenGL); engine.rootContext()->setContextProperty("isOpenGL", isOpenGL);

View File

@ -2003,12 +2003,20 @@ ApplicationWindow {
if (parts.length == 4) { if (parts.length == 4) {
var version = parts[0] var version = parts[0]
var hash = parts[1] var hash = parts[1]
var user_url = parts[2] //var user_url = parts[2]
var auto_url = parts[3] //var auto_url = parts[3]
var msg = qsTr("New version of monero-wallet-gui is available: %1<br>%2").arg(version).arg(user_url) + translationManager.emptyString var osBuildTag = isMac ? "mac-x64" : isWindows ? "win-x64" : isLinux ? "linux-x64" : "unknownBuildTag"
notifier.show(msg) 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.<br><br>Download:<br>%2<br><br>SHA256 Hash:<br>%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
} }
else { notifier.show(msg)
} else {
print("Failed to parse update spec") print("Failed to parse update spec")
} }
} }