Skip to content

Commit

Permalink
Fix checking for gui updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mmbyday committed Apr 29, 2019
1 parent ff6ce62 commit a23abc3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
10 changes: 6 additions & 4 deletions components/Notifier.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}

Expand All @@ -70,7 +72,7 @@ Item {

Timer {
id: hider
interval: 12000; running: false; repeat: false
interval: 30000; running: false; repeat: false
onTriggered: { item.active = false }
}

Expand Down
7 changes: 6 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,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[])
{
Expand All @@ -91,6 +92,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)
Expand Down Expand Up @@ -275,6 +278,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);
Expand Down
10 changes: 7 additions & 3 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1953,9 +1953,13 @@ ApplicationWindow {
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<br>%2").arg(version).arg(user_url) + translationManager.emptyString
//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 = 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
notifier.show(msg)
}
else {
Expand Down

0 comments on commit a23abc3

Please sign in to comment.