2018-03-10 18:45:06 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2018 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2020-04-17 15:30:05 +02:00
|
|
|
|
2021-03-23 15:58:16 +01:00
|
|
|
#include <coreplugin/dialogs/ioptionspage.h>
|
2020-04-17 15:30:05 +02:00
|
|
|
|
2021-03-23 15:58:16 +01:00
|
|
|
#include <utils/aspects.h>
|
2018-03-10 18:45:06 +01:00
|
|
|
|
|
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
enum AfterAddFileAction : int {
|
|
|
|
|
ASK_USER,
|
|
|
|
|
COPY_FILE_PATH,
|
|
|
|
|
NEVER_COPY_FILE_PATH
|
|
|
|
|
};
|
|
|
|
|
|
2021-03-23 15:58:16 +01:00
|
|
|
class CMakeSpecificSettings : public Utils::AspectContainer
|
2018-03-10 18:45:06 +01:00
|
|
|
{
|
2021-03-23 15:58:16 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeSpecificSettings)
|
|
|
|
|
|
2018-03-10 18:45:06 +01:00
|
|
|
public:
|
2021-03-23 15:58:16 +01:00
|
|
|
CMakeSpecificSettings();
|
|
|
|
|
|
|
|
|
|
void setAfterAddFileSetting(AfterAddFileAction settings) {
|
|
|
|
|
m_afterAddFileToProjectSetting.setValue(settings);
|
|
|
|
|
}
|
|
|
|
|
AfterAddFileAction afterAddFileSetting() const {
|
|
|
|
|
return static_cast<AfterAddFileAction>(m_afterAddFileToProjectSetting.value());
|
|
|
|
|
}
|
2018-03-10 18:45:06 +01:00
|
|
|
|
2021-03-23 15:58:16 +01:00
|
|
|
Utils::FilePath ninjaPath() const { return m_ninjaPath.filePath(); }
|
2019-11-18 15:24:52 +01:00
|
|
|
|
2021-03-23 15:58:16 +01:00
|
|
|
void setPackageManagerAutoSetup(bool checked) { m_packageManagerAutoSetup.setValue(checked); }
|
|
|
|
|
bool packageManagerAutoSetup() const { return m_packageManagerAutoSetup.value(); }
|
2018-03-10 18:45:06 +01:00
|
|
|
|
2021-03-23 15:58:16 +01:00
|
|
|
void setAskBeforeReConfigureInitialParams(bool doAsk) { m_askBeforeReConfigureInitialParams.setValue(doAsk); }
|
|
|
|
|
bool askBeforeReConfigureInitialParams() const { return m_askBeforeReConfigureInitialParams.value(); }
|
2021-02-18 18:50:11 +01:00
|
|
|
|
2018-03-10 18:45:06 +01:00
|
|
|
private:
|
2021-03-23 15:58:16 +01:00
|
|
|
friend class CMakeSpecificSettingWidget;
|
|
|
|
|
|
|
|
|
|
Utils::SelectionAspect m_afterAddFileToProjectSetting;
|
|
|
|
|
Utils::StringAspect m_ninjaPath;
|
|
|
|
|
Utils::BoolAspect m_packageManagerAutoSetup;
|
|
|
|
|
Utils::BoolAspect m_askBeforeReConfigureInitialParams;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CMakeSpecificSettingsPage final : public Core::IOptionsPage
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit CMakeSpecificSettingsPage(CMakeSpecificSettings *settings);
|
2018-03-10 18:45:06 +01:00
|
|
|
};
|
|
|
|
|
|
2021-03-23 15:58:16 +01:00
|
|
|
} // Internal
|
|
|
|
|
} // CMakeProjectManager
|