Compare commits

...

32 Commits

Author SHA1 Message Date
luigi1111
fed00a5662 Merge pull request #3269
14a4777 build: prepare v0.17.1.7 (selsta)
2020-12-12 22:16:13 -06:00
luigi1111
79f2843b09 Merge pull request #3268
cebb789 Wallet: fix initialization flag handling (xiphon)
2020-12-12 22:15:10 -06:00
selsta
14a477748e build: prepare v0.17.1.7 2020-12-13 05:11:20 +01:00
xiphon
cebb78979c Wallet: fix initialization flag handling 2020-12-12 11:22:52 +00:00
Alexander Blair
df771470c2 Merge pull request #3267
90e9968d main: get back "Sending transaction ..." splash (xiphon)
2020-12-10 18:02:11 -08:00
Alexander Blair
e359c60f00 Merge pull request #3266
841d0e01 Utils: removeTrailingZeros - handle .0* decimal part (i.e. 1.00000) (xiphon)
2020-12-10 18:01:38 -08:00
Alexander Blair
53335a8487 Merge pull request #3264
2feee9e9 workflows: shorten name (selsta)
2020-12-10 18:01:19 -08:00
Alexander Blair
3f64312283 Merge pull request #3262
486ba055 main: disable QML cache (xiphon)
2020-12-10 17:59:09 -08:00
Alexander Blair
897946af13 Merge pull request #3260
ae8394e5 main: Linux - fix missing askDesktopShortcut setting (xiphon)
2020-12-10 17:58:42 -08:00
Alexander Blair
e90626e05a Merge pull request #3259
fa79e609 workflows: bump docker cache action (selsta)
2020-12-10 17:58:06 -08:00
xiphon
90e9968dcb main: get back "Sending transaction ..." splash 2020-12-10 23:59:12 +00:00
xiphon
841d0e01dc Utils: removeTrailingZeros - handle .0* decimal part (i.e. 1.00000) 2020-12-10 23:00:39 +00:00
selsta
2feee9e956 workflows: shorten name 2020-12-10 04:01:43 +01:00
xiphon
486ba05526 main: disable QML cache 2020-12-09 14:29:02 +00:00
xiphon
ae8394e5f8 main: Linux - fix missing askDesktopShortcut setting 2020-12-08 01:02:00 +00:00
selsta
fa79e609e1 workflows: bump docker cache action 2020-12-07 19:22:37 +01:00
luigi1111
cc352e4913 Merge pull request #3258
903539b build: prepare v0.17.1.6 (selsta)
2020-12-07 10:37:31 -06:00
selsta
903539bd30 build: prepare v0.17.1.6 2020-12-07 17:34:40 +01:00
Alexander Blair
af0b3142a0 Merge pull request #3255
606dbed4 README: update Linux Docker build instructions (xiphon)
2020-12-03 12:24:50 -08:00
Alexander Blair
6fe41e6f55 Merge pull request #3254
0d5d2dbf Transfer: fix focus, cycle focus between Address, Amount and Send (xiphon)
2020-12-03 12:24:22 -08:00
Alexander Blair
2a6ad67f77 Merge pull request #3253
110b09ef TxConfirmationDialog: fix keys handling (xiphon)
2020-12-03 12:23:58 -08:00
Alexander Blair
5652284572 Merge pull request #3252
0fdf81bc SuccessfulTxDialog: fix keys handling (xiphon)
2020-12-03 12:23:24 -08:00
Alexander Blair
2eeeadfd10 Merge pull request #3251
ea1fee2f main: Linux - ask to create desktop entry on the first start (xiphon)
2020-12-03 12:23:02 -08:00
xiphon
0d5d2dbf5e Transfer: fix focus, cycle focus between Address, Amount and Send 2020-12-03 19:40:15 +00:00
xiphon
606dbed4a0 README: update Linux Docker build instructions 2020-12-03 00:55:29 +00:00
Alexander Blair
301b20d19c Merge pull request #3249
ef54a32d workflows: print hash for reproducible builds (selsta)
2020-12-01 14:25:22 -08:00
Alexander Blair
f6196d48ab Merge pull request #3169
cd3a0f85 Restore: display red border if invalid seed (rating89us)
2020-12-01 14:25:01 -08:00
xiphon
110b09efba TxConfirmationDialog: fix keys handling 2020-12-01 16:25:35 +00:00
xiphon
0fdf81bc92 SuccessfulTxDialog: fix keys handling 2020-12-01 16:19:56 +00:00
xiphon
ea1fee2f5f main: Linux - ask to create desktop entry on the first start 2020-11-30 15:36:19 +00:00
selsta
ef54a32de0 workflows: print hash for reproducible builds 2020-11-26 10:34:19 +01:00
rating89us
cd3a0f85a6 Restore: display red border if invalid seed 2020-10-18 17:06:34 +02:00
20 changed files with 108 additions and 124 deletions

