2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) Filippo Cucchetto <filippocucchetto@gmail.com>
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2015-08-26 09:37:55 +02:00
|
|
|
|
|
|
|
|
#include "nimsettings.h"
|
|
|
|
|
|
2016-06-14 20:33:55 +03:00
|
|
|
#include "../nimconstants.h"
|
2022-10-10 09:58:54 +02:00
|
|
|
#include "../nimtr.h"
|
2015-08-26 09:37:55 +02:00
|
|
|
|
2023-07-17 12:10:20 +02:00
|
|
|
#include <coreplugin/dialogs/ioptionspage.h>
|
2021-03-25 15:45:58 +01:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
|
|
|
|
|
#include <utils/layoutbuilder.h>
|
2015-08-26 09:37:55 +02:00
|
|
|
|
2021-03-25 15:45:58 +01:00
|
|
|
using namespace Utils;
|
2015-08-26 09:37:55 +02:00
|
|
|
|
|
|
|
|
namespace Nim {
|
|
|
|
|
|
2023-07-17 12:10:20 +02:00
|
|
|
NimSettings &settings()
|
|
|
|
|
{
|
|
|
|
|
static NimSettings theSettings;
|
|
|
|
|
return theSettings;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-25 15:45:58 +01:00
|
|
|
NimSettings::NimSettings()
|
2018-12-23 15:18:06 +01:00
|
|
|
{
|
2021-03-25 15:45:58 +01:00
|
|
|
setSettingsGroups("Nim", "NimSuggest");
|
2023-07-17 12:10:20 +02:00
|
|
|
setAutoApply(false);
|
2023-05-10 14:10:14 +02:00
|
|
|
|
2023-05-30 17:04:14 +02:00
|
|
|
setLayouter([this] {
|
2023-05-10 14:10:14 +02:00
|
|
|
using namespace Layouting;
|
2023-05-30 17:04:14 +02:00
|
|
|
return Column {
|
2023-05-10 14:10:14 +02:00
|
|
|
Group {
|
2024-05-14 10:33:01 +02:00
|
|
|
title(QString("Nimsuggest")),
|
2023-05-10 14:10:14 +02:00
|
|
|
Column { nimSuggestPath }
|
|
|
|
|
},
|
|
|
|
|
st
|
2023-05-30 17:04:14 +02:00
|
|
|
};
|
2023-05-10 14:10:14 +02:00
|
|
|
});
|
|
|
|
|
|
2023-05-03 17:18:49 +02:00
|
|
|
nimSuggestPath.setSettingsKey("Command");
|
|
|
|
|
nimSuggestPath.setExpectedKind(PathChooser::ExistingCommand);
|
|
|
|
|
nimSuggestPath.setLabelText(Tr::tr("Path:"));
|
|
|
|
|
|
2023-05-16 13:06:18 +02:00
|
|
|
readSettings();
|
2015-08-26 09:37:55 +02:00
|
|
|
}
|
|
|
|
|
|
2023-07-17 12:10:20 +02:00
|
|
|
// NimSettingsPage
|
|
|
|
|
|
|
|
|
|
class NimSettingsPage final : public Core::IOptionsPage
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
NimSettingsPage()
|
|
|
|
|
{
|
|
|
|
|
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");
|
|
|
|
|
setSettingsProvider([] { return &settings(); });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const NimSettingsPage settingsPage;
|
|
|
|
|
|
2015-08-26 09:37:55 +02:00
|
|
|
} // namespace Nim
|