forked from qt-creator/qt-creator
Haskell: Delay settings creation
Change-Id: I45666aa8aab1caa776d2f9f23455dc6a92384018 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include "haskellconstants.h"
|
||||
#include "haskelltr.h"
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
@@ -13,22 +15,15 @@ using namespace Utils;
|
||||
|
||||
namespace Haskell::Internal {
|
||||
|
||||
static HaskellSettings *theSettings;
|
||||
|
||||
HaskellSettings &settings()
|
||||
{
|
||||
return *theSettings;
|
||||
static HaskellSettings theSettings;
|
||||
return theSettings;
|
||||
}
|
||||
|
||||
HaskellSettings::HaskellSettings()
|
||||
{
|
||||
theSettings = this;
|
||||
|
||||
setId(Constants::OPTIONS_GENERAL);
|
||||
setDisplayName(Tr::tr("General"));
|
||||
setCategory("J.Z.Haskell");
|
||||
setDisplayCategory(Tr::tr("Haskell"));
|
||||
setCategoryIconPath(":/haskell/images/settingscategory_haskell.png");
|
||||
setAutoApply(false);
|
||||
|
||||
stackPath.setSettingsKey("Haskell/StackExecutable");
|
||||
stackPath.setExpectedKind(PathChooser::ExistingCommand);
|
||||
@@ -55,4 +50,22 @@ HaskellSettings::HaskellSettings()
|
||||
readSettings();
|
||||
}
|
||||
|
||||
// HaskellSettingsPage
|
||||
|
||||
class HaskellSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
HaskellSettingsPage()
|
||||
{
|
||||
setId(Constants::OPTIONS_GENERAL);
|
||||
setDisplayName(Tr::tr("General"));
|
||||
setCategory("J.Z.Haskell");
|
||||
setDisplayCategory(Tr::tr("Haskell"));
|
||||
setCategoryIconPath(":/haskell/images/settingscategory_haskell.png");
|
||||
setSettingsProvider([] { return &settings(); });
|
||||
}
|
||||
};
|
||||
|
||||
const HaskellSettingsPage settingsPage;
|
||||
|
||||
} // Haskell::Internal
|
||||
|
||||
Reference in New Issue
Block a user