2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Dmitry Savchenko
|
|
|
|
|
// Copyright (C) 2016 Vasiliy Sorokin
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-10-25 23:14:27 +03:00
|
|
|
|
|
|
|
|
#include "settings.h"
|
2023-11-21 14:52:14 +01:00
|
|
|
|
2011-10-25 23:14:27 +03:00
|
|
|
#include "constants.h"
|
2023-11-21 14:52:14 +01:00
|
|
|
#include "keyword.h"
|
|
|
|
|
#include "keyworddialog.h"
|
2024-01-30 17:15:10 +01:00
|
|
|
#include "todoitemsprovider.h"
|
|
|
|
|
#include "todooutputpane.h"
|
2023-11-21 14:52:14 +01:00
|
|
|
#include "todotr.h"
|
2011-10-25 23:14:27 +03:00
|
|
|
|
2014-06-13 11:19:54 +02:00
|
|
|
#include <coreplugin/coreconstants.h>
|
2023-11-21 14:52:14 +01:00
|
|
|
#include <coreplugin/dialogs/ioptionspage.h>
|
2024-01-30 17:15:10 +01:00
|
|
|
#include <coreplugin/icore.h>
|
2023-09-22 16:15:27 +02:00
|
|
|
|
2023-11-21 14:52:14 +01:00
|
|
|
#include <utils/layoutbuilder.h>
|
2023-09-22 16:15:27 +02:00
|
|
|
#include <utils/qtcsettings.h>
|
2017-01-05 17:13:42 +01:00
|
|
|
#include <utils/theme/theme.h>
|
2014-05-19 12:21:28 +02:00
|
|
|
|
2023-11-21 14:52:14 +01:00
|
|
|
#include <QGroupBox>
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QRadioButton>
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
using namespace Core;
|
2023-09-22 16:15:27 +02:00
|
|
|
using namespace Utils;
|
2012-02-24 09:43:52 +01:00
|
|
|
|
2023-11-21 14:52:14 +01:00
|
|
|
namespace Todo::Internal {
|
2011-10-25 23:14:27 +03:00
|
|
|
|
2024-01-30 15:37:34 +01:00
|
|
|
Settings &todoSettings()
|
|
|
|
|
{
|
|
|
|
|
static Settings theTodoSettings;
|
|
|
|
|
return theTodoSettings;
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
void Settings::save() const
|
2011-10-25 23:14:27 +03:00
|
|
|
{
|
2017-01-06 17:44:51 +01:00
|
|
|
if (!keywordsEdited)
|
|
|
|
|
return;
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
QtcSettings *settings = ICore::settings();
|
2017-10-01 14:26:10 +02:00
|
|
|
settings->beginGroup(Constants::SETTINGS_GROUP);
|
|
|
|
|
settings->setValue(Constants::SCANNING_SCOPE, scanningScope);
|
2012-02-24 09:43:52 +01:00
|
|
|
|
2017-10-01 14:26:10 +02:00
|
|
|
settings->beginWriteArray(Constants::KEYWORDS_LIST);
|
2012-02-24 09:43:52 +01:00
|
|
|
if (const int size = keywords.size()) {
|
2023-09-22 16:15:27 +02:00
|
|
|
const Key nameKey = "name";
|
|
|
|
|
const Key colorKey = "color";
|
|
|
|
|
const Key iconTypeKey = "iconType";
|
2012-02-24 09:43:52 +01:00
|
|
|
for (int i = 0; i < size; ++i) {
|
|
|
|
|
settings->setArrayIndex(i);
|
|
|
|
|
settings->setValue(nameKey, keywords.at(i).name);
|
|
|
|
|
settings->setValue(colorKey, keywords.at(i).color);
|
2015-11-16 16:45:05 +01:00
|
|
|
settings->setValue(iconTypeKey, static_cast<int>(keywords.at(i).iconType));
|
2012-02-24 09:43:52 +01:00
|
|
|
}
|
2011-10-25 23:14:27 +03:00
|
|
|
}
|
|
|
|
|
settings->endArray();
|
|
|
|
|
|
|
|
|
|
settings->endGroup();
|
|
|
|
|
settings->sync();
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
void Settings::load()
|
2011-10-25 23:14:27 +03:00
|
|
|
{
|
|
|
|
|
setDefault();
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
QtcSettings *settings = ICore::settings();
|
2017-10-01 14:26:10 +02:00
|
|
|
settings->beginGroup(Constants::SETTINGS_GROUP);
|
2011-10-25 23:14:27 +03:00
|
|
|
|
2017-10-01 14:26:10 +02:00
|
|
|
scanningScope = static_cast<ScanningScope>(settings->value(Constants::SCANNING_SCOPE,
|
2016-03-03 13:48:07 +01:00
|
|
|
ScanningScopeCurrentFile).toInt());
|
2016-08-31 15:19:27 +02:00
|
|
|
if (scanningScope >= ScanningScopeMax)
|
|
|
|
|
scanningScope = ScanningScopeCurrentFile;
|
2011-10-25 23:14:27 +03:00
|
|
|
|
|
|
|
|
KeywordList newKeywords;
|
2017-10-01 14:26:10 +02:00
|
|
|
const int keywordsSize = settings->beginReadArray(Constants::KEYWORDS_LIST);
|
2015-05-18 22:47:20 +03:00
|
|
|
if (keywordsSize > 0) {
|
2023-09-22 16:15:27 +02:00
|
|
|
const Key nameKey = "name";
|
|
|
|
|
const Key colorKey = "color";
|
|
|
|
|
const Key iconTypeKey = "iconType";
|
2015-05-18 22:47:20 +03:00
|
|
|
for (int i = 0; i < keywordsSize; ++i) {
|
2011-10-25 23:14:27 +03:00
|
|
|
settings->setArrayIndex(i);
|
|
|
|
|
Keyword keyword;
|
2012-02-24 09:43:52 +01:00
|
|
|
keyword.name = settings->value(nameKey).toString();
|
|
|
|
|
keyword.color = settings->value(colorKey).value<QColor>();
|
2018-03-03 09:50:19 +01:00
|
|
|
keyword.iconType = static_cast<IconType>(settings->value(iconTypeKey).toInt());
|
2011-10-25 23:14:27 +03:00
|
|
|
newKeywords << keyword;
|
|
|
|
|
}
|
|
|
|
|
keywords = newKeywords;
|
2017-01-06 17:44:51 +01:00
|
|
|
keywordsEdited = true; // Otherwise they wouldn't have been saved
|
2011-10-25 23:14:27 +03:00
|
|
|
}
|
|
|
|
|
settings->endArray();
|
|
|
|
|
|
|
|
|
|
settings->endGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Settings::setDefault()
|
|
|
|
|
{
|
|
|
|
|
scanningScope = ScanningScopeCurrentFile;
|
2017-01-05 17:13:42 +01:00
|
|
|
Utils::Theme *theme = Utils::creatorTheme();
|
2011-10-25 23:14:27 +03:00
|
|
|
|
|
|
|
|
keywords.clear();
|
|
|
|
|
|
|
|
|
|
Keyword keyword;
|
|
|
|
|
|
2017-10-01 14:26:10 +02:00
|
|
|
keyword.name = "TODO";
|
2016-07-20 21:24:00 +03:00
|
|
|
keyword.iconType = IconType::Todo;
|
2017-01-05 17:13:42 +01:00
|
|
|
keyword.color = theme->color(Utils::Theme::OutputPanes_NormalMessageTextColor);
|
2011-10-25 23:14:27 +03:00
|
|
|
keywords.append(keyword);
|
|
|
|
|
|
2023-08-23 07:18:49 +02:00
|
|
|
keyword.name = R"(\todo)";
|
|
|
|
|
keyword.iconType = IconType::Todo;
|
|
|
|
|
keyword.color = theme->color(Utils::Theme::OutputPanes_NormalMessageTextColor);
|
|
|
|
|
keywords.append(keyword);
|
|
|
|
|
|
2017-10-01 14:26:10 +02:00
|
|
|
keyword.name = "NOTE";
|
2015-11-16 16:45:05 +01:00
|
|
|
keyword.iconType = IconType::Info;
|
2017-01-05 17:13:42 +01:00
|
|
|
keyword.color = theme->color(Utils::Theme::OutputPanes_NormalMessageTextColor);
|
2011-10-25 23:14:27 +03:00
|
|
|
keywords.append(keyword);
|
|
|
|
|
|
2017-10-01 14:26:10 +02:00
|
|
|
keyword.name = "FIXME";
|
2015-11-16 16:45:05 +01:00
|
|
|
keyword.iconType = IconType::Error;
|
2017-01-05 17:13:42 +01:00
|
|
|
keyword.color = theme->color(Utils::Theme::OutputPanes_ErrorMessageTextColor);
|
2011-10-25 23:14:27 +03:00
|
|
|
keywords.append(keyword);
|
|
|
|
|
|
2017-10-01 14:26:10 +02:00
|
|
|
keyword.name = "BUG";
|
2016-07-20 21:24:00 +03:00
|
|
|
keyword.iconType = IconType::Bug;
|
2017-01-05 17:13:42 +01:00
|
|
|
keyword.color = theme->color(Utils::Theme::OutputPanes_ErrorMessageTextColor);
|
2011-10-25 23:14:27 +03:00
|
|
|
keywords.append(keyword);
|
|
|
|
|
|
2017-10-01 14:26:10 +02:00
|
|
|
keyword.name = "WARNING";
|
2015-11-16 16:45:05 +01:00
|
|
|
keyword.iconType = IconType::Warning;
|
2017-01-05 17:13:42 +01:00
|
|
|
keyword.color = theme->color(Utils::Theme::OutputPanes_WarningMessageTextColor);
|
2011-10-25 23:14:27 +03:00
|
|
|
keywords.append(keyword);
|
2017-01-06 17:44:51 +01:00
|
|
|
|
|
|
|
|
keywordsEdited = false;
|
2011-10-25 23:14:27 +03:00
|
|
|
}
|
|
|
|
|
|
2024-01-30 15:37:34 +01:00
|
|
|
static bool operator==(const Settings &s1, const Settings &s2)
|
2011-10-25 23:14:27 +03:00
|
|
|
{
|
2024-01-30 15:37:34 +01:00
|
|
|
return s1.keywords == s2.keywords
|
|
|
|
|
&& s1.scanningScope == s2.scanningScope
|
|
|
|
|
&& s1.keywordsEdited == s2.keywordsEdited;
|
2011-10-25 23:14:27 +03:00
|
|
|
}
|
|
|
|
|
|
2023-11-21 14:52:14 +01:00
|
|
|
class OptionsDialog final : public Core::IOptionsPageWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
2024-01-30 17:15:10 +01:00
|
|
|
OptionsDialog();
|
2023-11-21 14:52:14 +01:00
|
|
|
|
|
|
|
|
void apply() final;
|
|
|
|
|
|
|
|
|
|
void setSettings(const Settings &settings);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void addKeywordButtonClicked();
|
|
|
|
|
void editKeywordButtonClicked();
|
|
|
|
|
void removeKeywordButtonClicked();
|
|
|
|
|
void resetKeywordsButtonClicked();
|
|
|
|
|
void setKeywordsButtonsEnabled();
|
|
|
|
|
Settings settingsFromUi();
|
|
|
|
|
void addToKeywordsList(const Keyword &keyword);
|
|
|
|
|
void editKeyword(QListWidgetItem *item);
|
|
|
|
|
QSet<QString> keywordNames();
|
|
|
|
|
|
|
|
|
|
QListWidget *m_keywordsList;
|
|
|
|
|
QPushButton *m_editKeywordButton;
|
|
|
|
|
QPushButton *m_removeKeywordButton;
|
|
|
|
|
QPushButton *resetKeywordsButton;
|
|
|
|
|
QRadioButton *m_scanInProjectRadioButton;
|
|
|
|
|
QRadioButton *m_scanInCurrentFileRadioButton;
|
|
|
|
|
QRadioButton *m_scanInSubprojectRadioButton;
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
OptionsDialog::OptionsDialog()
|
2023-11-21 14:52:14 +01:00
|
|
|
{
|
|
|
|
|
m_keywordsList = new QListWidget;
|
|
|
|
|
m_keywordsList->setDragDropMode(QAbstractItemView::DragDrop);
|
|
|
|
|
m_keywordsList->setDefaultDropAction(Qt::MoveAction);
|
|
|
|
|
m_keywordsList->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
|
m_keywordsList->setSortingEnabled(false);
|
|
|
|
|
|
|
|
|
|
auto addKeywordButton = new QPushButton(Tr::tr("Add"));
|
|
|
|
|
m_editKeywordButton = new QPushButton(Tr::tr("Edit"));
|
|
|
|
|
m_removeKeywordButton = new QPushButton(Tr::tr("Remove"));
|
|
|
|
|
resetKeywordsButton = new QPushButton(Tr::tr("Reset"));
|
|
|
|
|
|
|
|
|
|
m_scanInProjectRadioButton = new QRadioButton(Tr::tr("Scan the whole active project"));
|
|
|
|
|
m_scanInProjectRadioButton->setEnabled(true);
|
|
|
|
|
|
|
|
|
|
m_scanInCurrentFileRadioButton = new QRadioButton(Tr::tr("Scan only the currently edited document"));
|
|
|
|
|
m_scanInCurrentFileRadioButton->setChecked(true);
|
|
|
|
|
|
|
|
|
|
m_scanInSubprojectRadioButton = new QRadioButton(Tr::tr("Scan the current subproject"));
|
|
|
|
|
|
|
|
|
|
using namespace Layouting;
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
Group {
|
|
|
|
|
title(Tr::tr("Keywords")),
|
|
|
|
|
Row {
|
|
|
|
|
m_keywordsList,
|
|
|
|
|
Column {
|
|
|
|
|
addKeywordButton,
|
|
|
|
|
m_editKeywordButton,
|
|
|
|
|
m_removeKeywordButton,
|
|
|
|
|
resetKeywordsButton,
|
|
|
|
|
st
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
Group {
|
2024-05-14 14:54:45 +02:00
|
|
|
title(Tr::tr("Scanning Scope")),
|
2023-11-21 14:52:14 +01:00
|
|
|
Column {
|
|
|
|
|
m_scanInProjectRadioButton,
|
|
|
|
|
m_scanInCurrentFileRadioButton,
|
|
|
|
|
m_scanInSubprojectRadioButton
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}.attachTo(this);
|
|
|
|
|
|
|
|
|
|
m_keywordsList->setIconSize(QSize(16, 16));
|
|
|
|
|
setKeywordsButtonsEnabled();
|
|
|
|
|
connect(addKeywordButton, &QAbstractButton::clicked,
|
|
|
|
|
this, &OptionsDialog::addKeywordButtonClicked);
|
|
|
|
|
connect(m_removeKeywordButton, &QAbstractButton::clicked,
|
|
|
|
|
this, &OptionsDialog::removeKeywordButtonClicked);
|
|
|
|
|
connect(m_editKeywordButton, &QAbstractButton::clicked,
|
|
|
|
|
this, &OptionsDialog::editKeywordButtonClicked);
|
|
|
|
|
connect(resetKeywordsButton, &QAbstractButton::clicked,
|
|
|
|
|
this, &OptionsDialog::resetKeywordsButtonClicked);
|
|
|
|
|
connect(m_keywordsList, &QListWidget::itemDoubleClicked,
|
|
|
|
|
this, &OptionsDialog::editKeyword);
|
|
|
|
|
connect(m_keywordsList, &QListWidget::itemSelectionChanged,
|
|
|
|
|
this, &OptionsDialog::setKeywordsButtonsEnabled);
|
|
|
|
|
|
2024-01-30 15:37:34 +01:00
|
|
|
setSettings(todoSettings());
|
2023-11-21 14:52:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::addToKeywordsList(const Keyword &keyword)
|
|
|
|
|
{
|
|
|
|
|
auto item = new QListWidgetItem(icon(keyword.iconType), keyword.name);
|
|
|
|
|
item->setData(Qt::UserRole, static_cast<int>(keyword.iconType));
|
|
|
|
|
item->setForeground(keyword.color);
|
|
|
|
|
m_keywordsList->addItem(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QSet<QString> OptionsDialog::keywordNames()
|
|
|
|
|
{
|
|
|
|
|
const KeywordList keywords = settingsFromUi().keywords;
|
|
|
|
|
|
|
|
|
|
QSet<QString> result;
|
|
|
|
|
for (const Keyword &keyword : keywords)
|
|
|
|
|
result << keyword.name;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::addKeywordButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
Keyword keyword;
|
|
|
|
|
KeywordDialog keywordDialog(keyword, keywordNames(), this);
|
|
|
|
|
if (keywordDialog.exec() == QDialog::Accepted) {
|
|
|
|
|
keyword = keywordDialog.keyword();
|
|
|
|
|
addToKeywordsList(keyword);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::editKeywordButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
QListWidgetItem *item = m_keywordsList->currentItem();
|
|
|
|
|
editKeyword(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::editKeyword(QListWidgetItem *item)
|
|
|
|
|
{
|
|
|
|
|
Keyword keyword;
|
|
|
|
|
keyword.name = item->text();
|
|
|
|
|
keyword.iconType = static_cast<IconType>(item->data(Qt::UserRole).toInt());
|
|
|
|
|
keyword.color = item->foreground().color();
|
|
|
|
|
|
|
|
|
|
QSet<QString> keywordNamesButThis = keywordNames();
|
|
|
|
|
keywordNamesButThis.remove(keyword.name);
|
|
|
|
|
|
|
|
|
|
KeywordDialog keywordDialog(keyword, keywordNamesButThis, this);
|
|
|
|
|
if (keywordDialog.exec() == QDialog::Accepted) {
|
|
|
|
|
keyword = keywordDialog.keyword();
|
|
|
|
|
item->setIcon(icon(keyword.iconType));
|
|
|
|
|
item->setText(keyword.name);
|
|
|
|
|
item->setData(Qt::UserRole, static_cast<int>(keyword.iconType));
|
|
|
|
|
item->setForeground(keyword.color);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::removeKeywordButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
delete m_keywordsList->takeItem(m_keywordsList->currentRow());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::resetKeywordsButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
Settings newSettings;
|
|
|
|
|
newSettings.setDefault();
|
|
|
|
|
setSettings(newSettings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::setKeywordsButtonsEnabled()
|
|
|
|
|
{
|
|
|
|
|
const bool isSomethingSelected = !m_keywordsList->selectedItems().isEmpty();
|
|
|
|
|
m_removeKeywordButton->setEnabled(isSomethingSelected);
|
|
|
|
|
m_editKeywordButton->setEnabled(isSomethingSelected);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::setSettings(const Settings &settings)
|
|
|
|
|
{
|
|
|
|
|
m_scanInCurrentFileRadioButton->setChecked(settings.scanningScope == ScanningScopeCurrentFile);
|
|
|
|
|
m_scanInProjectRadioButton->setChecked(settings.scanningScope == ScanningScopeProject);
|
|
|
|
|
m_scanInSubprojectRadioButton->setChecked(settings.scanningScope == ScanningScopeSubProject);
|
|
|
|
|
|
|
|
|
|
m_keywordsList->clear();
|
|
|
|
|
for (const Keyword &keyword : std::as_const(settings.keywords))
|
|
|
|
|
addToKeywordsList(keyword);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Settings OptionsDialog::settingsFromUi()
|
|
|
|
|
{
|
|
|
|
|
Settings settings;
|
|
|
|
|
|
|
|
|
|
if (m_scanInCurrentFileRadioButton->isChecked())
|
|
|
|
|
settings.scanningScope = ScanningScopeCurrentFile;
|
|
|
|
|
else if (m_scanInSubprojectRadioButton->isChecked())
|
|
|
|
|
settings.scanningScope = ScanningScopeSubProject;
|
|
|
|
|
else
|
|
|
|
|
settings.scanningScope = ScanningScopeProject;
|
|
|
|
|
|
|
|
|
|
settings.keywords.clear();
|
|
|
|
|
for (int i = 0; i < m_keywordsList->count(); ++i) {
|
|
|
|
|
QListWidgetItem *item = m_keywordsList->item(i);
|
|
|
|
|
|
|
|
|
|
Keyword keyword;
|
|
|
|
|
keyword.name = item->text();
|
|
|
|
|
keyword.iconType = static_cast<IconType>(item->data(Qt::UserRole).toInt());
|
|
|
|
|
keyword.color = item->foreground().color();
|
|
|
|
|
|
|
|
|
|
settings.keywords << keyword;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return settings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::apply()
|
|
|
|
|
{
|
|
|
|
|
Settings newSettings = settingsFromUi();
|
|
|
|
|
|
|
|
|
|
// "apply" itself is interpreted as "use these keywords, also for other themes".
|
|
|
|
|
newSettings.keywordsEdited = true;
|
|
|
|
|
|
2024-01-30 15:37:34 +01:00
|
|
|
if (newSettings == todoSettings())
|
2023-11-21 14:52:14 +01:00
|
|
|
return;
|
|
|
|
|
|
2024-01-30 15:37:34 +01:00
|
|
|
todoSettings() = newSettings;
|
2024-01-30 17:15:10 +01:00
|
|
|
|
|
|
|
|
todoSettings().save();
|
|
|
|
|
|
|
|
|
|
todoItemsProvider().settingsChanged();
|
|
|
|
|
todoOutputPane().setScanningScope(todoSettings().scanningScope);
|
2023-11-21 14:52:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TodoSettingsPage
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
class TodoSettingsPage final : public IOptionsPage
|
2023-11-21 14:52:14 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2024-01-30 17:15:10 +01:00
|
|
|
TodoSettingsPage()
|
2023-11-21 14:52:14 +01:00
|
|
|
{
|
|
|
|
|
setId(Constants::TODO_SETTINGS);
|
|
|
|
|
setDisplayName(Tr::tr("To-Do"));
|
|
|
|
|
setCategory("To-Do");
|
|
|
|
|
setDisplayCategory(Tr::tr("To-Do"));
|
|
|
|
|
setCategoryIconPath(":/todoplugin/images/settingscategory_todo.png");
|
2024-01-30 17:15:10 +01:00
|
|
|
setWidgetCreator([] { return new OptionsDialog; });
|
2023-11-21 14:52:14 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-30 17:15:10 +01:00
|
|
|
void setupTodoSettingsPage()
|
2023-11-21 14:52:14 +01:00
|
|
|
{
|
2024-01-30 17:15:10 +01:00
|
|
|
static TodoSettingsPage theTodoSettingsPage;
|
|
|
|
|
|
|
|
|
|
QObject::connect(ICore::instance(), &Core::ICore::saveSettingsRequested,
|
|
|
|
|
[] { todoSettings().save(); });
|
2023-11-21 14:52:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // Todo::Internal
|
2011-10-25 23:14:27 +03:00
|
|
|
|