diff options
Diffstat (limited to 'plugins/ConfigurationEditor/configurationeditorplugin.cpp')
-rw-r--r-- | plugins/ConfigurationEditor/configurationeditorplugin.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/plugins/ConfigurationEditor/configurationeditorplugin.cpp b/plugins/ConfigurationEditor/configurationeditorplugin.cpp deleted file mode 100644 index 1f60cc0..0000000 --- a/plugins/ConfigurationEditor/configurationeditorplugin.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote - * - * SPDX-License-Identifier: GPL-3.0 - */ - -#include "configurationeditorplugin.h" -#include "forms/configurationdialog.h" -#include <QDialog> -#include <QHash> - -CommandHash_t ConfigurationEditorPlugin::commands() -{ - QHash<QString, std::function<int()>> hash; - - hash.insert("configure", [this]() -> int { - auto *dlg = createWidget(nullptr); - return dlg->exec(); - }); - - return hash; -} - -QDialog *ConfigurationEditorPlugin::createWidget(QWidget *parent) const -{ - auto *app = browser(); - Q_CHECK_PTR(app); - - auto *dlg = new ConfigurationDialog(parent); - dlg->setAttribute(Qt::WA_DeleteOnClose, true); - - for(const QString &key : app->configurationOptions()) { - dlg->addOption(key, app->configuration(key)); - } - dlg->ui->settings_treeWidget->resizeColumnToContents(0); - dlg->ui->shortcuts_treeWidget->resizeColumnToContents(0); - - connect(dlg, &ConfigurationDialog::configurationChanged, dlg, [app](const QString &key, const QString &value) { - app->setConfiguration(key, value); - }); - - return dlg; -} |