Skip to content

Commit 7bbe4da

Browse files
committed
feat: 设置页设置更改为自动保存
1 parent a3b4655 commit 7bbe4da

38 files changed

Lines changed: 1609 additions & 1686 deletions

TestManager/testmanager.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,13 @@ class TestManager : public WingHex::IWingManager {
7272

7373
// SettingInterface interface
7474
public:
75-
virtual void apply() override { _isDisabled = _cbblk->isChecked(); }
76-
virtual void reset() override {
77-
_isDisabled = false;
78-
_cbblk->setChecked(false);
79-
}
80-
virtual void cancel() override { _cbblk->setChecked(_isDisabled); }
75+
virtual void restore() override { _cbblk->setChecked(false); }
8176

8277
public:
83-
bool isDisableMsg() const { return _isDisabled; }
78+
bool isDisableMsg() const { return _cbblk->isChecked(); }
8479

8580
private:
8681
QCheckBox *_cbblk;
87-
bool _isDisabled = false;
8882
};
8983

9084
public slots:

TestPlugin/testsettingpage.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,4 @@ QString TestSettingPage::id() const { return _id; }
4141

4242
bool TestSettingPage::showInRibbon() const { return _isShownInRibbton; }
4343

44-
void TestSettingPage::apply() {}
45-
46-
void TestSettingPage::reset() {}
47-
48-
void TestSettingPage::cancel() {}
44+
void TestSettingPage::restore() {}

TestPlugin/testsettingpage.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ class TestSettingPage : public WingHex::SettingPage {
4141

4242
// SettingPage interface
4343
public:
44-
virtual void apply() override;
45-
virtual void reset() override;
46-
virtual void cancel() override;
44+
virtual void restore() override;
4745

4846
private:
4947
QLabel *_lbl = nullptr;

WingPlugin

lang/zh_CN/winghex_zh_CN.ts

Lines changed: 503 additions & 471 deletions
Large diffs are not rendered by default.

lang/zh_TW/winghex_zh_TW.ts

Lines changed: 503 additions & 471 deletions
Large diffs are not rendered by default.

src/class/clangformatmanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QString, CLANG_CUSTOM_STYLE, ("clang.customStyle"))
3232
Q_GLOBAL_STATIC_WITH_ARGS(QString, CLANG_DEFAULT_CUSTOM,
3333
("BasedOnStyle: llvm, IndentWidth: 4"))
3434

35-
ClangFormatManager::ClangFormatManager() {
35+
ClangFormatManager::ClangFormatManager() : QObject() {
3636
ASSERT_SINGLETON;
3737

3838
// load config

src/class/clangformatmanager.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
#ifndef CLANGFORMATMANAGER_H
1919
#define CLANGFORMATMANAGER_H
2020

21+
#include <QObject>
2122
#include <QString>
2223

23-
class ClangFormatManager {
24+
class ClangFormatManager : public QObject {
25+
Q_OBJECT
26+
2427
public:
2528
static ClangFormatManager &instance();
2629

0 commit comments

Comments
 (0)