View File

@@ -1,4 +1,4 @@
name: continuous-integration/gh-actions/gui name: ci/gh-actions/gui
on: [push, pull_request] on: [push, pull_request]
@@ -93,7 +93,7 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:
submodules: recursive submodules: recursive
- uses: satackey/action-docker-layer-caching@v0.0.8 - uses: satackey/action-docker-layer-caching@v0.0.10
continue-on-error: true continue-on-error: true
with: with:
key: docker-linux-static-{hash} key: docker-linux-static-{hash}
@@ -103,6 +103,8 @@ jobs:
run: docker build --tag monero:build-env-linux --build-arg THREADS=3 --file Dockerfile.linux . run: docker build --tag monero:build-env-linux --build-arg THREADS=3 --file Dockerfile.linux .
- name: build - name: build
run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static -j3' run: docker run --rm -v /home/runner/work/monero-gui/monero-gui:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'make release-static -j3'
- name: sha256sum
run: shasum -a256 /home/runner/work/monero-gui/monero-gui/build/release/bin/monero-wallet-gui
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: ${{ github.job }} name: ${{ github.job }}
@@ -116,7 +118,7 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:
submodules: recursive submodules: recursive
- uses: satackey/action-docker-layer-caching@v0.0.8 - uses: satackey/action-docker-layer-caching@v0.0.10
continue-on-error: true continue-on-error: true
with: with:
key: docker-windows-static-{hash} key: docker-windows-static-{hash}

View File

