feat: Add settings button to quick refactor dialog

This commit is contained in:
Petr Mironychev
2025-12-01 13:21:50 +01:00
parent 406ba05bfb
commit 75d1551b00
2 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include "settings/ConfigurationManager.hpp" #include "settings/ConfigurationManager.hpp"
#include "settings/GeneralSettings.hpp" #include "settings/GeneralSettings.hpp"
#include "settings/QuickRefactorSettings.hpp" #include "settings/QuickRefactorSettings.hpp"
#include "settings/SettingsConstants.hpp"
#include <QApplication> #include <QApplication>
#include <QComboBox> #include <QComboBox>
@ -162,6 +163,14 @@ void QuickRefactorDialog::setupUi()
Settings::quickRefactorSettings().writeSettings(); Settings::quickRefactorSettings().writeSettings();
}); });
m_settingsButton = new QToolButton(this);
m_settingsButton->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon());
m_settingsButton->setToolTip(Tr::tr("Open Quick Refactor Settings"));
m_settingsButton->setIconSize(QSize(16, 16));
actionsLayout->addWidget(m_settingsButton);
connect(m_settingsButton, &QToolButton::clicked, this, &QuickRefactorDialog::onOpenSettings);
mainLayout->addLayout(actionsLayout); mainLayout->addLayout(actionsLayout);
QHBoxLayout *instructionsLayout = new QHBoxLayout(); QHBoxLayout *instructionsLayout = new QHBoxLayout();
@ -570,6 +579,11 @@ void QuickRefactorDialog::onOpenInstructionsFolder()
QDesktopServices::openUrl(url); QDesktopServices::openUrl(url);
} }
void QuickRefactorDialog::onOpenSettings()
{
Core::ICore::showOptionsDialog(Constants::QODE_ASSIST_QUICK_REFACTOR_SETTINGS_PAGE_ID);
}
QString QuickRefactorDialog::selectedConfiguration() const QString QuickRefactorDialog::selectedConfiguration() const
{ {
return m_selectedConfiguration; return m_selectedConfiguration;

View File

@ -60,6 +60,7 @@ private slots:
void onEditCustomCommand(); void onEditCustomCommand();
void onDeleteCustomCommand(); void onDeleteCustomCommand();
void onOpenInstructionsFolder(); void onOpenInstructionsFolder();
void onOpenSettings();
void loadCustomCommands(); void loadCustomCommands();
void loadAvailableConfigurations(); void loadAvailableConfigurations();
void onConfigurationChanged(int index); void onConfigurationChanged(int index);
@ -77,6 +78,7 @@ private:
QToolButton *m_editCommandButton; QToolButton *m_editCommandButton;
QToolButton *m_deleteCommandButton; QToolButton *m_deleteCommandButton;
QToolButton *m_openFolderButton; QToolButton *m_openFolderButton;
QToolButton *m_settingsButton;
QToolButton *m_toolsButton; QToolButton *m_toolsButton;
QToolButton *m_thinkingButton; QToolButton *m_thinkingButton;
QComboBox *m_commandsComboBox; QComboBox *m_commandsComboBox;