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;
|
NimCompilerBuildStepFactory buildStepFactory;
|
||||||
NimCompilerCleanStepFactory cleanStepFactory;
|
NimCompilerCleanStepFactory cleanStepFactory;
|
||||||
NimCodeStyleSettingsPage codeStyleSettingsPage;
|
NimCodeStyleSettingsPage codeStyleSettingsPage;
|
||||||
NimToolsSettingsPage toolsSettingsPage{&settings};
|
|
||||||
NimCodeStylePreferencesFactory codeStylePreferencesPage;
|
NimCodeStylePreferencesFactory codeStylePreferencesPage;
|
||||||
NimToolChainFactory toolChainFactory;
|
NimToolChainFactory toolChainFactory;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,24 @@ NimSettings::NimSettings()
|
|||||||
setAutoApply(false);
|
setAutoApply(false);
|
||||||
setSettingsGroups("Nim", "NimSuggest");
|
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
|
// code style factory
|
||||||
auto factory = new NimCodeStylePreferencesFactory();
|
auto factory = new NimCodeStylePreferencesFactory();
|
||||||
TextEditorSettings::registerCodeStyleFactory(factory);
|
TextEditorSettings::registerCodeStyleFactory(factory);
|
||||||
@@ -95,27 +113,4 @@ SimpleCodeStylePreferences *NimSettings::globalCodeStyle()
|
|||||||
return m_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
|
} // namespace Nim
|
||||||
|
|||||||
@@ -4,13 +4,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
#include <utils/aspects.h>
|
|
||||||
|
|
||||||
namespace TextEditor { class SimpleCodeStylePreferences; }
|
namespace TextEditor { class SimpleCodeStylePreferences; }
|
||||||
|
|
||||||
namespace Nim {
|
namespace Nim {
|
||||||
|
|
||||||
class NimSettings : public Utils::AspectContainer
|
class NimSettings : public Core::PagedSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NimSettings();
|
NimSettings();
|
||||||
@@ -21,11 +20,5 @@ public:
|
|||||||
static TextEditor::SimpleCodeStylePreferences *globalCodeStyle();
|
static TextEditor::SimpleCodeStylePreferences *globalCodeStyle();
|
||||||
};
|
};
|
||||||
|
|
||||||
class NimToolsSettingsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit NimToolsSettingsPage(NimSettings *settings);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Nim
|
} // Nim
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user