mirror of
https://git.wownero.com/wowlet/wowlet.git
synced 2024-08-15 01:03:14 +00:00
Wizard: misc improvements to create wallet pages
Don't focus on Generate button Replace HTML for PlainTextEdit Set font using Utils::relativeFont Change directory button text no longer clips Wizard Pages are no longer orphans Vertical spacers no longer take up more room than they need to GridLayout -> VerticalLayout
This commit is contained in:
parent
12940361d8
commit
89ea34cfb7
5 changed files with 124 additions and 134 deletions
|
@ -7,24 +7,24 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>400</width>
|
||||||
<height>335</height>
|
<height>321</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Create Wallet</string>
|
<string>Create Wallet</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="6" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLineEdit" name="directory"/>
|
<widget class="QLineEdit" name="password">
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Password (Optional)</string>
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>QLineEdit::Password</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="9" column="0">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -32,11 +32,31 @@
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>40</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLineEdit" name="directory"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLineEdit" name="walletPath"/>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="text">
|
||||||
|
<string>Directory</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Password (Optional)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -47,56 +67,46 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLineEdit" name="walletName"/>
|
<widget class="QLineEdit" name="walletName"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="label_9">
|
|
||||||
<property name="text">
|
|
||||||
<string>Directory</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="btnChange">
|
<widget class="QPushButton" name="btnChange">
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>180</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Change directory</string>
|
<string>Change directory</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item>
|
||||||
<widget class="QLineEdit" name="password">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string/>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="echoMode">
|
<property name="sizeHint" stdset="0">
|
||||||
<enum>QLineEdit::Password</enum>
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
</layout>
|
||||||
<widget class="QLineEdit" name="walletPath"/>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
<zorder>label_3</zorder>
|
<zorder>label_3</zorder>
|
||||||
<zorder>label_9</zorder>
|
<zorder>label_9</zorder>
|
||||||
<zorder>password</zorder>
|
<zorder>password</zorder>
|
||||||
<zorder>btnChange</zorder>
|
|
||||||
<zorder>directory</zorder>
|
<zorder>directory</zorder>
|
||||||
<zorder>label</zorder>
|
<zorder>label</zorder>
|
||||||
<zorder>verticalSpacer</zorder>
|
<zorder>verticalSpacer</zorder>
|
||||||
<zorder>walletName</zorder>
|
<zorder>walletName</zorder>
|
||||||
<zorder>walletPath</zorder>
|
<zorder>walletPath</zorder>
|
||||||
|
<zorder>horizontalLayoutWidget</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>walletName</tabstop>
|
<tabstop>walletName</tabstop>
|
||||||
<tabstop>walletPath</tabstop>
|
<tabstop>walletPath</tabstop>
|
||||||
<tabstop>password</tabstop>
|
<tabstop>password</tabstop>
|
||||||
<tabstop>directory</tabstop>
|
<tabstop>directory</tabstop>
|
||||||
<tabstop>btnChange</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
@ -22,11 +22,7 @@ CreateWalletSeedPage::CreateWalletSeedPage(AppContext *ctx, QWidget *parent) :
|
||||||
this->registerField("mnemonicSeed", ui->hiddenMnemonicSeed);
|
this->registerField("mnemonicSeed", ui->hiddenMnemonicSeed);
|
||||||
ui->hiddenMnemonicSeed->hide();
|
ui->hiddenMnemonicSeed->hide();
|
||||||
|
|
||||||
auto fontApp = QApplication::font();
|
ui->seed->setFont(Utils::relativeFont(1));
|
||||||
auto fontFamily = fontApp.family();
|
|
||||||
auto fontSize = fontApp.pointSize() + 2;
|
|
||||||
m_seedFontFamily = fontFamily;
|
|
||||||
m_seedFontSize = fontSize;
|
|
||||||
|
|
||||||
connect(ui->btnRoulette, &QPushButton::clicked, [=]{
|
connect(ui->btnRoulette, &QPushButton::clicked, [=]{
|
||||||
this->seedRoulette(0);
|
this->seedRoulette(0);
|
||||||
|
@ -52,8 +48,7 @@ void CreateWalletSeedPage::seedRoulette(int count) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateWalletSeedPage::displaySeed(const QString &seed){
|
void CreateWalletSeedPage::displaySeed(const QString &seed){
|
||||||
auto html = R"(<html><head><meta name="qrichtext" content="1" /></head><body style="font-family:'%1'; font-size:%2pt; font-weight:400; font-style:normal;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%3</p></body></html>)";
|
ui->seed->setPlainText(seed);
|
||||||
ui->seed->setText(QString(html).arg(m_seedFontFamily).arg(m_seedFontSize).arg(seed));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CreateWalletSeedPage::nextId() const {
|
int CreateWalletSeedPage::nextId() const {
|
||||||
|
|
|
@ -42,8 +42,6 @@ private:
|
||||||
QString m_mnemonic;
|
QString m_mnemonic;
|
||||||
unsigned int m_restoreHeight;
|
unsigned int m_restoreHeight;
|
||||||
|
|
||||||
int m_seedFontSize;
|
|
||||||
QString m_seedFontFamily;
|
|
||||||
bool m_roulette = false;
|
bool m_roulette = false;
|
||||||
int m_rouletteSpin = 15;
|
int m_rouletteSpin = 15;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,57 +6,44 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>439</width>
|
<width>438</width>
|
||||||
<height>425</height>
|
<height>444</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>WizardPage</string>
|
<string>WizardPage</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item row="5" column="0">
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QPlainTextEdit" name="seed">
|
||||||
<property name="font">
|
<property name="maximumSize">
|
||||||
<font>
|
<size>
|
||||||
<weight>75</weight>
|
<width>16777215</width>
|
||||||
<bold>true</bold>
|
<height>90</height>
|
||||||
</font>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="focusPolicy">
|
||||||
<string>WARNING:</string>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="frameShape">
|
||||||
</item>
|
<enum>QFrame::Box</enum>
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="frameShadow">
|
||||||
<string>Please save these 14 words on paper (order is important). This seed will allow you to recover your wallet in case of computer failure.</string>
|
<enum>QFrame::Plain</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<widget class="QLineEdit" name="hiddenMnemonicSeed">
|
||||||
<property name="orientation">
|
<property name="focusPolicy">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
</widget>
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
|
@ -73,6 +60,9 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnRoulette">
|
<widget class="QPushButton" name="btnRoulette">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Generate</string>
|
<string>Generate</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -80,7 +70,36 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="2">
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Please save these 14 words on paper (order is important). This seed will allow you to recover your wallet in case of computer failure.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>WARNING:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><style>p{margin:0}</style><p>• Never disclose your seed.</p><p>• Never type it on a website.</p><p>• Store it safely (offline).</p><p>• <b>Do not lose your seed!</b></p></body></html></string>
|
<string><html><head/><body><style>p{margin:0}</style><p>• Never disclose your seed.</p><p>• Never type it on a website.</p><p>• Store it safely (offline).</p><p>• <b>Do not lose your seed!</b></p></body></html></string>
|
||||||
|
@ -90,50 +109,18 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<spacer name="verticalSpacer">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Your wallet generation seed is:</string>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QTextEdit" name="seed">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>20</width>
|
||||||
<height>80</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
</spacer>
|
||||||
<enum>QFrame::Box</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="html">
|
|
||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
|
||||||
p, li { white-space: pre-wrap; }
|
|
||||||
</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;">
|
|
||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLineEdit" name="hiddenMnemonicSeed"/>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -20,15 +20,15 @@ WalletWizard::WalletWizard(AppContext *ctx, WalletWizard::Page startPage, QWidge
|
||||||
m_ctx(ctx) {
|
m_ctx(ctx) {
|
||||||
this->setWindowTitle("Welcome to feather");
|
this->setWindowTitle("Welcome to feather");
|
||||||
this->setWindowIcon(QIcon(":/assets/images/appicons/64x64.png"));
|
this->setWindowIcon(QIcon(":/assets/images/appicons/64x64.png"));
|
||||||
auto openWalletPage = new OpenWalletPage(m_ctx);
|
auto openWalletPage = new OpenWalletPage(m_ctx, this);
|
||||||
auto createWallet = new CreateWalletPage(m_ctx);
|
auto createWallet = new CreateWalletPage(m_ctx, this);
|
||||||
auto createWalletSeed = new CreateWalletSeedPage(m_ctx);
|
auto createWalletSeed = new CreateWalletSeedPage(m_ctx, this);
|
||||||
setPage(Page_Menu, new MenuPage(m_ctx));
|
setPage(Page_Menu, new MenuPage(m_ctx, this));
|
||||||
setPage(Page_CreateWallet, createWallet);
|
setPage(Page_CreateWallet, createWallet);
|
||||||
setPage(Page_OpenWallet, openWalletPage);
|
setPage(Page_OpenWallet, openWalletPage);
|
||||||
setPage(Page_CreateWalletSeed, createWalletSeed);
|
setPage(Page_CreateWalletSeed, createWalletSeed);
|
||||||
setPage(Page_Network, new NetworkPage(m_ctx));
|
setPage(Page_Network, new NetworkPage(m_ctx, this));
|
||||||
setPage(Page_Restore, new RestorePage(m_ctx));
|
setPage(Page_Restore, new RestorePage(m_ctx, this));
|
||||||
|
|
||||||
if(config()->get(Config::firstRun).toUInt())
|
if(config()->get(Config::firstRun).toUInt())
|
||||||
setStartId(Page_Network);
|
setStartId(Page_Network);
|
||||||
|
|
Loading…
Reference in a new issue