2021-05-02 18:22:38 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2022-02-10 10:26:41 +00:00
|
|
|
// SPDX-FileCopyrightText: 2020-2022 The Monero Project
|
2021-05-02 18:22:38 +00:00
|
|
|
|
|
|
|
#include "PageHardwareDevice.h"
|
|
|
|
#include "ui_PageHardwareDevice.h"
|
|
|
|
#include "WalletWizard.h"
|
|
|
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
2021-05-18 15:59:18 +00:00
|
|
|
PageHardwareDevice::PageHardwareDevice(WizardFields *fields, QWidget *parent)
|
2021-05-02 18:22:38 +00:00
|
|
|
: QWizardPage(parent)
|
|
|
|
, ui(new Ui::PageHardwareDevice)
|
|
|
|
, m_fields(fields)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2021-07-01 21:00:47 +00:00
|
|
|
|
|
|
|
ui->combo_deviceType->addItem("Ledger Nano S", DeviceType::LEDGER_NANO_S);
|
|
|
|
ui->combo_deviceType->addItem("Ledger Nano X", DeviceType::LEDGER_NANO_X);
|
|
|
|
ui->combo_deviceType->addItem("Trezor Model T", DeviceType::TREZOR_MODEL_T);
|
2021-05-02 18:22:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PageHardwareDevice::initializePage() {
|
|
|
|
ui->radioNewWallet->setChecked(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
int PageHardwareDevice::nextId() const {
|
|
|
|
if (ui->radioNewWallet->isChecked())
|
|
|
|
return WalletWizard::Page_WalletFile;
|
|
|
|
if (ui->radioRestoreWallet->isChecked())
|
|
|
|
return WalletWizard::Page_SetRestoreHeight;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PageHardwareDevice::validatePage() {
|
2021-07-01 21:00:47 +00:00
|
|
|
m_fields->deviceType = static_cast<DeviceType>(ui->combo_deviceType->currentData().toInt());
|
2021-05-02 18:22:38 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PageHardwareDevice::isComplete() const {
|
|
|
|
return true;
|
|
|
|
}
|