Permalink
Browse files

Added segwit option to account wizard.

  • Loading branch information...
CodeShark committed Sep 20, 2017
1 parent 3369b62 commit 503a032ddc59e988b7fe267afd84e3aecf8e15c8
Showing with 23 additions and 1 deletion.
  1. +1 −1 src/mainwindow.cpp
  2. +19 −0 src/quicknewaccountdialog.cpp
  3. +3 −0 src/quicknewaccountdialog.h
@@ -1451,7 +1451,7 @@ void MainWindow::quickNewAccount()
synchedVault.getVault()->newKeychain(keychainName.toStdString(), keychainSeed);
}
accountModel->newAccount(accountName, dlg.getMinSigs(), keychainNames, dlg.getCreationTime());
accountModel->newAccount(dlg.getUseSegwit(), true, accountName, dlg.getMinSigs(), keychainNames, dlg.getCreationTime());
}
accountModel->update();
@@ -12,11 +12,13 @@
//
#include "quicknewaccountdialog.h"
#include "coinparams.h"
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QCheckBox>
#include <QComboBox>
#include <QLabel>
#include <QDateTimeEdit>
@@ -80,12 +82,24 @@ QuickNewAccountDialog::QuickNewAccountDialog(QWidget* parent)
creationTimeLayout->addWidget(creationTimeLabel);
creationTimeLayout->addWidget(creationTimeEdit);
// Segwit Support
if (getCoinParams().segwit_enabled())
{
segwitCheckBox = new QCheckBox(tr("Use Seg&Wit"), this);
segwitCheckBox->setChecked(false);
}
else
{
segwitCheckBox = new QCheckBox(tr("Use Seg&Wit (not active on this blockchain)"), this);
segwitCheckBox->setEnabled(false);
}
// Main Layout
QVBoxLayout *mainLayout = new QVBoxLayout();
mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
mainLayout->addLayout(nameLayout);
mainLayout->addLayout(policyLayout);
mainLayout->addLayout(creationTimeLayout);
mainLayout->addWidget(segwitCheckBox);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
}
@@ -114,3 +128,8 @@ qint64 QuickNewAccountDialog::getCreationTime() const
{
return creationTimeEdit->dateTime().toMSecsSinceEpoch();
}
bool QuickNewAccountDialog::getUseSegwit() const
{
return segwitCheckBox->isChecked();
}
@@ -17,6 +17,7 @@ class QLineEdit;
class QComboBox;
class QDateTimeEdit;
class QCalendarWidget;
class QCheckBox;
#include <QDialog>
@@ -32,12 +33,14 @@ class QuickNewAccountDialog : public QDialog
int getMinSigs() const;
int getMaxSigs() const;
qint64 getCreationTime() const;
bool getUseSegwit() const;
private:
QLineEdit* nameEdit;
QComboBox* minSigComboBox;
QComboBox* maxSigComboBox;
QDateTimeEdit* creationTimeEdit;
QCalendarWidget* calendarWidget;
QCheckBox* segwitCheckBox;
};

0 comments on commit 503a032

Please sign in to comment.