@@ -5,7 +5,7 @@ message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
set(VERSION_MAJOR "17") set(VERSION_MAJOR "17")
set(VERSION_MINOR "1") set(VERSION_MINOR "1")
set(VERSION_REVISION "5") set(VERSION_REVISION "7")
set(VERSION "0.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}") set(VERSION "0.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
option(STATIC "Link libraries statically, requires static Qt") option(STATIC "Link libraries statically, requires static Qt")

View File

@@ -102,13 +102,14 @@ Packaging for your favorite distribution would be a welcome contribution!
\* `4` - number of CPU threads to use \* `4` - number of CPU threads to use
5. Monero GUI Windows static binaries will be placed in `monero-gui/build/x86_64-w64-mingw32/release/bin` directory 5. Monero GUI Windows static binaries will be placed in `monero-gui/build/x86_64-w64-mingw32/release/bin` directory
### Building Linux static binaries with Docker (any OS) ### Building Reproducible Linux static binaries with Docker (any OS)
1. Install Docker [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/) 1. Install Docker [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)
2. Clone the repository 2. Clone the repository
``` ```
git clone --recursive https://github.com/monero-project/monero-gui.git git clone --branch master --recursive https://github.com/monero-project/monero-gui.git
``` ```
\* `master` - replace with the desired version tag (e.g. `v0.17.1.5`) to build the release binaries.
3. Prepare build environment 3. Prepare build environment
``` ```
cd monero-gui cd monero-gui
@@ -123,6 +124,11 @@ Packaging for your favorite distribution would be a welcome contribution!
\* `<MONERO_GUI_DIR_FULL_PATH>` - absolute path to `monero-gui` directory \* `<MONERO_GUI_DIR_FULL_PATH>` - absolute path to `monero-gui` directory
\* `4` - number of CPU threads to use \* `4` - number of CPU threads to use
5. Monero GUI Linux static binaries will be placed in `monero-gui/build/release/bin` directory 5. Monero GUI Linux static binaries will be placed in `monero-gui/build/release/bin` directory
6. (*Optional*) Compare `monero-wallet-gui` SHA-256 hash to the one obtained from a trusted source
```
docker run --rm -it -v <MONERO_GUI_DIR_FULL_PATH>:/monero-gui -w /monero-gui monero:build-env-linux sh -c 'shasum -a 256 /monero-gui/build/release/bin/monero-wallet-gui'
```
\* `<MONERO_GUI_DIR_FULL_PATH>` - absolute path to `monero-gui` directory
### Building Android APK with Docker (any OS) *Experimental* ### Building Android APK with Docker (any OS) *Experimental*
- Minimum Android 9 Pie (API 28) - Minimum Android 9 Pie (API 28)

View File

@@ -94,6 +94,7 @@ Item {
height: showingHeader ? (inputLabel.height + inputItem.height + 2) : 42 height: showingHeader ? (inputLabel.height + inputItem.height + 2) : 42
onActiveFocusChanged: activeFocus && input.forceActiveFocus()
onTextUpdated: { onTextUpdated: {
// check to remove placeholder text when there is content // check to remove placeholder text when there is content
if(item.isEmpty()){ if(item.isEmpty()){
@@ -234,6 +235,7 @@ Item {
anchors.leftMargin: inlineIcon.visible ? 44 : 0 anchors.leftMargin: inlineIcon.visible ? 44 : 0
font.pixelSize: item.fontSize font.pixelSize: item.fontSize
font.bold: item.fontBold font.bold: item.fontBold
KeyNavigation.tab: item.KeyNavigation.tab
onEditingFinished: item.editingFinished() onEditingFinished: item.editingFinished()
onAccepted: item.accepted(); onAccepted: item.accepted();
onTextChanged: item.textUpdated() onTextChanged: item.textUpdated()

View File

@@ -94,6 +94,8 @@ ColumnLayout {
signal inputLabelLinkActivated(); signal inputLabelLinkActivated();
signal editingFinished(); signal editingFinished();
onActiveFocusChanged: activeFocus && input.forceActiveFocus()
spacing: 0 spacing: 0
Rectangle { Rectangle {
id: inputLabelRect id: inputLabelRect
@@ -159,8 +161,10 @@ ColumnLayout {
id: input id: input
readOnly: false readOnly: false
addressValidation: false addressValidation: false
KeyNavigation.priority: KeyNavigation.BeforeItem
KeyNavigation.tab: item.KeyNavigation.tab
Layout.fillWidth: true Layout.fillWidth: true
leftPadding: item.inputPaddingLeft leftPadding: item.inputPaddingLeft
rightPadding: item.inputPaddingRight rightPadding: item.inputPaddingRight
topPadding: item.inputPaddingTop topPadding: item.inputPaddingTop

View File

@@ -68,7 +68,7 @@ Item {
id: buttonRect id: buttonRect
anchors.fill: parent anchors.fill: parent
radius: 3 radius: 3
border.width: parent.focus ? 1 : 0 border.width: parent.focus && parent.enabled ? 1 : 0
state: button.enabled ? "active" : "disabled" state: button.enabled ? "active" : "disabled"
Component.onCompleted: state = state Component.onCompleted: state = state
@@ -76,7 +76,7 @@ Item {
states: [ states: [
State { State {
name: "hover" name: "hover"
when: buttonArea.containsMouse || button.focus when: button.enabled && (buttonArea.containsMouse || button.focus)
PropertyChanges { PropertyChanges {
target: buttonRect target: buttonRect
color: primary color: primary

View File

@@ -45,20 +45,11 @@ Rectangle {
radius: 10 radius: 10
border.color: MoneroComponents.Style.blackTheme ? Qt.rgba(255, 255, 255, 0.25) : Qt.rgba(0, 0, 0, 0.25) border.color: MoneroComponents.Style.blackTheme ? Qt.rgba(255, 255, 255, 0.25) : Qt.rgba(0, 0, 0, 0.25)
border.width: 1 border.width: 1
focus: true
Keys.enabled: true Keys.enabled: true
Keys.onEscapePressed: { Keys.onEscapePressed: {
root.close() root.close()
root.rejected() root.rejected()
} }
Keys.onEnterPressed: {
root.close()
root.accepted()
}
Keys.onReturnPressed: {
root.close()
root.accepted()
}
KeyNavigation.tab: doneButton KeyNavigation.tab: doneButton
Clipboard { id: clipboard } Clipboard { id: clipboard }
@@ -72,7 +63,6 @@ Rectangle {
function open(txid) { function open(txid) {
root.transactionID = txid; root.transactionID = txid;
root.visible = true; root.visible = true;
root.forceActiveFocus();
} }
function close() { function close() {
@@ -156,13 +146,6 @@ Rectangle {
text: qsTr("Open folder") + translationManager.emptyString; text: qsTr("Open folder") + translationManager.emptyString;
width: 200 width: 200
KeyNavigation.tab: doneButton KeyNavigation.tab: doneButton
Keys.enabled: openFolderButton.visible
Keys.onReturnPressed: openFolderButton.onClicked
Keys.onEnterPressed: openFolderButton.onClicked
Keys.onEscapePressed: {
root.close()
root.rejected()
}
onClicked: { onClicked: {
oshelper.openContainingFolder(walletManager.urlToLocalPath(saveTxDialog.fileUrl)) oshelper.openContainingFolder(walletManager.urlToLocalPath(saveTxDialog.fileUrl))
} }
@@ -172,15 +155,8 @@ Rectangle {
id: doneButton id: doneButton
text: qsTr("Done") + translationManager.emptyString; text: qsTr("Done") + translationManager.emptyString;
width: 200 width: 200
focus: true focus: root.visible
KeyNavigation.tab: openFolderButton KeyNavigation.tab: openFolderButton
Keys.enabled: doneButton.visible
Keys.onReturnPressed: doneButton.onClicked
Keys.onEnterPressed: doneButton.onClicked
Keys.onEscapePressed: {
root.close()
root.rejected()
}
onClicked: { onClicked: {
root.close() root.close()
root.accepted() root.accepted()

View File

@@ -45,33 +45,12 @@ Rectangle {
radius: 10 radius: 10
border.color: MoneroComponents.Style.blackTheme ? Qt.rgba(255, 255, 255, 0.25) : Qt.rgba(0, 0, 0, 0.25) border.color: MoneroComponents.Style.blackTheme ? Qt.rgba(255, 255, 255, 0.25) : Qt.rgba(0, 0, 0, 0.25)
border.width: 1 border.width: 1
focus: true
Keys.enabled: true Keys.enabled: true
Keys.onEscapePressed: { Keys.onEscapePressed: {
root.close() root.close()
root.clearFields() root.clearFields()
root.rejected() root.rejected()
} }
Keys.onEnterPressed: {
if (root.state == "default") {
root.close()
root.accepted()
} else if (root.state == "error") {
root.close()
root.clearFields()
root.rejected()
}
}
Keys.onReturnPressed: {
if (root.state == "default") {
root.close()
root.accepted()
} else if (root.state == "error") {
root.close()
root.clearFields()
root.rejected()
}
}
KeyNavigation.tab: confirmButton KeyNavigation.tab: confirmButton
property var transactionAmount: "" property var transactionAmount: ""
@@ -101,7 +80,7 @@ Rectangle {
PropertyChanges { target: bottomMessage; visible: false } PropertyChanges { target: bottomMessage; visible: false }
PropertyChanges { target: buttons; visible: true } PropertyChanges { target: buttons; visible: true }
PropertyChanges { target: backButton; visible: true; primary: false } PropertyChanges { target: backButton; visible: true; primary: false }
PropertyChanges { target: confirmButton; visible: true } PropertyChanges { target: confirmButton; visible: true; focus: true }
}, State { }, State {
// error message being displayed, show only back button // error message being displayed, show only back button
name: "error"; name: "error";
@@ -115,7 +94,7 @@ Rectangle {
PropertyChanges { target: bottom; visible: true } PropertyChanges { target: bottom; visible: true }
PropertyChanges { target: bottomMessage; visible: false } PropertyChanges { target: bottomMessage; visible: false }
PropertyChanges { target: buttons; visible: true } PropertyChanges { target: buttons; visible: true }
PropertyChanges { target: backButton; visible: true; primary: true } PropertyChanges { target: backButton; visible: true; primary: true; focus: true }
PropertyChanges { target: confirmButton; visible: false } PropertyChanges { target: confirmButton; visible: false }
}, State { }, State {
// creating or sending transaction, show tx details and don't show any button // creating or sending transaction, show tx details and don't show any button
@@ -141,7 +120,6 @@ Rectangle {
//clean previous error message //clean previous error message
errorText.text = ""; errorText.text = "";
root.forceActiveFocus()
} }
function close() { function close() {
@@ -422,17 +400,8 @@ Rectangle {
id: backButton id: backButton
text: qsTr("Back") + translationManager.emptyString; text: qsTr("Back") + translationManager.emptyString;
width: 200 width: 200
focus: false
primary: false primary: false
KeyNavigation.tab: confirmButton KeyNavigation.tab: confirmButton
Keys.enabled: backButton.visible
Keys.onReturnPressed: backButton.onClicked
Keys.onEnterPressed: backButton.onClicked
Keys.onEscapePressed: {
root.close()
root.clearFields()
root.rejected()
}
onClicked: { onClicked: {
root.close() root.close()
root.clearFields() root.clearFields()
@@ -445,16 +414,7 @@ Rectangle {
text: qsTr("Confirm") + translationManager.emptyString; text: qsTr("Confirm") + translationManager.emptyString;
rightIcon: "qrc:///images/rightArrow.png" rightIcon: "qrc:///images/rightArrow.png"
width: 200 width: 200
focus: false
KeyNavigation.tab: backButton KeyNavigation.tab: backButton
Keys.enabled: confirmButton.visible
Keys.onReturnPressed: confirmButton.onClicked
Keys.onEnterPressed: confirmButton.onClicked
Keys.onEscapePressed: {
root.close()
root.clearFields()
root.rejected()
}
onClicked: { onClicked: {
root.close() root.close()
root.accepted() root.accepted()

View File

@@ -113,5 +113,5 @@ function capitalize(s){
} }
function removeTrailingZeros(value) { function removeTrailingZeros(value) {
return (value + '').replace(/(\.\d*[1-9])0+$/, '$1'); return (value + '').replace(/\.?0*$/, '');
} }

View File

@@ -952,10 +952,12 @@ ApplicationWindow {
// Store to file // Store to file
transaction.setFilename(path); transaction.setFilename(path);
} }
appWindow.showProcessingSplash(qsTr("Sending transaction ..."));
currentWallet.commitTransactionAsync(transaction); currentWallet.commitTransactionAsync(transaction);
} }
function onTransactionCommitted(success, transaction, txid) { function onTransactionCommitted(success, transaction, txid) {
hideProcessingSplash();
if (!success) { if (!success) {
console.log("Error committing transaction: " + transaction.errorString); console.log("Error committing transaction: " + transaction.errorString);
informationPopup.title = qsTr("Error") + translationManager.emptyString informationPopup.title = qsTr("Error") + translationManager.emptyString
@@ -1332,6 +1334,25 @@ ApplicationWindow {
appWindow.fiatApiRefresh(); appWindow.fiatApiRefresh();
appWindow.fiatTimerStart(); appWindow.fiatTimerStart();
} }
if (persistentSettings.askDesktopShortcut && !persistentSettings.portable) {
persistentSettings.askDesktopShortcut = false;
if (isTails) {
oshelper.createDesktopEntry();
} else if (isLinux) {
confirmationDialog.title = qsTr("Desktop entry") + translationManager.emptyString;
confirmationDialog.text = qsTr("Would you like to register Monero GUI Desktop entry?") + translationManager.emptyString;
confirmationDialog.icon = StandardIcon.Question;
confirmationDialog.cancelText = qsTr("No") + translationManager.emptyString;
confirmationDialog.okText = qsTr("Yes") + translationManager.emptyString;
confirmationDialog.onAcceptedCallback = function() {
oshelper.createDesktopEntry();
};
confirmationDialog.onRejectedCallback = null;
confirmationDialog.open();
}
}
} }
MoneroSettings { MoneroSettings {
@@ -1342,6 +1363,7 @@ ApplicationWindow {
return ""; return "";
} }
property bool askDesktopShortcut: isLinux
property string language: 'English (US)' property string language: 'English (US)'
property string language_wallet: 'English' property string language_wallet: 'English'
property string locale: 'en_US' property string locale: 'en_US'

2
monero

Submodule monero updated: 3942a1cd04...54a4071473

View File

@@ -170,6 +170,7 @@ Rectangle {
LineEditMulti { LineEditMulti {
id: addressLine id: addressLine
KeyNavigation.tab: amountLine
spacing: 0 spacing: 0
inputPaddingRight: inlineButtonVisible && inlineButton2Visible ? 100 : 60 inputPaddingRight: inlineButtonVisible && inlineButton2Visible ? 100 : 60
fontBold: true fontBold: true
@@ -277,6 +278,7 @@ Rectangle {
// Amount input // Amount input
LineEdit { LineEdit {
id: amountLine id: amountLine
KeyNavigation.tab: sendButton
Layout.fillWidth: true Layout.fillWidth: true
inlineIcon: true inlineIcon: true
labelText: "<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\ labelText: "<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\
@@ -488,6 +490,7 @@ Rectangle {
RowLayout { RowLayout {
StandardButton { StandardButton {
id: sendButton id: sendButton
KeyNavigation.tab: addressLine
rightIcon: "qrc:///images/rightArrow.png" rightIcon: "qrc:///images/rightArrow.png"
rightIconInactive: "qrc:///images/rightArrowInactive.png" rightIconInactive: "qrc:///images/rightArrowInactive.png"
Layout.topMargin: 4 Layout.topMargin: 4

View File

@@ -104,10 +104,7 @@ void Wallet::updateConnectionStatusAsync()
setConnectionStatus(ConnectionStatus_Connecting); setConnectionStatus(ConnectionStatus_Connecting);
} }
ConnectionStatus newStatus = static_cast<ConnectionStatus>(m_walletImpl->connected()); ConnectionStatus newStatus = static_cast<ConnectionStatus>(m_walletImpl->connected());
if (newStatus != m_connectionStatus || !m_initialized) { setConnectionStatus(newStatus);
m_initialized = true;
setConnectionStatus(newStatus);
}
// Release lock // Release lock
m_connectionStatusRunning = false; m_connectionStatusRunning = false;
}); });
@@ -115,8 +112,13 @@ void Wallet::updateConnectionStatusAsync()
Wallet::ConnectionStatus Wallet::connected(bool forceCheck) Wallet::ConnectionStatus Wallet::connected(bool forceCheck)
{ {
if (!m_initialized)
{
return ConnectionStatus_Connecting;
}
// cache connection status // cache connection status
if (forceCheck || !m_initialized || (m_connectionStatusTime.elapsed() / 1000 > m_connectionStatusTtl && !m_connectionStatusRunning) || m_connectionStatusTime.elapsed() > 30000) { if (forceCheck || (m_connectionStatusTime.elapsed() / 1000 > m_connectionStatusTtl && !m_connectionStatusRunning) || m_connectionStatusTime.elapsed() > 30000) {
qDebug() << "Checking connection status"; qDebug() << "Checking connection status";
m_connectionStatusRunning = true; m_connectionStatusRunning = true;
m_connectionStatusTime.restart(); m_connectionStatusTime.restart();
@@ -277,14 +279,25 @@ void Wallet::initAsync(
{ {
qDebug() << "initAsync: " + daemonAddress; qDebug() << "initAsync: " + daemonAddress;
const auto future = m_scheduler.run([this, daemonAddress, trustedDaemon, upperTransactionLimit, isRecovering, isRecoveringFromDevice, restoreHeight, proxyAddress] { const auto future = m_scheduler.run([this, daemonAddress, trustedDaemon, upperTransactionLimit, isRecovering, isRecoveringFromDevice, restoreHeight, proxyAddress] {
bool success = init(daemonAddress, trustedDaemon, upperTransactionLimit, isRecovering, isRecoveringFromDevice, restoreHeight, proxyAddress); m_initialized = init(
if (success) daemonAddress,
trustedDaemon,
upperTransactionLimit,
isRecovering,
isRecoveringFromDevice,
restoreHeight,
proxyAddress);
if (m_initialized)
{ {
emit walletCreationHeightChanged(); emit walletCreationHeightChanged();
qDebug() << "init async finished - starting refresh"; qDebug() << "init async finished - starting refresh";
connected(true); connected(true);
startRefresh(); startRefresh();
} }
else
{
qCritical() << "Failed to initialize the wallet";
}
}); });
if (future.first) if (future.first)
{ {
@@ -1054,6 +1067,7 @@ Wallet::Wallet(Monero::Wallet *w, QObject *parent)
, m_connectionStatus(Wallet::ConnectionStatus_Disconnected) , m_connectionStatus(Wallet::ConnectionStatus_Disconnected)
, m_connectionStatusTtl(WALLET_CONNECTION_STATUS_CACHE_TTL_SECONDS) , m_connectionStatusTtl(WALLET_CONNECTION_STATUS_CACHE_TTL_SECONDS)
, m_disconnected(true) , m_disconnected(true)
, m_initialized(false)
, m_currentSubaddressAccount(0) , m_currentSubaddressAccount(0)
, m_subaddress(nullptr) , m_subaddress(nullptr)
, m_subaddressModel(nullptr) , m_subaddressModel(nullptr)
@@ -1074,7 +1088,6 @@ Wallet::Wallet(Monero::Wallet *w, QObject *parent)
m_connectionStatusTime.start(); m_connectionStatusTime.start();
m_daemonBlockChainHeightTime.start(); m_daemonBlockChainHeightTime.start();
m_daemonBlockChainTargetHeightTime.start(); m_daemonBlockChainTargetHeightTime.start();
m_initialized = false;
m_connectionStatusRunning = false; m_connectionStatusRunning = false;
m_daemonUsername = ""; m_daemonUsername = "";
m_daemonPassword = ""; m_daemonPassword = "";

View File

@@ -29,6 +29,8 @@
#ifndef WALLET_H #ifndef WALLET_H
#define WALLET_H #define WALLET_H
#include <atomic>
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QObject> #include <QObject>
#include <QMutex> #include <QMutex>
@@ -444,7 +446,7 @@ private:
int m_connectionStatusTtl; int m_connectionStatusTtl;
mutable QElapsedTimer m_connectionStatusTime; mutable QElapsedTimer m_connectionStatusTime;
bool m_disconnected; bool m_disconnected;
mutable bool m_initialized; std::atomic<bool> m_initialized;
uint32_t m_currentSubaddressAccount; uint32_t m_currentSubaddressAccount;
Subaddress * m_subaddress; Subaddress * m_subaddress;
mutable SubaddressModel * m_subaddressModel; mutable SubaddressModel * m_subaddressModel;

View File

@@ -194,15 +194,7 @@ int main(int argc, char *argv[])
QDir::setCurrent(QDir(MacOSHelper::bundlePath() + QDir::separator() + "..").canonicalPath()); QDir::setCurrent(QDir(MacOSHelper::bundlePath() + QDir::separator() + "..").canonicalPath());
#endif #endif
if (MoneroSettings::portableConfigExists()) qputenv("QML_DISABLE_DISK_CACHE", "1");
{
const QString cacheDir(MoneroSettings::portableFolderName() + QDir::separator() + ".cache");
if (!qputenv("QML_DISK_CACHE_PATH", cacheDir.toUtf8()))
{
qCritical() << "Error: failed to set QML disk cache path";
return 1;
}
}
MainApp app(argc, argv); MainApp app(argc, argv);
@@ -319,11 +311,6 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw
return 1; return 1;
} }
// Desktop entry
#ifdef Q_OS_LINUX
registerXdgMime(app);
#endif
IPC *ipc = new IPC(&app); IPC *ipc = new IPC(&app);
QStringList posArgs = parser.positionalArguments(); QStringList posArgs = parser.positionalArguments();

View File

@@ -46,11 +46,13 @@
#endif #endif
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#undef Bool
#undef KeyPress #undef KeyPress
#undef KeyRelease #undef KeyRelease
#undef FocusIn #undef FocusIn
#undef FocusOut #undef FocusOut
// #undef those Xlib #defines that conflict with QEvent::Type enum // #undef those Xlib #defines that conflict with QEvent::Type enum
#include "qt/utils.h"
#endif #endif
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
@@ -85,6 +87,13 @@ OSHelper::OSHelper(QObject *parent) : QObject(parent)
} }
void OSHelper::createDesktopEntry() const
{
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
registerXdgMime();
#endif
}
QString OSHelper::downloadLocation() const QString OSHelper::downloadLocation() const
{ {
return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);

View File

@@ -41,6 +41,7 @@ class OSHelper : public QObject
public: public:
explicit OSHelper(QObject *parent = 0); explicit OSHelper(QObject *parent = 0);
Q_INVOKABLE void createDesktopEntry() const;
Q_INVOKABLE QString downloadLocation() const; Q_INVOKABLE QString downloadLocation() const;
Q_INVOKABLE bool openContainingFolder(const QString &filePath) const; Q_INVOKABLE bool openContainingFolder(const QString &filePath) const;
Q_INVOKABLE QString openSaveFileDialog(const QString &title, const QString &folder, const QString &filename) const; Q_INVOKABLE QString openSaveFileDialog(const QString &title, const QString &folder, const QString &filename) const;

View File

@@ -27,7 +27,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QtCore> #include <QtCore>
#include <QApplication> #include <QCoreApplication>
#include <QtGlobal> #include <QtGlobal>
#include "TailsOS.h" #include "TailsOS.h"
@@ -88,7 +88,7 @@ QString getAccountName(){
} }
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
QString xdgMime(QApplication &app){ QString xdgMime(){
return QString( return QString(
"[Desktop Entry]\n" "[Desktop Entry]\n"
"Name=Monero GUI\n" "Name=Monero GUI\n"
@@ -105,32 +105,31 @@ QString xdgMime(QApplication &app){
"StartupNotify=true\n" "StartupNotify=true\n"
"X-GNOME-Bugzilla-Bugzilla=GNOME\n" "X-GNOME-Bugzilla-Bugzilla=GNOME\n"
"X-GNOME-UsesNotifications=true\n" "X-GNOME-UsesNotifications=true\n"
).arg(app.applicationFilePath()); ).arg(QCoreApplication::applicationFilePath());
} }
void registerXdgMime(QApplication &app){ void registerXdgMime(){
// Register desktop entry // Register desktop entry
// - MacOS handled via Info.plist // - MacOS handled via Info.plist
// - Windows handled in the installer by rbrunner7 // - Windows handled in the installer by rbrunner7
// - Linux written to `QStandardPaths::ApplicationsLocation` // - Linux written to `QStandardPaths::ApplicationsLocation`
// - Tails written to persistent dotfiles // - Tails written to persistent dotfiles
QString mime = xdgMime(app); QString mime = xdgMime();
QString appPath = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation); QString appPath = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation);
QString filePath = QString("%1/monero-gui.desktop").arg(appPath); QString filePath = QString("%1/monero-gui.desktop").arg(appPath);
if (TailsOS::detect() && TailsOS::detectDotPersistence() && TailsOS::usePersistence) { if (TailsOS::detect())
TailsOS::persistXdgMime(filePath, mime); {
return; if (TailsOS::detectDotPersistence() && TailsOS::usePersistence)
{
TailsOS::persistXdgMime(filePath, mime);
}
}
else
{
QDir().mkpath(QFileInfo(filePath).path());
fileWrite(filePath, mime);
} }
QFileInfo file(filePath);
QDir().mkpath(file.path()); // ensure directory exists
#ifdef QT_DEBUG
qDebug() << "Writing xdg mime: " << filePath;
#endif
fileWrite(filePath, mime);
} }
#endif #endif

View File

@@ -39,8 +39,8 @@ QByteArray fileOpen(QString path);
bool fileWrite(QString path, QString data); bool fileWrite(QString path, QString data);
QString getAccountName(); QString getAccountName();
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
QString xdgMime(QApplication &app); QString xdgMime();
void registerXdgMime(QApplication &app); void registerXdgMime();
#endif #endif
const static QRegExp reURI = QRegExp("^\\w+:\\/\\/([\\w+\\-?\\-_\\-=\\-&]+)"); const static QRegExp reURI = QRegExp("^\\w+:\\/\\/([\\w+\\-?\\-_\\-=\\-&]+)");
QString randomUserAgent(); QString randomUserAgent();

View File

@@ -50,10 +50,8 @@ Rectangle {
if(wizardController.walletRestoreMode === "keys") { if(wizardController.walletRestoreMode === "keys") {
return wizardWalletInput.verify() && wizardRestoreWallet1.verifyFromKeys(); return wizardWalletInput.verify() && wizardRestoreWallet1.verifyFromKeys();
} else if(wizardController.walletRestoreMode === "seed") { } else if(wizardController.walletRestoreMode === "seed") {
valid = wizardWalletInput.verify(); seedInput.error = seedInput.text && !Wizard.checkSeed(seedInput.text);
if(!valid) return false; return wizardWalletInput.verify() && seedInput.text && Wizard.checkSeed(seedInput.text);
valid = Wizard.checkSeed(seedInput.text);
return valid;
} }
return false; return false;