From 9686c85a469c193438fb457bb41f4c0eb3e22188 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 4 Mar 2019 17:29:57 +0100 Subject: Qmake: Improve the build dir location warning The infamous "build dir is not at the same level at source dir" warning for qmake projects has gone through a number of iterations in Qt Creator, having been added, removed and re-added, always to the criticism of some users. Our new approach is as follows: - The warning appears at the widgets where the build directory is set, both in the target setup page and the build config widget. - The warning also appears in the issues pane, but only if the build failed. - The user can disable the warning altogether in a newly introduced qmake settings page. - This option is disabled by default on Unix, because to my knowledge all failure reports have been for Windows hosts. This should finally please everybody. Fixes: QTCREATORBUG-16945 Change-Id: I638be1f15e8c260a5d72047d6850a3a0f685cf03 Reviewed-by: Joerg Bornemann --- src/plugins/qmakeprojectmanager/qmakesettings.h | 76 +++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/plugins/qmakeprojectmanager/qmakesettings.h (limited to 'src/plugins/qmakeprojectmanager/qmakesettings.h') diff --git a/src/plugins/qmakeprojectmanager/qmakesettings.h b/src/plugins/qmakeprojectmanager/qmakesettings.h new file mode 100644 index 00000000000..30f9d4a34d8 --- /dev/null +++ b/src/plugins/qmakeprojectmanager/qmakesettings.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2019 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 + +#include + +#include +#include + +namespace QmakeProjectManager { +namespace Internal { + +class QmakeSettingsData { +public: + bool warnAgainstUnalignedBuildDir = false; +}; + +class QmakeSettings : public QObject +{ + Q_OBJECT +public: + static QmakeSettings &instance(); + static bool warnAgainstUnalignedBuildDir(); + static void setSettingsData(const QmakeSettingsData &settings); + +signals: + void settingsChanged(); + +private: + QmakeSettings(); + void loadSettings(); + void storeSettings() const; + + QmakeSettingsData m_settings; +}; + +class QmakeSettingsPage : public Core::IOptionsPage +{ + Q_OBJECT +public: + QmakeSettingsPage(); + +private: + QWidget *widget() override; + void apply() override; + void finish() override; + + class SettingsWidget; + QPointer m_widget; +}; + +} // namespace Internal +} // namespace QmakeProjectManager -- cgit v1.2.3