File indexing completed on 2024-05-12 05:46:31

0001 /************************************************************************
0002  * KDevelop4 Custom Buildsystem Support                                 *
0003  *                                                                      *
0004  * Copyright 2010 Andreas Pakulat <apaku@gmx.de>                        *
0005  *                                                                      *
0006  * This program is free software; you can redistribute it and/or modify *
0007  * it under the terms of the GNU General Public License as published by *
0008  * the Free Software Foundation; either version 2 or version 3 of the License, or    *
0009  * (at your option) any later version.                                  *
0010  *                                                                      *
0011  * This program is distributed in the hope that it will be useful, but  *
0012  * WITHOUT ANY WARRANTY; without even the implied warranty of           *
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     *
0014  * General Public License for more details.                             *
0015  *                                                                      *
0016  * You should have received a copy of the GNU General Public License    *
0017  * along with this program; if not, see <http://www.gnu.org/licenses/>. *
0018  ************************************************************************/
0019 
0020 #ifndef CONFIGWIDGET_H
0021 #define CONFIGWIDGET_H
0022 
0023 #include <QWidget>
0024 
0025 #include "custombuildsystemconfig.h"
0026 
0027 namespace Ui
0028 {
0029 class ConfigWidget;
0030 }
0031 
0032 namespace KDevelop
0033 {
0034     class IProject;
0035 }
0036 
0037 class ConfigWidget : public QWidget
0038 {
0039 Q_OBJECT
0040 public:
0041     explicit ConfigWidget( QWidget* parent = nullptr );
0042     void loadConfig(const CustomBuildSystemConfig& cfg);
0043     CustomBuildSystemConfig config() const;
0044     void clear();
0045 Q_SIGNALS:
0046     void changed();
0047 private Q_SLOTS:
0048     void changeAction( int );
0049     void toggleActionEnablement( bool );
0050     void actionArgumentsEdited( const QString& );
0051     void actionEnvironmentChanged(const QString&);
0052     void actionExecutableChanged( const QUrl& );
0053     void actionExecutableChanged( const QString& );
0054 private:
0055     template<typename F>
0056     void applyChange(F toolChanger);
0057 
0058     Ui::ConfigWidget* ui;
0059     QVector<CustomBuildSystemTool> m_tools;
0060     void setTool( const CustomBuildSystemTool& tool );
0061 };
0062 
0063 #endif