feat: 设置方面相关更新;优化标记的颜色显示;修复软件关于显示开源协议时文字无换行的问题;
This commit is contained in:
parent
c08c2a859e
commit
912dfaf227
|
@ -93,11 +93,13 @@ bool QHexDocument::metafgVisible() { return m_metafg; }
|
||||||
|
|
||||||
bool QHexDocument::metaCommentVisible() { return m_metacomment; }
|
bool QHexDocument::metaCommentVisible() { return m_metacomment; }
|
||||||
|
|
||||||
bool QHexDocument::isDocSaved() { return m_undostack->isClean(); }
|
bool QHexDocument::isDocSaved() { return m_isSaved; }
|
||||||
|
|
||||||
void QHexDocument::setDocSaved(bool b) {
|
void QHexDocument::setDocSaved(bool b) {
|
||||||
if (b) {
|
if (b) {
|
||||||
m_undostack->setClean();
|
m_undostack->setClean();
|
||||||
}
|
}
|
||||||
|
m_isSaved = b;
|
||||||
emit documentSaved(b);
|
emit documentSaved(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +190,11 @@ bool QHexDocument::RemoveBookMarks(const QList<qsizetype> &pos) {
|
||||||
|
|
||||||
bool QHexDocument::removeBookMark(qsizetype pos) {
|
bool QHexDocument::removeBookMark(qsizetype pos) {
|
||||||
if (m_keepsize) {
|
if (m_keepsize) {
|
||||||
return _bookmarks.remove(pos) != 0;
|
auto ret = _bookmarks.remove(pos) != 0;
|
||||||
|
if (ret) {
|
||||||
|
setDocSaved(false);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -197,6 +203,7 @@ bool QHexDocument::modBookMark(qsizetype pos, const QString &comment) {
|
||||||
if (m_keepsize) {
|
if (m_keepsize) {
|
||||||
if (_bookmarks.contains(pos)) {
|
if (_bookmarks.contains(pos)) {
|
||||||
_bookmarks[pos] = comment;
|
_bookmarks[pos] = comment;
|
||||||
|
setDocSaved(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,8 +339,10 @@ QHexDocument::QHexDocument(QHexBuffer *buffer, bool readonly)
|
||||||
m_metadata = new QHexMetadata(m_undostack, this);
|
m_metadata = new QHexMetadata(m_undostack, this);
|
||||||
m_metadata->setLineWidth(m_hexlinewidth);
|
m_metadata->setLineWidth(m_hexlinewidth);
|
||||||
|
|
||||||
connect(m_metadata, &QHexMetadata::metadataChanged, this,
|
connect(m_metadata, &QHexMetadata::metadataChanged, this, [this] {
|
||||||
&QHexDocument::metaDataChanged);
|
setDocSaved(false);
|
||||||
|
emit metaDataChanged();
|
||||||
|
});
|
||||||
|
|
||||||
/*=======================*/
|
/*=======================*/
|
||||||
// added by wingsummer
|
// added by wingsummer
|
||||||
|
|
|
@ -190,6 +190,8 @@ private:
|
||||||
/*======================*/
|
/*======================*/
|
||||||
// added by wingsummer
|
// added by wingsummer
|
||||||
|
|
||||||
|
bool m_isSaved = true;
|
||||||
|
|
||||||
bool m_readonly;
|
bool m_readonly;
|
||||||
bool m_keepsize;
|
bool m_keepsize;
|
||||||
bool m_islocked;
|
bool m_islocked;
|
||||||
|
|
|
@ -33,7 +33,7 @@ class QCE_EXPORT QSnippetManager : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QSnippetManager(QObject *p = 0);
|
explicit QSnippetManager(QObject *p = nullptr);
|
||||||
virtual ~QSnippetManager();
|
virtual ~QSnippetManager();
|
||||||
|
|
||||||
int snippetCount() const;
|
int snippetCount() const;
|
||||||
|
|
|
@ -8,7 +8,7 @@ set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(PROJECT_VERSION 1.0.0)
|
set(PROJECT_VERSION "2.0.0-WIP")
|
||||||
|
|
||||||
find_package(
|
find_package(
|
||||||
QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network Concurrent
|
QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network Concurrent
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -161,7 +161,7 @@ def update(build_path):
|
||||||
run_command_interactive(
|
run_command_interactive(
|
||||||
["xdg-icon-resource", "forceupdate"])
|
["xdg-icon-resource", "forceupdate"])
|
||||||
run_command_interactive(
|
run_command_interactive(
|
||||||
["gtk-update-icon-caches", "/usr/share/icons/hicolor"])
|
["gtk-update-icon-cache", "/usr/share/icons/hicolor"])
|
||||||
run_command_interactive(
|
run_command_interactive(
|
||||||
["update-desktop-database", "/usr/share/applications"])
|
["update-desktop-database", "/usr/share/applications"])
|
||||||
print(Fore.GREEN + ">> Installation finished..." + Style.RESET_ALL)
|
print(Fore.GREEN + ">> Installation finished..." + Style.RESET_ALL)
|
||||||
|
|
|
@ -43,7 +43,11 @@ SkinManager::SkinManager(QObject *parent) : QObject(parent) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
qss.open(QFile::ReadOnly | QFile::Text);
|
qss.open(QFile::ReadOnly | QFile::Text);
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
qApp->setStyle(QStyleFactory::create("windowsvista"));
|
||||||
|
#else
|
||||||
qApp->setStyle(QStyleFactory::create("fusion"));
|
qApp->setStyle(QStyleFactory::create("fusion"));
|
||||||
|
#endif
|
||||||
qApp->setStyleSheet(qss.readAll());
|
qApp->setStyleSheet(qss.readAll());
|
||||||
qss.close();
|
qss.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,13 @@ AboutSoftwareDialog::AboutSoftwareDialog(QWidget *parent)
|
||||||
ui->tbTr->setMarkdown(data.trans);
|
ui->tbTr->setMarkdown(data.trans);
|
||||||
ui->lblVersion->setText(qApp->applicationVersion());
|
ui->lblVersion->setText(qApp->applicationVersion());
|
||||||
|
|
||||||
|
QFile license(QStringLiteral(":/com.wingsummer.winghex/LICENSE"));
|
||||||
|
auto ret = license.open(QFile::ReadOnly);
|
||||||
|
Q_ASSERT(ret);
|
||||||
|
Q_UNUSED(ret);
|
||||||
|
auto ltxt = license.readAll();
|
||||||
|
ui->tbLicense->setText(ltxt);
|
||||||
|
|
||||||
_dialog = new FramelessDialogBase(parent);
|
_dialog = new FramelessDialogBase(parent);
|
||||||
_dialog->buildUpContent(this);
|
_dialog->buildUpContent(this);
|
||||||
_dialog->setWindowTitle(this->windowTitle());
|
_dialog->setWindowTitle(this->windowTitle());
|
||||||
|
|
|
@ -131,11 +131,6 @@
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="source">
|
|
||||||
<url>
|
|
||||||
<string>qrc:/com.wingsummer.winghex/LICENSE</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -1106,6 +1106,7 @@ RibbonTabContent *MainWindow::buildPluginPage(RibbonTabContent *tab) {
|
||||||
pannel->setVisible(false);
|
pannel->setVisible(false);
|
||||||
connect(pannel, &RibbonButtonGroup::emptyStatusChanged, this,
|
connect(pannel, &RibbonButtonGroup::emptyStatusChanged, this,
|
||||||
[pannel](bool isEmpty) { pannel->setVisible(!isEmpty); });
|
[pannel](bool isEmpty) { pannel->setVisible(!isEmpty); });
|
||||||
|
m_pluginSettingsGroup = pannel;
|
||||||
}
|
}
|
||||||
return tab;
|
return tab;
|
||||||
}
|
}
|
||||||
|
@ -1149,35 +1150,89 @@ RibbonTabContent *MainWindow::buildAboutPage(RibbonTabContent *tab) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::buildUpSettingDialog() {
|
void MainWindow::buildUpSettingDialog() {
|
||||||
|
QStringList usedIDs;
|
||||||
|
QString id;
|
||||||
|
|
||||||
m_setdialog = new SettingDialog(this);
|
m_setdialog = new SettingDialog(this);
|
||||||
auto generalPage = new GeneralSettingDialog(m_setdialog);
|
auto generalPage = new GeneralSettingDialog(m_setdialog);
|
||||||
connect(generalPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
connect(generalPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
||||||
&SettingDialog::toastTakeEffectReboot);
|
&SettingDialog::toastTakeEffectReboot);
|
||||||
m_setdialog->addPage(generalPage);
|
m_setdialog->addPage(generalPage);
|
||||||
|
id = generalPage->id();
|
||||||
|
Q_ASSERT(!id.isEmpty());
|
||||||
|
Q_ASSERT(usedIDs.indexOf(id) < 0);
|
||||||
|
usedIDs.append(id);
|
||||||
|
|
||||||
auto editorPage = new EditorSettingDialog(m_setdialog);
|
auto editorPage = new EditorSettingDialog(m_setdialog);
|
||||||
connect(editorPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
connect(editorPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
||||||
&SettingDialog::toastTakeEffectReboot);
|
&SettingDialog::toastTakeEffectReboot);
|
||||||
m_setdialog->addPage(editorPage);
|
m_setdialog->addPage(editorPage);
|
||||||
|
id = editorPage->id();
|
||||||
|
Q_ASSERT(!id.isEmpty());
|
||||||
|
Q_ASSERT(usedIDs.indexOf(id) < 0);
|
||||||
|
usedIDs.append(id);
|
||||||
|
|
||||||
auto plgPage = new PluginSettingDialog(m_setdialog);
|
auto plgPage = new PluginSettingDialog(m_setdialog);
|
||||||
connect(plgPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
connect(plgPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
||||||
&SettingDialog::toastTakeEffectReboot);
|
&SettingDialog::toastTakeEffectReboot);
|
||||||
plgPage->buildUp(m_settingPages);
|
plgPage->buildUp(m_plgPages);
|
||||||
m_setdialog->addPage(plgPage);
|
m_setdialog->addPage(plgPage);
|
||||||
|
id = plgPage->id();
|
||||||
|
Q_ASSERT(!id.isEmpty());
|
||||||
|
Q_ASSERT(usedIDs.indexOf(id) < 0);
|
||||||
|
usedIDs.append(id);
|
||||||
|
|
||||||
auto scriptPage = new ScriptSettingDialog(m_setdialog);
|
auto scriptPage = new ScriptSettingDialog(m_setdialog);
|
||||||
connect(scriptPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
connect(scriptPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
||||||
&SettingDialog::toastTakeEffectReboot);
|
&SettingDialog::toastTakeEffectReboot);
|
||||||
m_setdialog->addPage(scriptPage);
|
m_setdialog->addPage(scriptPage);
|
||||||
|
id = scriptPage->id();
|
||||||
for (auto &page : m_settingPages) {
|
Q_ASSERT(!id.isEmpty());
|
||||||
if (!page->isInPluginPage()) {
|
Q_ASSERT(usedIDs.indexOf(id) < 0);
|
||||||
connect(page, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
usedIDs.append(id);
|
||||||
&SettingDialog::toastTakeEffectReboot);
|
|
||||||
m_setdialog->addPage(page);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto otherPage = new OtherSettingsDialog(m_setdialog);
|
auto otherPage = new OtherSettingsDialog(m_setdialog);
|
||||||
|
id = otherPage->id();
|
||||||
|
Q_ASSERT(!id.isEmpty());
|
||||||
|
Q_ASSERT(usedIDs.indexOf(id) < 0);
|
||||||
|
usedIDs.append(id);
|
||||||
|
|
||||||
|
for (auto page_p = m_settingPages.constKeyValueBegin();
|
||||||
|
page_p != m_settingPages.constKeyValueEnd(); ++page_p) {
|
||||||
|
auto page = page_p->first;
|
||||||
|
auto name = page->name();
|
||||||
|
auto id = page->id();
|
||||||
|
|
||||||
|
// check
|
||||||
|
if (id.isEmpty()) {
|
||||||
|
id = name;
|
||||||
|
auto plg = page->property("__plg__").value<IWingPlugin *>();
|
||||||
|
Logger::warning(
|
||||||
|
QStringLiteral("[") + plg->metaObject()->className() +
|
||||||
|
QStringLiteral("::") + name + QStringLiteral("] ") +
|
||||||
|
QStringLiteral(":") + tr("SetPageIDEmptyTryUseName"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (usedIDs.contains(id)) {
|
||||||
|
auto plg = page->property("__plg__").value<IWingPlugin *>();
|
||||||
|
Logger::critical(
|
||||||
|
QStringLiteral("[") + plg->metaObject()->className() +
|
||||||
|
QStringLiteral("::") + name + QStringLiteral("] ") +
|
||||||
|
QStringLiteral(":") + tr("SetPageDupNameIgnored"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(page, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
||||||
|
&SettingDialog::toastTakeEffectReboot);
|
||||||
|
m_setdialog->addPage(page);
|
||||||
|
if (page_p->second) {
|
||||||
|
auto icon = page->categoryIcon();
|
||||||
|
addPannelAction(m_pluginSettingsGroup, icon, name,
|
||||||
|
[=] { m_setdialog->showConfig(id); });
|
||||||
|
}
|
||||||
|
usedIDs.append(id);
|
||||||
|
}
|
||||||
|
|
||||||
connect(otherPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
connect(otherPage, &SettingPage::optionNeedRestartChanged, m_setdialog,
|
||||||
&SettingDialog::toastTakeEffectReboot);
|
&SettingDialog::toastTakeEffectReboot);
|
||||||
m_setdialog->addPage(otherPage);
|
m_setdialog->addPage(otherPage);
|
||||||
|
|
|
@ -486,10 +486,12 @@ private:
|
||||||
EditorView *m_curEditor = nullptr;
|
EditorView *m_curEditor = nullptr;
|
||||||
|
|
||||||
SettingDialog *m_setdialog = nullptr;
|
SettingDialog *m_setdialog = nullptr;
|
||||||
|
SettingDialog *m_plgsetdlg = nullptr;
|
||||||
RecentFileManager *m_recentmanager = nullptr;
|
RecentFileManager *m_recentmanager = nullptr;
|
||||||
QMenu *m_recentMenu = nullptr;
|
QMenu *m_recentMenu = nullptr;
|
||||||
|
|
||||||
RibbonButtonGroup *m_scriptDBGroup = nullptr;
|
RibbonButtonGroup *m_scriptDBGroup = nullptr;
|
||||||
|
RibbonButtonGroup *m_pluginSettingsGroup = nullptr;
|
||||||
ScriptManager::ScriptActionMaps _scriptMaps;
|
ScriptManager::ScriptActionMaps _scriptMaps;
|
||||||
|
|
||||||
//===================================================
|
//===================================================
|
||||||
|
@ -525,7 +527,8 @@ private:
|
||||||
QHash<QString, RibbonTabContent *> m_ribbonMaps;
|
QHash<QString, RibbonTabContent *> m_ribbonMaps;
|
||||||
QList<QMenu *> m_hexContextMenu;
|
QList<QMenu *> m_hexContextMenu;
|
||||||
QMap<IWingPlugin *, QList<WingEditorViewWidget *>> m_editorViewWidgets;
|
QMap<IWingPlugin *, QList<WingEditorViewWidget *>> m_editorViewWidgets;
|
||||||
QList<SettingPage *> m_settingPages;
|
QHash<SettingPage *, bool> m_settingPages;
|
||||||
|
QList<PluginPage *> m_plgPages;
|
||||||
QList<WingEditorViewWidget *> m_editorViewWidgetsBuffer;
|
QList<WingEditorViewWidget *> m_editorViewWidgetsBuffer;
|
||||||
|
|
||||||
ads::CDockAreaWidget *m_leftViewArea = nullptr;
|
ads::CDockAreaWidget *m_leftViewArea = nullptr;
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "qeditor.h"
|
#include "qeditor.h"
|
||||||
#include "qformatscheme.h"
|
#include "qformatscheme.h"
|
||||||
#include "qlinemarksinfocenter.h"
|
#include "qlinemarksinfocenter.h"
|
||||||
|
#include "qsnippetmanager.h"
|
||||||
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
@ -95,6 +96,9 @@ ScriptingDialog::ScriptingDialog(QWidget *parent)
|
||||||
m_language = new QLanguageFactory(format, this);
|
m_language = new QLanguageFactory(format, this);
|
||||||
m_language->addDefinitionPath(QStringLiteral(":/qcodeedit"));
|
m_language->addDefinitionPath(QStringLiteral(":/qcodeedit"));
|
||||||
|
|
||||||
|
auto snippet = new QSnippetManager(this);
|
||||||
|
m_snipbind = new QSnippetBinding(snippet);
|
||||||
|
|
||||||
auto lmic = QLineMarksInfoCenter::instance();
|
auto lmic = QLineMarksInfoCenter::instance();
|
||||||
lmic->loadMarkTypes(QCE::fetchDataFile(":/qcodeedit/marks.qxm"));
|
lmic->loadMarkTypes(QCE::fetchDataFile(":/qcodeedit/marks.qxm"));
|
||||||
// get symbol ID
|
// get symbol ID
|
||||||
|
@ -120,6 +124,8 @@ ScriptingDialog::ScriptingDialog(QWidget *parent)
|
||||||
this->setUpdatesEnabled(true);
|
this->setUpdatesEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScriptingDialog::~ScriptingDialog() { delete m_snipbind; }
|
||||||
|
|
||||||
void ScriptingDialog::initConsole() {
|
void ScriptingDialog::initConsole() {
|
||||||
Q_ASSERT(m_consoleout);
|
Q_ASSERT(m_consoleout);
|
||||||
m_consoleout->init();
|
m_consoleout->init();
|
||||||
|
@ -243,8 +249,7 @@ void ScriptingDialog::buildUpRibbonBar() {
|
||||||
buildViewPage(m_ribbon->addTab(tr("View")));
|
buildViewPage(m_ribbon->addTab(tr("View")));
|
||||||
m_editStateWidgets << buildDebugPage(m_ribbon->addTab(tr("Debugger")));
|
m_editStateWidgets << buildDebugPage(m_ribbon->addTab(tr("Debugger")));
|
||||||
|
|
||||||
// TODO: not available for v1.0.0
|
buildSettingPage(m_ribbon->addTab(tr("Setting")));
|
||||||
// buildSettingPage(m_ribbon->addTab(tr("Setting")));
|
|
||||||
buildAboutPage(m_ribbon->addTab(tr("About")));
|
buildAboutPage(m_ribbon->addTab(tr("About")));
|
||||||
|
|
||||||
connect(m_ribbon, &Ribbon::onDragDropFiles, this,
|
connect(m_ribbon, &Ribbon::onDragDropFiles, this,
|
||||||
|
@ -719,6 +724,7 @@ void ScriptingDialog::registerEditorView(ScriptEditor *editor) {
|
||||||
});
|
});
|
||||||
|
|
||||||
m_language->setLanguage(editor->editor(), QStringLiteral("AngelScript"));
|
m_language->setLanguage(editor->editor(), QStringLiteral("AngelScript"));
|
||||||
|
editor->editor()->addInputBinding(m_snipbind);
|
||||||
|
|
||||||
m_views.append(editor);
|
m_views.append(editor);
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "model/dbgcallstackmodel.h"
|
#include "model/dbgcallstackmodel.h"
|
||||||
#include "model/dbgvarshowmodel.h"
|
#include "model/dbgvarshowmodel.h"
|
||||||
#include "qlanguagefactory.h"
|
#include "qlanguagefactory.h"
|
||||||
|
#include "qsnippetbinding.h"
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
|
@ -70,6 +71,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ScriptingDialog(QWidget *parent = nullptr);
|
explicit ScriptingDialog(QWidget *parent = nullptr);
|
||||||
|
virtual ~ScriptingDialog();
|
||||||
|
|
||||||
void initConsole();
|
void initConsole();
|
||||||
|
|
||||||
|
@ -250,6 +252,7 @@ private:
|
||||||
ads::CDockManager *m_dock = nullptr;
|
ads::CDockManager *m_dock = nullptr;
|
||||||
ads::CDockAreaWidget *m_editorViewArea = nullptr;
|
ads::CDockAreaWidget *m_editorViewArea = nullptr;
|
||||||
QLanguageFactory *m_language = nullptr;
|
QLanguageFactory *m_language = nullptr;
|
||||||
|
QSnippetBinding *m_snipbind = nullptr;
|
||||||
|
|
||||||
QByteArray _defaultLayout;
|
QByteArray _defaultLayout;
|
||||||
QByteArray _savedLayout;
|
QByteArray _savedLayout;
|
||||||
|
|
|
@ -75,6 +75,19 @@ void SettingDialog::showConfig(int index) {
|
||||||
_dialog->exec();
|
_dialog->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingDialog::showConfig(const QString &id) {
|
||||||
|
if (id.isEmpty()) {
|
||||||
|
ui->listWidget->setCurrentRow(0);
|
||||||
|
}
|
||||||
|
auto r = std::find_if(
|
||||||
|
m_pages.begin(), m_pages.end(),
|
||||||
|
[id](const WingHex::SettingPage *page) { return page->id() == id; });
|
||||||
|
if (r == m_pages.end()) {
|
||||||
|
ui->listWidget->setCurrentRow(0);
|
||||||
|
}
|
||||||
|
ui->listWidget->setCurrentRow(m_pages.indexOf(*r));
|
||||||
|
}
|
||||||
|
|
||||||
void SettingDialog::toastTakeEffectReboot() {
|
void SettingDialog::toastTakeEffectReboot() {
|
||||||
auto page = qobject_cast<WingHex::SettingPage *>(sender());
|
auto page = qobject_cast<WingHex::SettingPage *>(sender());
|
||||||
if (page) {
|
if (page) {
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
void addPage(WingHex::SettingPage *page);
|
void addPage(WingHex::SettingPage *page);
|
||||||
void build(); // you can only call once
|
void build(); // you can only call once
|
||||||
void showConfig(int index = -1);
|
void showConfig(int index = -1);
|
||||||
|
void showConfig(const QString &id);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void toastTakeEffectReboot();
|
void toastTakeEffectReboot();
|
||||||
|
|
|
@ -32,7 +32,8 @@ int MetaDataModel::columnCount(const QModelIndex &parent) const {
|
||||||
|
|
||||||
QVariant MetaDataModel::data(const QModelIndex &index, int role) const {
|
QVariant MetaDataModel::data(const QModelIndex &index, int role) const {
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole: {
|
case Qt::DisplayRole:
|
||||||
|
case Qt::ToolTipRole: {
|
||||||
auto r = index.row();
|
auto r = index.row();
|
||||||
const auto &b = _doc->metadata()->getAllMetadata();
|
const auto &b = _doc->metadata()->getAllMetadata();
|
||||||
auto d = b.at(r);
|
auto d = b.at(r);
|
||||||
|
@ -47,52 +48,28 @@ QVariant MetaDataModel::data(const QModelIndex &index, int role) const {
|
||||||
if (d.foreground.alpha() == 0) {
|
if (d.foreground.alpha() == 0) {
|
||||||
return QStringLiteral("-");
|
return QStringLiteral("-");
|
||||||
}
|
}
|
||||||
return QVariant();
|
return d.foreground.name();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
if (d.background.alpha() == 0) {
|
if (d.background.alpha() == 0) {
|
||||||
return QStringLiteral("-");
|
return QStringLiteral("-");
|
||||||
}
|
}
|
||||||
return QVariant();
|
return d.background.name();
|
||||||
break;
|
|
||||||
case 4:
|
case 4:
|
||||||
return d.comment;
|
return d.comment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case Qt::ToolTipRole: {
|
case Qt::DecorationRole: {
|
||||||
auto r = index.row();
|
|
||||||
const auto &b = _doc->metadata()->getAllMetadata();
|
|
||||||
auto d = b.at(r);
|
|
||||||
switch (index.column()) {
|
|
||||||
case 2: {
|
|
||||||
if (d.foreground.alpha() == 0) {
|
|
||||||
return QStringLiteral("-");
|
|
||||||
} else {
|
|
||||||
return d.foreground.name();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
if (d.background.alpha() == 0) {
|
|
||||||
return QStringLiteral("-");
|
|
||||||
} else {
|
|
||||||
return d.background.name();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
return d.comment;
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case Qt::BackgroundRole: {
|
|
||||||
auto r = index.row();
|
auto r = index.row();
|
||||||
const auto &b = _doc->metadata()->getAllMetadata();
|
const auto &b = _doc->metadata()->getAllMetadata();
|
||||||
auto d = b.at(r);
|
auto d = b.at(r);
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 2:
|
case 2:
|
||||||
return d.foreground;
|
if (d.foreground.alpha() > 0)
|
||||||
|
return d.foreground;
|
||||||
case 3:
|
case 3:
|
||||||
return d.background;
|
if (d.background.alpha() > 0)
|
||||||
|
return d.background;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QMap>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
|
@ -496,6 +497,10 @@ signals:
|
||||||
|
|
||||||
class IWingPlugin : public QObject {
|
class IWingPlugin : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
// TODO: implement the basic type only
|
||||||
|
typedef std::function<QVariant(const QVariantList &)> ScriptFn;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual int sdkVersion() const = 0;
|
virtual int sdkVersion() const = 0;
|
||||||
virtual const QString signature() const = 0;
|
virtual const QString signature() const = 0;
|
||||||
|
@ -515,11 +520,18 @@ public:
|
||||||
virtual QList<WingRibbonToolBoxInfo> registeredRibbonTools() const {
|
virtual QList<WingRibbonToolBoxInfo> registeredRibbonTools() const {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
virtual QList<SettingPage *> registeredSettingPages() const { return {}; }
|
// QMap<page, whether is visible in setting tab>
|
||||||
|
virtual QHash<SettingPage *, bool> registeredSettingPages() const {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
virtual QList<PluginPage *> registeredPages() const { return {}; }
|
||||||
virtual QList<WingEditorViewWidget *> registeredEditorViewWidgets() const {
|
virtual QList<WingEditorViewWidget *> registeredEditorViewWidgets() const {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QHash<signature, fn>
|
||||||
|
virtual QHash<QString, ScriptFn> registeredScriptFn() { return {}; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// extension and exposed to WingHexAngelScript
|
// extension and exposed to WingHexAngelScript
|
||||||
void toast(const QPixmap &icon, const QString &message);
|
void toast(const QPixmap &icon, const QString &message);
|
||||||
|
|
|
@ -130,17 +130,28 @@ void PluginSystem::cleanUpEditorViewHandle(EditorView *view) {
|
||||||
// clean up
|
// clean up
|
||||||
for (auto &plg : v) {
|
for (auto &plg : v) {
|
||||||
auto handles = m_plgHandles.value(plg);
|
auto handles = m_plgHandles.value(plg);
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
handles.erase(
|
handles.erase(
|
||||||
std::remove_if(handles.begin(), handles.end(),
|
std::remove_if(handles.begin(), handles.end(),
|
||||||
[view](const QPair<int, EditorView *> &v) {
|
[view](const QPair<int, EditorView *> &v) {
|
||||||
return v.second == view;
|
return v.second == view;
|
||||||
}));
|
}));
|
||||||
}
|
|
||||||
|
|
||||||
|
#else
|
||||||
|
handles.removeIf([view](const QPair<int, EditorView *> &v) {
|
||||||
|
return v.second == view;
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
}
|
||||||
m_viewBindings.remove(view);
|
m_viewBindings.remove(view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PluginSystem::registerFn(IWingPlugin *plg,
|
||||||
|
const IWingPlugin::ScriptFn &fn) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
bool PluginSystem::loadPlugin(IWingPlugin *p) {
|
bool PluginSystem::loadPlugin(IWingPlugin *p) {
|
||||||
QList<WingPluginInfo> loadedplginfos;
|
QList<WingPluginInfo> loadedplginfos;
|
||||||
try {
|
try {
|
||||||
|
@ -267,17 +278,43 @@ bool PluginSystem::loadPlugin(IWingPlugin *p) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->registeredHexContextMenu()) {
|
{
|
||||||
_win->m_hexContextMenu.append(p->registeredHexContextMenu());
|
auto menu = p->registeredHexContextMenu();
|
||||||
|
if (menu) {
|
||||||
|
_win->m_hexContextMenu.append(menu);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p->registeredEditorViewWidgets().isEmpty()) {
|
{
|
||||||
_win->m_editorViewWidgets.insert(p,
|
auto vieww = p->registeredEditorViewWidgets();
|
||||||
p->registeredEditorViewWidgets());
|
if (!vieww.isEmpty()) {
|
||||||
|
_win->m_editorViewWidgets.insert(p, vieww);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!p->registeredSettingPages().isEmpty()) {
|
{
|
||||||
_win->m_settingPages.append(p->registeredSettingPages());
|
auto sp = p->registeredSettingPages();
|
||||||
|
if (!sp.isEmpty()) {
|
||||||
|
for (auto page = sp.keyBegin(); page != sp.keyEnd(); ++page) {
|
||||||
|
auto pp = *page;
|
||||||
|
pp->setProperty("__plg__", QVariant::fromValue(p));
|
||||||
|
}
|
||||||
|
_win->m_settingPages.insert(sp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto rp = p->registeredPages();
|
||||||
|
if (!rp.isEmpty()) {
|
||||||
|
for (auto &page : rp) {
|
||||||
|
page->setProperty("__plg__", QVariant::fromValue(p));
|
||||||
|
}
|
||||||
|
_win->m_plgPages.append(rp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &fn : p->registeredScriptFn()) {
|
||||||
|
registerFn(p, fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
connectInterface(p);
|
connectInterface(p);
|
||||||
|
|
|
@ -115,6 +115,8 @@ public:
|
||||||
|
|
||||||
void cleanUpEditorViewHandle(EditorView *view);
|
void cleanUpEditorViewHandle(EditorView *view);
|
||||||
|
|
||||||
|
void registerFn(IWingPlugin *plg, const IWingPlugin::ScriptFn &fn);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool loadPlugin(IWingPlugin *p);
|
bool loadPlugin(IWingPlugin *p);
|
||||||
|
|
||||||
|
|
|
@ -22,23 +22,35 @@
|
||||||
|
|
||||||
namespace WingHex {
|
namespace WingHex {
|
||||||
|
|
||||||
class SettingPage : public QWidget {
|
class PageBase : public QWidget {
|
||||||
|
public:
|
||||||
|
explicit PageBase(QWidget *parent = nullptr) : QWidget(parent) {}
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual QIcon categoryIcon() const = 0;
|
||||||
|
virtual QString name() const = 0;
|
||||||
|
virtual QString id() const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SettingPage : public PageBase {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit SettingPage(QWidget *parent = nullptr) : QWidget(parent) {}
|
explicit SettingPage(QWidget *parent = nullptr) : PageBase(parent) {}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void optionNeedRestartChanged();
|
void optionNeedRestartChanged();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const = 0;
|
|
||||||
virtual QString name() const = 0;
|
|
||||||
virtual bool isInPluginPage() const = 0;
|
|
||||||
virtual void apply() = 0;
|
virtual void apply() = 0;
|
||||||
virtual void reset() = 0;
|
virtual void reset() = 0;
|
||||||
virtual void cancel() = 0;
|
virtual void cancel() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PluginPage : public PageBase {
|
||||||
|
public:
|
||||||
|
explicit PluginPage(QWidget *parent = nullptr) : PageBase(parent) {}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace WingHex
|
} // namespace WingHex
|
||||||
|
|
||||||
#endif // SETTINGPAGE_H
|
#endif // SETTINGPAGE_H
|
||||||
|
|
|
@ -192,7 +192,7 @@ QIcon QEditConfig::categoryIcon() const { return ICONRES("file"); }
|
||||||
|
|
||||||
QString QEditConfig::name() const { return tr("Edit"); }
|
QString QEditConfig::name() const { return tr("Edit"); }
|
||||||
|
|
||||||
bool QEditConfig::isInPluginPage() const { return false; }
|
QString QEditConfig::id() const { return QStringLiteral("Edit"); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Fills the widget subcontrols from a settings map
|
\brief Fills the widget subcontrols from a settings map
|
||||||
|
|
|
@ -20,8 +20,7 @@ public:
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const override;
|
virtual QIcon categoryIcon() const override;
|
||||||
virtual QString name() const override;
|
virtual QString name() const override;
|
||||||
virtual bool isInPluginPage() const override;
|
virtual QString id() const override;
|
||||||
|
|
||||||
virtual void apply() override;
|
virtual void apply() override;
|
||||||
virtual void cancel() override;
|
virtual void cancel() override;
|
||||||
virtual void reset() override;
|
virtual void reset() override;
|
||||||
|
|
|
@ -103,8 +103,6 @@ QIcon QFormatConfig::categoryIcon() const { return ICONRES(""); }
|
||||||
|
|
||||||
QString QFormatConfig::name() const { return tr("Format"); }
|
QString QFormatConfig::name() const { return tr("Format"); }
|
||||||
|
|
||||||
bool QFormatConfig::isInPluginPage() const { return false; }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Add a format scheme to the config widget
|
\brief Add a format scheme to the config widget
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ public:
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const override;
|
virtual QIcon categoryIcon() const override;
|
||||||
virtual QString name() const override;
|
virtual QString name() const override;
|
||||||
virtual bool isInPluginPage() const override;
|
|
||||||
virtual void apply() override;
|
virtual void apply() override;
|
||||||
virtual void cancel() override;
|
virtual void cancel() override;
|
||||||
virtual void reset() override;
|
virtual void reset() override;
|
||||||
|
|
|
@ -34,13 +34,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
QSnippetEdit::QSnippetEdit(QWidget *p)
|
QSnippetEdit::QSnippetEdit(QWidget *p)
|
||||||
: QWidget(p), m_editedSnippet(-1), m_manager(nullptr) {
|
: QWidget(p), ui(new Ui::QSnippetEdit), m_editedSnippet(-1),
|
||||||
|
m_manager(nullptr) {
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSnippetEdit::QSnippetEdit(QSnippetManager *mgr, QWidget *p)
|
QSnippetEdit::QSnippetEdit(QSnippetManager *mgr, QWidget *p)
|
||||||
: QWidget(p), m_editedSnippet(-1), m_manager(nullptr) {
|
: QWidget(p), ui(new Ui::QSnippetEdit), m_editedSnippet(-1),
|
||||||
|
m_manager(nullptr) {
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setSnippetManager(mgr);
|
setSnippetManager(mgr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ QIcon EditorSettingDialog::categoryIcon() const { return ICONRES("edit"); }
|
||||||
|
|
||||||
QString EditorSettingDialog::name() const { return tr("Editor"); }
|
QString EditorSettingDialog::name() const { return tr("Editor"); }
|
||||||
|
|
||||||
bool EditorSettingDialog::isInPluginPage() const { return false; }
|
QString EditorSettingDialog::id() const { return QStringLiteral("Editor"); }
|
||||||
|
|
||||||
void EditorSettingDialog::apply() {
|
void EditorSettingDialog::apply() {
|
||||||
auto &set = SettingManager::instance();
|
auto &set = SettingManager::instance();
|
||||||
|
|
|
@ -41,7 +41,7 @@ private:
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const override;
|
virtual QIcon categoryIcon() const override;
|
||||||
virtual QString name() const override;
|
virtual QString name() const override;
|
||||||
virtual bool isInPluginPage() const override;
|
virtual QString id() const override;
|
||||||
virtual void apply() override;
|
virtual void apply() override;
|
||||||
virtual void reset() override;
|
virtual void reset() override;
|
||||||
virtual void cancel() override;
|
virtual void cancel() override;
|
||||||
|
|
|
@ -111,7 +111,7 @@ QIcon GeneralSettingDialog::categoryIcon() const { return ICONRES("general"); }
|
||||||
|
|
||||||
QString GeneralSettingDialog::name() const { return tr("General"); }
|
QString GeneralSettingDialog::name() const { return tr("General"); }
|
||||||
|
|
||||||
bool GeneralSettingDialog::isInPluginPage() const { return false; }
|
QString GeneralSettingDialog::id() const { return QStringLiteral("General"); }
|
||||||
|
|
||||||
void GeneralSettingDialog::apply() {
|
void GeneralSettingDialog::apply() {
|
||||||
auto &set = SettingManager::instance();
|
auto &set = SettingManager::instance();
|
||||||
|
|
|
@ -41,7 +41,7 @@ private:
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const override;
|
virtual QIcon categoryIcon() const override;
|
||||||
virtual QString name() const override;
|
virtual QString name() const override;
|
||||||
virtual bool isInPluginPage() const override;
|
virtual QString id() const override;
|
||||||
virtual void apply() override;
|
virtual void apply() override;
|
||||||
virtual void reset() override;
|
virtual void reset() override;
|
||||||
virtual void cancel() override;
|
virtual void cancel() override;
|
||||||
|
|
|
@ -64,7 +64,7 @@ QIcon OtherSettingsDialog::categoryIcon() const { return ICONRES("other"); }
|
||||||
|
|
||||||
QString OtherSettingsDialog::name() const { return tr("Others"); }
|
QString OtherSettingsDialog::name() const { return tr("Others"); }
|
||||||
|
|
||||||
bool OtherSettingsDialog::isInPluginPage() const { return false; }
|
QString OtherSettingsDialog::id() const { return QStringLiteral("Others"); }
|
||||||
|
|
||||||
void OtherSettingsDialog::apply() {
|
void OtherSettingsDialog::apply() {
|
||||||
auto &set = SettingManager::instance();
|
auto &set = SettingManager::instance();
|
||||||
|
|
|
@ -41,7 +41,7 @@ private:
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const override;
|
virtual QIcon categoryIcon() const override;
|
||||||
virtual QString name() const override;
|
virtual QString name() const override;
|
||||||
virtual bool isInPluginPage() const override;
|
virtual QString id() const override;
|
||||||
virtual void apply() override;
|
virtual void apply() override;
|
||||||
virtual void reset() override;
|
virtual void reset() override;
|
||||||
virtual void cancel() override;
|
virtual void cancel() override;
|
||||||
|
|
|
@ -47,13 +47,10 @@ PluginSettingDialog::PluginSettingDialog(QWidget *parent)
|
||||||
|
|
||||||
PluginSettingDialog::~PluginSettingDialog() { delete ui; }
|
PluginSettingDialog::~PluginSettingDialog() { delete ui; }
|
||||||
|
|
||||||
void PluginSettingDialog::buildUp(const QList<SettingPage *> &pages) {
|
void PluginSettingDialog::buildUp(const QList<PluginPage *> &pages) {
|
||||||
ASSERT_SINGLETON;
|
ASSERT_SINGLETON;
|
||||||
for (auto &page : pages) {
|
for (auto &page : pages) {
|
||||||
if (page->isInPluginPage()) {
|
ui->tabWidget->addTab(page, page->categoryIcon(), page->name());
|
||||||
ui->tabWidget->addTab(page, page->categoryIcon(), page->name());
|
|
||||||
_pages << page;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,24 +66,17 @@ QIcon PluginSettingDialog::categoryIcon() const { return ICONRES("plugin"); }
|
||||||
|
|
||||||
QString PluginSettingDialog::name() const { return tr("Plugin"); }
|
QString PluginSettingDialog::name() const { return tr("Plugin"); }
|
||||||
|
|
||||||
bool PluginSettingDialog::isInPluginPage() const { return false; }
|
QString PluginSettingDialog::id() const { return QStringLiteral("Plugin"); }
|
||||||
|
|
||||||
void PluginSettingDialog::apply() {
|
void PluginSettingDialog::apply() {
|
||||||
auto &set = SettingManager::instance();
|
auto &set = SettingManager::instance();
|
||||||
set.setEnablePlugin(ui->cbEnablePlugin->isChecked());
|
set.setEnablePlugin(ui->cbEnablePlugin->isChecked());
|
||||||
set.setEnablePlgInRoot(ui->cbEnablePluginRoot->isChecked());
|
set.setEnablePlgInRoot(ui->cbEnablePluginRoot->isChecked());
|
||||||
set.save(SettingManager::SETTING::PLUGIN);
|
set.save(SettingManager::SETTING::PLUGIN);
|
||||||
|
|
||||||
for (auto &page : _pages) {
|
|
||||||
page->apply();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginSettingDialog::reset() {
|
void PluginSettingDialog::reset() {
|
||||||
SettingManager::instance().reset(SettingManager::SETTING::PLUGIN);
|
SettingManager::instance().reset(SettingManager::SETTING::PLUGIN);
|
||||||
for (auto &page : _pages) {
|
|
||||||
page->reset();
|
|
||||||
}
|
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,10 @@ public:
|
||||||
explicit PluginSettingDialog(QWidget *parent = nullptr);
|
explicit PluginSettingDialog(QWidget *parent = nullptr);
|
||||||
~PluginSettingDialog();
|
~PluginSettingDialog();
|
||||||
|
|
||||||
void buildUp(const QList<WingHex::SettingPage *> &pages);
|
void buildUp(const QList<WingHex::PluginPage *> &pages);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PluginSettingDialog *ui;
|
Ui::PluginSettingDialog *ui;
|
||||||
QList<WingHex::SettingPage *> _pages;
|
|
||||||
|
|
||||||
void reload();
|
void reload();
|
||||||
|
|
||||||
|
@ -44,7 +43,7 @@ private:
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const override;
|
virtual QIcon categoryIcon() const override;
|
||||||
virtual QString name() const override;
|
virtual QString name() const override;
|
||||||
virtual bool isInPluginPage() const override;
|
virtual QString id() const override;
|
||||||
virtual void apply() override;
|
virtual void apply() override;
|
||||||
virtual void reset() override;
|
virtual void reset() override;
|
||||||
virtual void cancel() override;
|
virtual void cancel() override;
|
||||||
|
|
|
@ -76,7 +76,7 @@ QIcon ScriptSettingDialog::categoryIcon() const { return ICONRES("script"); }
|
||||||
|
|
||||||
QString ScriptSettingDialog::name() const { return tr("Script"); }
|
QString ScriptSettingDialog::name() const { return tr("Script"); }
|
||||||
|
|
||||||
bool ScriptSettingDialog::isInPluginPage() const { return false; }
|
QString ScriptSettingDialog::id() const { return QStringLiteral("Script"); }
|
||||||
|
|
||||||
void ScriptSettingDialog::apply() {
|
void ScriptSettingDialog::apply() {
|
||||||
QStringList usrHideCats;
|
QStringList usrHideCats;
|
||||||
|
|
|
@ -48,7 +48,7 @@ private:
|
||||||
public:
|
public:
|
||||||
virtual QIcon categoryIcon() const override;
|
virtual QIcon categoryIcon() const override;
|
||||||
virtual QString name() const override;
|
virtual QString name() const override;
|
||||||
virtual bool isInPluginPage() const override;
|
virtual QString id() const override;
|
||||||
virtual void apply() override;
|
virtual void apply() override;
|
||||||
virtual void reset() override;
|
virtual void reset() override;
|
||||||
virtual void cancel() override;
|
virtual void cancel() override;
|
||||||
|
|
Loading…
Reference in New Issue