File indexing completed on 2024-04-28 04:38:24

0001 /*
0002     SPDX-FileCopyrightText: 2010 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-or-later
0005 */
0006 
0007 #ifndef CONFIGWIDGET_H
0008 #define CONFIGWIDGET_H
0009 
0010 #include <QWidget>
0011 
0012 #include "custombuildsystemconfig.h"
0013 
0014 namespace Ui
0015 {
0016 class ConfigWidget;
0017 }
0018 
0019 namespace KDevelop
0020 {
0021     class IProject;
0022 }
0023 
0024 class ConfigWidget : public QWidget
0025 {
0026 Q_OBJECT
0027 public:
0028     explicit ConfigWidget( QWidget* parent = nullptr );
0029     void loadConfig(const CustomBuildSystemConfig& cfg);
0030     CustomBuildSystemConfig config() const;
0031     void clear();
0032 Q_SIGNALS:
0033     void changed();
0034 private Q_SLOTS:
0035     void changeAction( int );
0036     void toggleActionEnablement( bool );
0037     void actionArgumentsEdited( const QString& );
0038     void actionEnvironmentChanged(const QString&);
0039     void actionExecutableChanged( const QUrl& );
0040     void actionExecutableChanged( const QString& );
0041 private:
0042     template<typename F>
0043     void applyChange(F toolChanger);
0044 
0045     Ui::ConfigWidget* ui;
0046     QVector<CustomBuildSystemTool> m_tools;
0047     void setTool( const CustomBuildSystemTool& tool );
0048 };
0049 
0050 #endif