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>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>335</height>
|
||||
<height>321</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Create Wallet</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLineEdit" name="directory"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLineEdit" name="password">
|
||||
<property name="text">
|
||||
<string>Password (Optional)</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="9" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -32,11 +32,31 @@
|
|||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</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">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
@ -47,56 +67,46 @@
|
|||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="walletName"/>
|
||||
</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">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnChange">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>180</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Change directory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLineEdit" name="password">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLineEdit" name="walletPath"/>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>label_3</zorder>
|
||||
<zorder>label_9</zorder>
|
||||
<zorder>password</zorder>
|
||||
<zorder>btnChange</zorder>
|
||||
<zorder>directory</zorder>
|
||||
<zorder>label</zorder>
|
||||
<zorder>verticalSpacer</zorder>
|
||||
<zorder>walletName</zorder>
|
||||
<zorder>walletPath</zorder>
|
||||
<zorder>horizontalLayoutWidget</zorder>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>walletName</tabstop>
|
||||
<tabstop>walletPath</tabstop>
|
||||
<tabstop>password</tabstop>
|
||||
<tabstop>directory</tabstop>
|
||||
<tabstop>btnChange</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -22,11 +22,7 @@ CreateWalletSeedPage::CreateWalletSeedPage(AppContext *ctx, QWidget *parent) :
|
|||
this->registerField("mnemonicSeed", ui->hiddenMnemonicSeed);
|
||||
ui->hiddenMnemonicSeed->hide();
|
||||
|
||||
auto fontApp = QApplication::font();
|
||||
auto fontFamily = fontApp.family();
|
||||
auto fontSize = fontApp.pointSize() + 2;
|
||||
m_seedFontFamily = fontFamily;
|
||||
m_seedFontSize = fontSize;
|
||||
ui->seed->setFont(Utils::relativeFont(1));
|
||||
|
||||
connect(ui->btnRoulette, &QPushButton::clicked, [=]{
|
||||
this->seedRoulette(0);
|
||||
|
@ -52,8 +48,7 @@ void CreateWalletSeedPage::seedRoulette(int count) {
|
|||
}
|
||||
|
||||
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->setText(QString(html).arg(m_seedFontFamily).arg(m_seedFontSize).arg(seed));
|
||||
ui->seed->setPlainText(seed);
|
||||
}
|
||||
|
||||
int CreateWalletSeedPage::nextId() const {
|
||||
|
|
|
@ -42,8 +42,6 @@ private:
|
|||
QString m_mnemonic;
|
||||
unsigned int m_restoreHeight;
|
||||
|
||||
int m_seedFontSize;
|
||||
QString m_seedFontFamily;
|
||||
bool m_roulette = false;
|
||||
int m_rouletteSpin = 15;
|
||||
};
|
||||
|
|
|
@ -6,57 +6,44 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>439</width>
|
||||
<height>425</height>
|
||||
<width>438</width>
|
||||
<height>444</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>WizardPage</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="seed">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>90</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>WARNING:</string>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<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 name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</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 name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="hiddenMnemonicSeed">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
|
@ -73,6 +60,9 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRoulette">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Generate</string>
|
||||
</property>
|
||||
|
@ -80,7 +70,36 @@
|
|||
</item>
|
||||
</layout>
|
||||
</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">
|
||||
<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>
|
||||
|
@ -90,50 +109,18 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Your wallet generation seed is:</string>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</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">
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<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"/>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
@ -20,15 +20,15 @@ WalletWizard::WalletWizard(AppContext *ctx, WalletWizard::Page startPage, QWidge
|
|||
m_ctx(ctx) {
|
||||
this->setWindowTitle("Welcome to feather");
|
||||
this->setWindowIcon(QIcon(":/assets/images/appicons/64x64.png"));
|
||||
auto openWalletPage = new OpenWalletPage(m_ctx);
|
||||
auto createWallet = new CreateWalletPage(m_ctx);
|
||||
auto createWalletSeed = new CreateWalletSeedPage(m_ctx);
|
||||
setPage(Page_Menu, new MenuPage(m_ctx));
|
||||
auto openWalletPage = new OpenWalletPage(m_ctx, this);
|
||||
auto createWallet = new CreateWalletPage(m_ctx, this);
|
||||
auto createWalletSeed = new CreateWalletSeedPage(m_ctx, this);
|
||||
setPage(Page_Menu, new MenuPage(m_ctx, this));
|
||||
setPage(Page_CreateWallet, createWallet);
|
||||
setPage(Page_OpenWallet, openWalletPage);
|
||||
setPage(Page_CreateWalletSeed, createWalletSeed);
|
||||
setPage(Page_Network, new NetworkPage(m_ctx));
|
||||
setPage(Page_Restore, new RestorePage(m_ctx));
|
||||
setPage(Page_Network, new NetworkPage(m_ctx, this));
|
||||
setPage(Page_Restore, new RestorePage(m_ctx, this));
|
||||
|
||||
if(config()->get(Config::firstRun).toUInt())
|
||||
setStartId(Page_Network);
|
||||
|
|
Loading…
Reference in a new issue