Commit de9934fb authored by Andreas Pakulat's avatar Andreas Pakulat

Add a KCM to configure the buildsystem.

Just a skeleton + ui for now, but already contains all GUI options I
want to expose.
parent 229a151f
......@@ -9,12 +9,24 @@ include_directories( ${KDE4_INCLUDES} ${KDEVPLATFORM_INCLUDE_DIR})
add_definitions( ${QT_DEFINITIONS} ${KDE4_DEFINITIONS} )
## KDevelop Plugin
set( custom_SRCS custombuildsystemplugin.cpp )
kde4_add_plugin( kdevcustombuildsystem ${custom_SRCS} )
target_link_libraries( kdevcustombuildsystem ${KDEVPLATFORM_PROJECT_LIBRARIES} ${KDEVPLATFORM_INTERFACES_LIBRARIES} ${KDEVPLATFORM_UTIL_LIBRARIES} )
install( TARGETS kdevcustombuildsystem DESTINATION ${PLUGIN_INSTALL_DIR} )
install( FILES kdevcustombuildsystem.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
## KCM for the Plugin
set( custom_kcm_SRCS configwidget.cpp custombuildsystemconfig.cpp kcm_custombuildsystem.cpp )
kde4_add_ui_files( custom_kcm_SRCS configwidget.ui custombuildsystemconfig.ui )
kde4_add_kcfg_files( custom_kcm_SRCS kcfg_custombuildsystemconfig.kcfgc )
kde4_add_plugin( kcm_kdevcustombuildsystem ${custom_kcm_SRCS} )
target_link_libraries( kcm_kdevcustombuildsystem ${KDE4_KIO_LIBS} ${KDEVPLATFORM_PROJECT_LIBRARIES} ${KDEVPLATFORM_UTIL_LIBRARIES} )
## Installation
install( TARGETS kcm_kdevcustombuildsystem
kdevcustombuildsystem
DESTINATION ${PLUGIN_INSTALL_DIR} )
install( FILES kdevcustombuildsystem.desktop
kcm_kdevcustombuildsystem.desktop
DESTINATION ${SERVICES_INSTALL_DIR} )
/************************************************************************
* KDevelop4 Custom Buildsystem Support *
* *
* Copyright 2010 Andreas Pakulat <apaku@gmx.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "configwidget.h"
#include "ui_configwidget.h"
ConfigWidget::ConfigWidget( QWidget* parent )
: QWidget ( parent ), ui( new Ui::ConfigWidget )
{
ui->setupUi( this );
}
#include "configwidget.moc"
/************************************************************************
* KDevelop4 Custom Buildsystem Support *
* *
* Copyright 2010 Andreas Pakulat <apaku@gmx.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#ifndef CONFIGWIDGET_H
#define CONFIGWIDGET_H
#include <QWidget>
namespace Ui
{
class ConfigWidget;
}
class ConfigWidget : public QWidget
{
Q_OBJECT
public:
ConfigWidget( QWidget* parent = 0 );
private:
Ui::ConfigWidget* ui;
};
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConfigWidget</class>
<widget class="QWidget" name="ConfigWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>649</width>
<height>529</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Build Directory:</string>
</property>
</widget>
</item>
<item>
<widget class="KUrlRequester" name="buildDir"/>
</item>
</layout>
</item>
<item>
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>3</number>
</property>
<widget class="QWidget" name="page">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>381</height>
</rect>
</property>
<attribute name="label">
<string>Tools</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Action:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="buildAction"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="enableAction">
<property name="title">
<string>Enable Support</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Executable:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="actionExecutable"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Arguments:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="actionArguments"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Environment:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="actionEnvironment"/>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>221</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>381</height>
</rect>
</property>
<attribute name="label">
<string>Include/Import Paths</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Project Path:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="includeProjectPath">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Include/Import
Paths:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QListView" name="includePaths"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>381</height>
</rect>
</property>
<attribute name="label">
<string>Defines</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Project Path:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="definesProjectPath">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Defines:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QTableWidget" name="defines">
<column>
<property name="text">
<string>Define</string>
</property>
</column>
<column>
<property name="text">
<string>Value</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_4">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>381</height>
</rect>
</property>
<attribute name="label">
<string>Environment Variables</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTableWidget" name="environments">
<column>
<property name="text">
<string>Path</string>
</property>
</column>
<column>
<property name="text">
<string>Environment</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
<header>kurlrequester.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
/************************************************************************
* KDevelop4 Custom Buildsystem Support *
* *
* Copyright 2010 Andreas Pakulat <apaku@gmx.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "custombuildsystemconfig.h"
#include "ui_custombuildsystemconfig.h"
CustomBuildSystemConfig::CustomBuildSystemConfig( QWidget* parent )
: QWidget( parent ), ui( new Ui::CustomBuildSystemConfig )
{
ui->setupUi( this );
}
#include "custombuildsystemconfig.moc"
/************************************************************************
* KDevelop4 Custom Buildsystem Support *
* *
* Copyright 2010 Andreas Pakulat <apaku@gmx.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#ifndef CUSTOMBUILDSYSTEMCONFIG_H
#define CUSTOMBUILDSYSTEMCONFIG_H
#include <QWidget>
namespace Ui
{
class CustomBuildSystemConfig;
}
class CustomBuildSystemConfig : public QWidget
{
Q_OBJECT
public:
CustomBuildSystemConfig( QWidget* parent = 0 );
private:
Ui::CustomBuildSystemConfig* ui;
};
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CustomBuildSystemConfig</class>
<widget class="QWidget" name="CustomBuildSystemConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>648</width>
<height>508</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Build Configuration:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="currentConfig">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="ConfigWidget" name="configWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ConfigWidget</class>
<extends>QWidget</extends>
<header>configwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile arg="true"/>
<group name="CustomBuildSystem">
<entry name="currentConfiguration" key="Current Build Config" type="String" />
</group>
</kcfg>
File=kcfg_custombuildsystemconfig.kcfg
ClassName=CustomBuildSystemSettings
Singleton=true
Inherits=KDevelop::ProjectConfigSkeleton
IncludeFiles=project/projectconfigskeleton.h
/************************************************************************
* KDevelop4 Custom Buildsystem Support *
* *
* Copyright 2010 Andreas Pakulat <apaku@gmx.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#include "kcm_custombuildsystem.h"
#include <KPluginFactory>
#include <QVBoxLayout>
#include "custombuildsystemconfig.h"
#include "kcfg_custombuildsystemconfig.h"
K_PLUGIN_FACTORY(CustomBuildSystemKCModuleFactory, registerPlugin<CustomBuildSystemKCModule>(); )
K_EXPORT_PLUGIN(CustomBuildSystemKCModuleFactory("kcm_kdevcustombuildsystem"))
CustomBuildSystemKCModule::CustomBuildSystemKCModule( QWidget* parent, const QVariantList& args )
: ProjectKCModule<CustomBuildSystemSettings>( CustomBuildSystemKCModuleFactory::componentData(), parent, args )
{
QVBoxLayout* layout = new QVBoxLayout( this );
CustomBuildSystemConfig* w = new CustomBuildSystemConfig;
layout->addWidget( w );
addConfig( CustomBuildSystemSettings::self(), w );
load();
}
CustomBuildSystemKCModule::~CustomBuildSystemKCModule()
{
}
void CustomBuildSystemKCModule::load()
{
KCModule::load();
}
void CustomBuildSystemKCModule::save()
{
KCModule::save();
}
void CustomBuildSystemKCModule::defaults()
{
KCModule::defaults();
}
#include "kcm_custombuildsystem.moc"
/************************************************************************
* KDevelop4 Custom Buildsystem Support *
* *
* Copyright 2010 Andreas Pakulat <apaku@gmx.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#ifndef KCM_CUSTOMBUILDSYSTEM_H
#define KCM_CUSTOMBUILDSYSTEM_H
#include <project/projectkcmodule.h>
#include "custombuildsystemplugin.h"
class CustomBuildSystemSettings;
namespace Ui
{
class CustomBuildSystemConfig;
}
class CustomBuildSystemKCModule : public ProjectKCModule<CustomBuildSystemSettings>
{
Q_OBJECT
public:
CustomBuildSystemKCModule( QWidget* parent, const QVariantList& args = QVariantList() );
virtual ~CustomBuildSystemKCModule();
virtual void defaults();
virtual void load();
virtual void save();
private:
};
#endif
[Desktop Entry]
Icon=kdevelop
Type=Service
ServiceTypes=KCModule
X-KDE-ModuleType=Library
X-KDE-Library=kcm_kdevcustombuildsystem
X-KDE-ParentApp=kdevplatformproject
X-KDE-ParentComponents=KDevCustomBuildSystem
X-KDE-CfgDlgHierarchy=BUILDTOOL
Name=Custom BuildSystem
Comment=Configure Custom BuildSystem settings
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment