mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 11:39:25 +00:00
Avoid writing config on tab change
This commit is contained in:
parent
2ba7467674
commit
180ef9618b
4 changed files with 14 additions and 8 deletions
|
@ -170,9 +170,6 @@ void MainWindow::initStatusBar() {
|
|||
void MainWindow::initWidgets() {
|
||||
int homeWidget = config()->get(Config::homeWidget).toInt();
|
||||
ui->tabHomeWidget->setCurrentIndex(TabsHome(homeWidget));
|
||||
connect(ui->tabHomeWidget, &QTabWidget::currentChanged, [](int index){
|
||||
config()->set(Config::homeWidget, TabsHome(index));
|
||||
});
|
||||
|
||||
// [History]
|
||||
m_historyWidget = new HistoryWidget(m_ctx, this);
|
||||
|
@ -908,6 +905,8 @@ void MainWindow::closeEvent(QCloseEvent *event) {
|
|||
if (!this->cleanedUp) {
|
||||
this->cleanedUp = true;
|
||||
|
||||
config()->set(Config::homeWidget, ui->tabHomeWidget->currentIndex());
|
||||
|
||||
m_historyWidget->resetModel();
|
||||
|
||||
m_updateBytes.stop();
|
||||
|
|
|
@ -90,8 +90,10 @@ public:
|
|||
};
|
||||
|
||||
enum TabsHome {
|
||||
CCS,
|
||||
REDDIT
|
||||
CCS = 0,
|
||||
BOUNTIES,
|
||||
REDDIT,
|
||||
REVUO
|
||||
};
|
||||
|
||||
void showOrHide();
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "Icons.h"
|
||||
#include "utils/WebsocketNotifier.h"
|
||||
|
@ -22,9 +23,6 @@ Settings::Settings(QSharedPointer<AppContext> ctx, QWidget *parent)
|
|||
|
||||
ui->tabWidget->setTabVisible(5, false);
|
||||
ui->tabWidget->setCurrentIndex(config()->get(Config::lastSettingsPage).toInt());
|
||||
connect(ui->tabWidget, &QTabWidget::currentChanged, [](int index){
|
||||
config()->set(Config::lastSettingsPage, index);
|
||||
});
|
||||
|
||||
this->setupGeneralTab();
|
||||
this->setupPrivacyTab();
|
||||
|
@ -270,4 +268,9 @@ void Settings::enableWebsocket(bool enabled) {
|
|||
emit websocketStatusChanged(enabled);
|
||||
}
|
||||
|
||||
void Settings::closeEvent(QCloseEvent *event) {
|
||||
config()->set(Config::lastSettingsPage, ui->tabWidget->currentIndex());
|
||||
event->accept();
|
||||
}
|
||||
|
||||
Settings::~Settings() = default;
|
|
@ -53,6 +53,8 @@ private:
|
|||
void setupLocalMoneroFrontendCombobox();
|
||||
void enableWebsocket(bool enabled);
|
||||
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
QScopedPointer<Ui::Settings> ui;
|
||||
QSharedPointer<AppContext> m_ctx;
|
||||
|
||||
|
|
Loading…
Reference in a new issue