forked from qt-creator/qt-creator
Nim: Use PagedSettings for Tools settings page
Change-Id: Iee5f4a89380499d781a42c3e0b6bc82b7386c28e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -62,7 +62,6 @@ public:
|
||||
NimCompilerBuildStepFactory buildStepFactory;
|
||||
NimCompilerCleanStepFactory cleanStepFactory;
|
||||
NimCodeStyleSettingsPage codeStyleSettingsPage;
|
||||
NimToolsSettingsPage toolsSettingsPage{&settings};
|
||||
NimCodeStylePreferencesFactory codeStylePreferencesPage;
|
||||
NimToolChainFactory toolChainFactory;
|
||||
|
||||
|
||||
@@ -29,6 +29,24 @@ NimSettings::NimSettings()
|
||||
setAutoApply(false);
|
||||
setSettingsGroups("Nim", "NimSuggest");
|
||||
|
||||
setId(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_ID);
|
||||
setDisplayName(Tr::tr("Tools"));
|
||||
setCategory(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_CATEGORY);
|
||||
setDisplayCategory(Tr::tr("Nim"));
|
||||
setCategoryIconPath(":/nim/images/settingscategory_nim.png");
|
||||
setSettings(this);
|
||||
|
||||
setLayouter([this](QWidget *widget) {
|
||||
using namespace Layouting;
|
||||
Column {
|
||||
Group {
|
||||
title("Nimsuggest"),
|
||||
Column { nimSuggestPath }
|
||||
},
|
||||
st
|
||||
}.attachTo(widget);
|
||||
});
|
||||
|
||||
// code style factory
|
||||
auto factory = new NimCodeStylePreferencesFactory();
|
||||
TextEditorSettings::registerCodeStyleFactory(factory);
|
||||
@@ -95,27 +113,4 @@ SimpleCodeStylePreferences *NimSettings::globalCodeStyle()
|
||||
return m_globalCodeStyle;
|
||||
}
|
||||
|
||||
// NimToolSettingsPage
|
||||
|
||||
NimToolsSettingsPage::NimToolsSettingsPage(NimSettings *settings)
|
||||
{
|
||||
setId(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_ID);
|
||||
setDisplayName(Tr::tr("Tools"));
|
||||
setCategory(Nim::Constants::C_NIMTOOLSSETTINGSPAGE_CATEGORY);
|
||||
setDisplayCategory(Tr::tr("Nim"));
|
||||
setCategoryIconPath(":/nim/images/settingscategory_nim.png");
|
||||
setSettings(settings);
|
||||
|
||||
setLayouter([settings](QWidget *widget) {
|
||||
using namespace Layouting;
|
||||
Column {
|
||||
Group {
|
||||
title("Nimsuggest"),
|
||||
Column { settings->nimSuggestPath }
|
||||
},
|
||||
st
|
||||
}.attachTo(widget);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Nim
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace TextEditor { class SimpleCodeStylePreferences; }
|
||||
|
||||
namespace Nim {
|
||||
|
||||
class NimSettings : public Utils::AspectContainer
|
||||
class NimSettings : public Core::PagedSettings
|
||||
{
|
||||
public:
|
||||
NimSettings();
|
||||
@@ -21,11 +20,5 @@ public:
|
||||
static TextEditor::SimpleCodeStylePreferences *globalCodeStyle();
|
||||
};
|
||||
|
||||
class NimToolsSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
explicit NimToolsSettingsPage(NimSettings *settings);
|
||||
};
|
||||
|
||||
} // Nim
|
||||
|
||||
|
||||
Reference in New Issue
Block a user