aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmakeprojectmanager/qmakesettings.h
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2019-03-04 17:29:57 +0100
committerChristian Kandeler <[email protected]>2019-03-06 08:34:36 +0000
commit9686c85a469c193438fb457bb41f4c0eb3e22188 (patch)
tree2c3cc0c601fe42475095ca9539409cde505c5a8e /src/plugins/qmakeprojectmanager/qmakesettings.h
parent8a5a4d4dc77ed48e8f83ec75ea2ef45f792a84bd (diff)
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 <[email protected]>
Diffstat (limited to 'src/plugins/qmakeprojectmanager/qmakesettings.h')
-rw-r--r--src/plugins/qmakeprojectmanager/qmakesettings.h76
1 files changed, 76 insertions, 0 deletions
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 <coreplugin/dialogs/ioptionspage.h>
+
+#include <QObject>
+#include <QPointer>
+
+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<SettingsWidget> m_widget;
+};
+
+} // namespace Internal
+} // namespace QmakeProjectManager