You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wowlet/src/wizard/menu.cpp

47 lines
1.3 KiB

// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
#include "wizard/menu.h"
#include "wizard/walletwizard.h"
#include "ui_menu.h"
#include <QFileDialog>
MenuPage::MenuPage(AppContext *ctx, WalletKeysFilesModel *wallets, QWidget *parent)
: QWizardPage(parent)
, ui(new Ui::MenuPage)
, m_ctx(ctx)
, m_walletKeysFilesModel(wallets)
{
ui->setupUi(this);
this->setButtonText(QWizard::FinishButton, "Open recent wallet");
}
void MenuPage::initializePage() {
if (m_walletKeysFilesModel->rowCount() > 0) {
ui->radioOpen->setChecked(true);
} else {
ui->radioCreate->setChecked(true);
}
}
int MenuPage::nextId() const {
if (ui->radioOpen->isChecked())
return WalletWizard::Page_OpenWallet;
if (ui->radioCreate->isChecked())
return WalletWizard::Page_CreateWallet;
if(ui->radioSeed->isChecked())
return WalletWizard::Page_Restore;
if(ui->radioViewOnly->isChecked())
return WalletWizard::Page_ViewOnly;
return 0;
}
bool MenuPage::validatePage() {
// Check if file exists
// Check if wallet has password
// Check if wallet can be decrypted with entered password
// TODO: Check if password is correct, otherwise show error message
return true;
}