mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-17 12:21:17 +02:00
Merge bitcoin-core/gui#617: Reset options, notify user about backup creation
ac4fb3bbbe207d0744201a9df8a971af06db5476 gui: reset options, notify user about the backup creation (furszy) Pull request description: Quick follow-up to first point of https://github.com/bitcoin-core/gui/pull/602#pullrequestreview-1002780997 ACKs for top commit: ryanofsky: Code review ACK ac4fb3bbbe207d0744201a9df8a971af06db5476, just fixing displayed backup directory since last review jarolrod: tACK ac4fb3bbbe207d0744201a9df8a971af06db5476 Tree-SHA512: cfeca5cd6d6d3d69bbd81211cf1bfd490de13ac96bf53be081a5ceb88611afa57dff2be35f8e0a41b1088b7b892f75a21a9abf47f2e1d77e9e316467eb7c12be
This commit is contained in:
commit
1b4d660a34
@ -999,6 +999,7 @@ void BitcoinGUI::openOptionsDialogWithTab(OptionsDialog::Tab tab)
|
|||||||
auto dlg = new OptionsDialog(this, enableWallet);
|
auto dlg = new OptionsDialog(this, enableWallet);
|
||||||
connect(dlg, &OptionsDialog::quitOnReset, this, &BitcoinGUI::quitRequested);
|
connect(dlg, &OptionsDialog::quitOnReset, this, &BitcoinGUI::quitRequested);
|
||||||
dlg->setCurrentTab(tab);
|
dlg->setCurrentTab(tab);
|
||||||
|
dlg->setClientModel(clientModel);
|
||||||
dlg->setModel(clientModel->getOptionsModel());
|
dlg->setModel(clientModel->getOptionsModel());
|
||||||
GUIUtil::ShowModalDialogAsynchronously(dlg);
|
GUIUtil::ShowModalDialogAsynchronously(dlg);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <qt/forms/ui_optionsdialog.h>
|
#include <qt/forms/ui_optionsdialog.h>
|
||||||
|
|
||||||
#include <qt/bitcoinunits.h>
|
#include <qt/bitcoinunits.h>
|
||||||
|
#include <qt/clientmodel.h>
|
||||||
#include <qt/guiconstants.h>
|
#include <qt/guiconstants.h>
|
||||||
#include <qt/guiutil.h>
|
#include <qt/guiutil.h>
|
||||||
#include <qt/optionsmodel.h>
|
#include <qt/optionsmodel.h>
|
||||||
@ -168,6 +169,11 @@ OptionsDialog::~OptionsDialog()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::setClientModel(ClientModel* client_model)
|
||||||
|
{
|
||||||
|
m_client_model = client_model;
|
||||||
|
}
|
||||||
|
|
||||||
void OptionsDialog::setModel(OptionsModel *_model)
|
void OptionsDialog::setModel(OptionsModel *_model)
|
||||||
{
|
{
|
||||||
this->model = _model;
|
this->model = _model;
|
||||||
@ -278,11 +284,12 @@ void OptionsDialog::setOkButtonState(bool fState)
|
|||||||
|
|
||||||
void OptionsDialog::on_resetButton_clicked()
|
void OptionsDialog::on_resetButton_clicked()
|
||||||
{
|
{
|
||||||
if(model)
|
if (model) {
|
||||||
{
|
|
||||||
// confirmation dialog
|
// confirmation dialog
|
||||||
QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
|
QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
|
||||||
tr("Client restart required to activate changes.") + "<br><br>" + tr("Client will be shut down. Do you want to proceed?"),
|
tr("Client restart required to activate changes.") + "<br><br>" +
|
||||||
|
tr("Current settings will be backed up at \"%1\".").arg(m_client_model->dataDir()) + "<br><br>" +
|
||||||
|
tr("Client will be shut down. Do you want to proceed?"),
|
||||||
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
|
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
|
||||||
|
|
||||||
if (btnRetVal == QMessageBox::Cancel)
|
if (btnRetVal == QMessageBox::Cancel)
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QValidator>
|
#include <QValidator>
|
||||||
|
|
||||||
|
class ClientModel;
|
||||||
class OptionsModel;
|
class OptionsModel;
|
||||||
class QValidatedLineEdit;
|
class QValidatedLineEdit;
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ public:
|
|||||||
TAB_NETWORK,
|
TAB_NETWORK,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void setClientModel(ClientModel* client_model);
|
||||||
void setModel(OptionsModel *model);
|
void setModel(OptionsModel *model);
|
||||||
void setMapper();
|
void setMapper();
|
||||||
void setCurrentTab(OptionsDialog::Tab tab);
|
void setCurrentTab(OptionsDialog::Tab tab);
|
||||||
@ -72,6 +74,7 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::OptionsDialog *ui;
|
Ui::OptionsDialog *ui;
|
||||||
|
ClientModel* m_client_model{nullptr};
|
||||||
OptionsModel *model;
|
OptionsModel *model;
|
||||||
QDataWidgetMapper *mapper;
|
QDataWidgetMapper *mapper;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user