This commit prevents the basic bug of allowing a user to click "Next" without entering any information. This is done by telling QT which fields are mandatory. I am not sure if it fixes the "Cancel button does a coredump" because I cannot reproduce that. I also made various strings use the translation file. I removed the "Back" button from the first page, because that makes no sense. I removed the "Passphrase don't match" red text that is shown by default, because it was ugly and immediately shows users a negative "you did something wrong" as their very first visual of the wallet. That seemed like bad UI/UX. Now we only show red text there if passwords are too short or do not match. I made the TOS button text red, which makes it more clear that it's necessary to click it. As a consequence of these changes, you cannot input ANY values until the TOS radio button is clicked, so it seemed important to highlight it in red. Otherwise users may click other areas and it seems like nothing works. I deleted an unused file restoreSeed.ui .
96 lines
1.6 KiB
C++
96 lines
1.6 KiB
C++
// Copyright 2019-2022 The Hush developers
|
|
// Released under the GPLv3
|
|
#ifndef FIRSTTIMEWIZARD_H
|
|
#define FIRSTTIMEWIZARD_H
|
|
|
|
#include "precompiled.h"
|
|
#include "ui_newseed.h"
|
|
#include "ui_restoreseed.h"
|
|
#include "ui_newwallet.h"
|
|
#include "mainwindow.h"
|
|
|
|
class FirstTimeWizard: public QWizard
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
FirstTimeWizard(bool dangerous, QString server);
|
|
|
|
QString getSeed();
|
|
QString getBirthday();
|
|
QString _birthday;
|
|
QString _seed;
|
|
void setSeed(QString Seed);
|
|
void setBirthday(QString Birthday);
|
|
void cancelEvent();
|
|
|
|
public slots:
|
|
void slot_change_theme(const QString& themeName);
|
|
|
|
|
|
protected:
|
|
int nextId() const;
|
|
virtual void initializePage();
|
|
|
|
private:
|
|
FirstTimeWizard* parent;
|
|
enum {
|
|
Page_NewOrRestore,
|
|
Page_New,
|
|
Page_Restore
|
|
};
|
|
|
|
bool dangerous;
|
|
QString server;
|
|
|
|
friend class NewOrRestorePage;
|
|
friend class NewSeedPage;
|
|
friend class RestoreSeedPage;
|
|
|
|
};
|
|
|
|
class NewOrRestorePage: public QWizardPage {
|
|
|
|
public:
|
|
|
|
NewOrRestorePage(FirstTimeWizard* parent);
|
|
|
|
protected:
|
|
virtual void initializePage();
|
|
|
|
private:
|
|
FirstTimeWizard* parent;
|
|
|
|
};
|
|
|
|
|
|
class NewSeedPage: public QWizardPage {
|
|
public:
|
|
NewSeedPage(FirstTimeWizard* parent);
|
|
|
|
|
|
protected:
|
|
virtual void initializePage();
|
|
virtual bool validatePage();
|
|
|
|
private:
|
|
FirstTimeWizard* parent;
|
|
Ui_NewSeedForm form;
|
|
};
|
|
|
|
|
|
class RestoreSeedPage: public QWizardPage {
|
|
public:
|
|
RestoreSeedPage(FirstTimeWizard* parent);
|
|
|
|
protected:
|
|
bool validatePage();
|
|
|
|
private:
|
|
FirstTimeWizard* parent;
|
|
Ui_RestoreSeedForm form;
|
|
};
|
|
|
|
#endif // FIRSTTIMEWIZARD_H
|