Added settings page: Info

This commit is contained in:
Sander Ferdinand 2018-07-18 18:23:50 +02:00
parent eb457019dd
commit 6be5e5731e

View file

@ -0,0 +1,212 @@
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import "../../js/Utils.js" as Utils
import "../../components" as MoneroComponents
Rectangle {
color: "transparent"
height: 1400
Layout.fillWidth: true
ColumnLayout {
id: infoLayout
Layout.fillWidth: true
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.topMargin: 0
spacing: 0
GridLayout {
columns: 2
columnSpacing: 0
MoneroComponents.TextBlock {
font.pixelSize: 14
text: qsTr("GUI version: ") + translationManager.emptyString
}
MoneroComponents.TextBlock {
font.pixelSize: 14
text: Version.GUI_VERSION + " (Qt " + qtRuntimeVersion + ")" + translationManager.emptyString
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
MoneroComponents.TextBlock {
id: guiMoneroVersion
font.pixelSize: 14
text: qsTr("Embedded Monero version: ") + translationManager.emptyString
}
MoneroComponents.TextBlock {
font.pixelSize: 14
text: Version.GUI_MONERO_VERSION + translationManager.emptyString
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
MoneroComponents.TextBlock {
Layout.fillWidth: true
font.pixelSize: 14
text: qsTr("Wallet name: ") + translationManager.emptyString
}
MoneroComponents.TextBlock {
Layout.fillWidth: true
font.pixelSize: 14
text: walletName + translationManager.emptyString
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
MoneroComponents.TextBlock {
id: restoreHeight
font.pixelSize: 14
textFormat: Text.RichText
text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet creation height: ") + translationManager.emptyString
}
MoneroComponents.TextBlock {
id: restoreHeightText
textFormat: Text.RichText
font.pixelSize: 14
property var style: "<style type='text/css'>a {cursor:pointer;text-decoration: none; color: #FF6C3C}</style>"
text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" <a href='#'> (change)</a>") + translationManager.emptyString
onLinkActivated: {
inputDialog.labelText = qsTr("Set a new restore height:") + translationManager.emptyString;
inputDialog.inputText = currentWallet ? currentWallet.walletCreationHeight : "0";
inputDialog.onAcceptedCallback = function() {
var _restoreHeight = inputDialog.inputText;
if(Utils.isNumeric(_restoreHeight)){
_restoreHeight = parseInt(_restoreHeight);
if(_restoreHeight >= 0) {
currentWallet.walletCreationHeight = _restoreHeight
// Restore height is saved in .keys file. Set password to trigger rewrite.
currentWallet.setPassword(appWindow.walletPassword)
// Show confirmation dialog
confirmationDialog.title = qsTr("Rescan wallet cache") + translationManager.emptyString;
confirmationDialog.text = qsTr("Are you sure you want to rebuild the wallet cache?\n"
+ "The following information will be deleted\n"
+ "- Recipient addresses\n"
+ "- Tx keys\n"
+ "- Tx descriptions\n\n"
+ "The old wallet cache file will be renamed and can be restored later.\n"
);
confirmationDialog.icon = StandardIcon.Question
confirmationDialog.cancelText = qsTr("Cancel")
confirmationDialog.onAcceptedCallback = function() {
walletManager.closeWallet();
walletManager.clearWalletCache(persistentSettings.wallet_path);
walletManager.openWalletAsync(persistentSettings.wallet_path, appWindow.walletPassword,
persistentSettings.nettype);
}
confirmationDialog.onRejectedCallback = null;
confirmationDialog.open()
return;
}
}
appWindow.showStatusMessage(qsTr("Invalid restore height specified. Must be a number."),3);
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
Rectangle {
height: 1
Layout.topMargin: 2 * scaleRatio
Layout.bottomMargin: 2 * scaleRatio
Layout.fillWidth: true
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
MoneroComponents.TextBlock {
Layout.fillWidth: true
font.pixelSize: 14
text: qsTr("Wallet log path: ") + translationManager.emptyString
}
MoneroComponents.TextBlock {
Layout.fillWidth: true
font.pixelSize: 14
text: walletLogPath
}
}
}
Component.onCompleted: {
}
}