airgap: allow transmitting view-only details over UR

This commit is contained in:
tobtoht
2023-12-06 03:08:58 +01:00
parent 3dd6dbc9ba
commit 87aae77fda
13 changed files with 167 additions and 42 deletions
+6
View File
@@ -50,6 +50,12 @@ void PageSetRestoreHeight::initializePage() {
ui->line_creationDate->setText(creationDate.toString("yyyy-MM-dd"));
this->onCreationDateEdited();
}
if (m_fields->restoreHeight > 0) {
ui->line_restoreHeight->setText(QString::number(m_fields->restoreHeight));
this->onRestoreHeightEdited();
this->completeChanged();
}
}
void PageSetRestoreHeight::onCreationDateEdited() {
+4
View File
@@ -42,6 +42,10 @@ void PageWalletFile::initializePage() {
ui->line_walletName->setText(this->defaultWalletName());
ui->check_defaultWalletDirectory->setVisible(false);
ui->check_defaultWalletDirectory->setChecked(false);
if (!m_fields->walletName.isEmpty()) {
ui->line_walletName->setText(m_fields->walletName);
}
}
bool PageWalletFile::validateWidgets(){
+12
View File
@@ -11,6 +11,7 @@
#include "WalletWizard.h"
#include "constants.h"
#include "dialog/URDialog.h"
#include "libwalletqt/WalletManager.h"
PageWalletRestoreKeys::PageWalletRestoreKeys(WizardFields *fields, QWidget *parent)
@@ -41,6 +42,17 @@ PageWalletRestoreKeys::PageWalletRestoreKeys(WizardFields *fields, QWidget *pare
connect(ui->btnOptions, &QPushButton::clicked, this, &PageWalletRestoreKeys::onOptionsClicked);
connect(ui->combo_walletType, &QComboBox::currentTextChanged, this, &PageWalletRestoreKeys::showInputLines);
connect(ui->btn_scanUR, &QPushButton::clicked, [this] {
URDialog dialog{this, "", true};
dialog.exec();
ViewOnlyDetails details = dialog.getViewOnlyDetails();
ui->line_address->setText(details.address);
ui->line_address->setCursorPosition(0);
ui->line_viewkey->setText(details.key);
ui->line_viewkey->setCursorPosition(0);
m_fields->restoreHeight = details.restoreHeight;
m_fields->walletName = details.walletName;
});
}
void PageWalletRestoreKeys::initializePage() {
+7
View File
@@ -215,6 +215,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_scanUR">
<property name="text">
<string>Scan UR</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">