[Quanta] 39d3034 ExecuteBrowser plugin that launches a browser. Nee

Niko Sams niko.sams at gmail.com
Sun Jun 13 12:57:04 UTC 2010


	A	 kdevexecutebrowser.desktop	 [License: Trivialfile.]


	A	 iexecutebrowserplugin.h	 [License: GPL(v2)]


	A	 executebrowserplugin.h	 [License: LGPL(v2)]


	A	 executebrowserplugin.cpp	 [License: LGPL(v2)]


	A	 executebrowser.kdev4	 [License: Trivialfile.]


	A	 browserappjob.h	 [License: UNKNOWN]


	A	 browserappjob.cpp	 [License: UNKNOWN]


	A	 browserappconfig.ui	 [License: Trivialfile.]


	A	 browserappconfig.h	 [License: UNKNOWN]


	A	 browserappconfig.cpp	 [License: UNKNOWN]


	A	 Messages.sh	 [License: Trivialfile.]


	A	 CMakeLists.txt	 [License: Trivialfile.]

commit 39d303494a0e842aebd5bf831c8bbb5bea14d5a1
Author: Niko Sams <niko.sams at gmail.com>
Date:   Fri Oct 16 14:59:15 2009 +0000

    ExecuteBrowser plugin that launches a browser. Needed for web debuggers.
    Please review.
    CCMAIL: kdevelop-devel at kdevelop.org

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..3a1b914
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,39 @@
+find_package(KDE4 REQUIRED)
+find_package(KDevPlatform REQUIRED)
+
+add_definitions( -DKDE_DEFAULT_DEBUG_AREA=9515 )
+
+include_directories(
+    ${KDEVPLATFORM_INCLUDE_DIR}
+    ${KDE4_INCLUDES}
+    ${CMAKE_CURRENT_BINARY_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+########### next target ###############
+
+set(kdevexecutebrowser_PART_UIS
+    browserappconfig.ui
+)
+
+set(kdevexecutebrowser_PART_SRCS
+    executebrowserplugin.cpp
+    browserappconfig.cpp
+    browserappjob.cpp
+)
+
+kde4_add_ui_files( kdevexecutebrowser_PART_SRCS ${kdevexecutebrowser_PART_UIS} )
+kde4_add_plugin(kdevexecutebrowser ${kdevexecutebrowser_PART_SRCS}  )
+target_link_libraries(kdevexecutebrowser 
+    ${KDE4_KDEUI_LIBS} 
+    kdevplatforminterfaces 
+    kdevplatformutil 
+    kdevplatformproject 
+    kdevplatformoutputview)
+
+install(TARGETS kdevexecutebrowser DESTINATION ${PLUGIN_INSTALL_DIR})
+
+
+########### install files ###############
+install(FILES iexecutebrowserplugin.h DESTINATION ${INCLUDE_INSTALL_DIR}/kdevexecutebrowser COMPONENT Devel)
+install(FILES kdevexecutebrowser.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/Messages.sh b/Messages.sh
new file mode 100644
index 0000000..f7a6996
--- /dev/null
+++ b/Messages.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+files=`find . -name \*.rc -o -name \*.ui`
+if [ "x$files" != "x" ]; then
+	$EXTRACTRC $files >> rc.cpp
+fi
+$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/kdevexecutebrowser.pot
+rm -f rc.cpp
diff --git a/browserappconfig.cpp b/browserappconfig.cpp
new file mode 100644
index 0000000..623aaa2
--- /dev/null
+++ b/browserappconfig.cpp
@@ -0,0 +1,170 @@
+/*  This file is part of KDevelop
+    Copyright 2009 Andreas Pakulat <apaku at gmx.de>
+    Copyright 2009 Niko Sams <niko.sams at gmail.com>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+#include "browserappconfig.h"
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kicon.h>
+
+#include <interfaces/icore.h>
+#include <interfaces/iprojectcontroller.h>
+#include <interfaces/ilaunchconfiguration.h>
+
+#include <project/projectmodel.h>
+
+#include "browserappjob.h"
+#include <interfaces/iproject.h>
+#include <project/interfaces/ibuildsystemmanager.h>
+#include <project/interfaces/iprojectbuilder.h>
+#include <project/builderjob.h>
+#include <kmessagebox.h>
+#include <interfaces/iuicontroller.h>
+#include <util/executecompositejob.h>
+#include <kparts/mainwindow.h>
+#include <interfaces/iplugincontroller.h>
+
+#include "executebrowserplugin.h"
+#include <util/kdevstringhandler.h>
+#include <util/environmentgrouplist.h>
+#include <util/projectitemlineedit.h>
+
+KIcon BrowserAppConfigPage::icon() const
+{
+    return KIcon("system-run");
+}
+
+void BrowserAppConfigPage::loadFromConfiguration(const KConfigGroup& cfg, KDevelop::IProject* project )
+{
+    Q_UNUSED(project);
+
+    bool b = blockSignals( true );
+    server->setText( cfg.readEntry( ExecuteBrowserPlugin::serverEntry, "" ) );
+    path->setText( cfg.readEntry( ExecuteBrowserPlugin::pathEntry, "" ) );
+    arguments->setText( cfg.readEntry( ExecuteBrowserPlugin::argumentsEntry, "" ) );
+    blockSignals( b );
+}
+
+BrowserAppConfigPage::BrowserAppConfigPage( QWidget* parent )
+    : LaunchConfigurationPage( parent )
+{
+    setupUi(this);    
+
+    //connect signals to changed signal
+    connect( server, SIGNAL(textEdited(const QString&)), SIGNAL(changed()) );
+    connect( path, SIGNAL(textEdited(const QString&)), SIGNAL(changed()) );
+    connect( arguments, SIGNAL(textEdited(const QString&)), SIGNAL(changed()) );
+}
+
+void BrowserAppConfigPage::saveToConfiguration( KConfigGroup cfg, KDevelop::IProject* project ) const
+{
+    Q_UNUSED( project );
+    cfg.writeEntry( ExecuteBrowserPlugin::serverEntry, server->text() );
+    cfg.writeEntry( ExecuteBrowserPlugin::pathEntry, path->text() );
+    cfg.writeEntry( ExecuteBrowserPlugin::argumentsEntry, arguments->text() );
+}
+
+QString BrowserAppConfigPage::title() const
+{
+    return i18n("Configure Browser Application");
+}
+
+QList< KDevelop::LaunchConfigurationPageFactory* > BrowserAppLauncher::configPages() const
+{
+    return QList<KDevelop::LaunchConfigurationPageFactory*>();
+}
+
+QString BrowserAppLauncher::description() const
+{
+    return "Executes Browser Applications";
+}
+
+QString BrowserAppLauncher::id()
+{
+    return "browserAppLauncher";
+}
+
+QString BrowserAppLauncher::name() const
+{
+    return i18n("Browser Application");
+}
+
+BrowserAppLauncher::BrowserAppLauncher()
+{
+}
+
+KJob* BrowserAppLauncher::start(const QString& launchMode, KDevelop::ILaunchConfiguration* cfg)
+{
+    Q_ASSERT(cfg);
+    if( !cfg )
+    {
+        return 0;
+    }
+    if( launchMode == "execute" )
+    {
+        return new BrowserAppJob( KDevelop::ICore::self()->runController(), cfg );
+        
+    }
+    kWarning() << "Unknown launch mode " << launchMode << "for config:" << cfg->name();
+    return 0;
+}
+
+QStringList BrowserAppLauncher::supportedModes() const
+{
+    return QStringList() << "execute";
+}
+
+KDevelop::LaunchConfigurationPage* BrowserAppPageFactory::createWidget(QWidget* parent)
+{
+    return new BrowserAppConfigPage( parent );
+}
+
+BrowserAppPageFactory::BrowserAppPageFactory()
+{
+}
+
+BrowserAppConfigType::BrowserAppConfigType()
+{
+    factoryList.append( new BrowserAppPageFactory() );
+}
+
+QString BrowserAppConfigType::name() const
+{
+    return i18n("Browser Application");
+}
+
+
+QList<KDevelop::LaunchConfigurationPageFactory*> BrowserAppConfigType::configPages() const
+{
+    return factoryList;
+}
+
+QString BrowserAppConfigType::id() const
+{
+    return ExecuteBrowserPlugin::_browserAppConfigTypeId;
+}
+
+KIcon BrowserAppConfigType::icon() const
+{
+    return KIcon("system-run");
+}
+
+
+
+#include "browserappconfig.moc"
diff --git a/browserappconfig.h b/browserappconfig.h
new file mode 100644
index 0000000..d35927b
--- /dev/null
+++ b/browserappconfig.h
@@ -0,0 +1,79 @@
+/*  This file is part of KDevelop
+    Copyright 2009 Andreas Pakulat <apaku at gmx.de>
+    Copyright 2009 Niko Sams <niko.sams at gmail.com>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef BROWSERAPPCONFIGTYPE_H
+#define BROWSERAPPCONFIGTYPE_H
+
+#include <interfaces/launchconfigurationtype.h>
+#include <interfaces/launchconfigurationpage.h>
+#include <interfaces/ilauncher.h>
+#include <interfaces/ilaunchmode.h>
+
+#include "ui_browserappconfig.h"
+
+class BrowserAppConfigPage : public KDevelop::LaunchConfigurationPage, Ui::BrowserAppPage
+{
+Q_OBJECT
+public:
+    BrowserAppConfigPage( QWidget* parent );
+    void loadFromConfiguration( const KConfigGroup& cfg, KDevelop::IProject* project = 0 );
+    void saveToConfiguration( KConfigGroup cfg, KDevelop::IProject* project = 0 ) const;
+    QString title() const;
+    KIcon icon() const;
+};
+
+class BrowserAppLauncher : public KDevelop::ILauncher
+{
+public:
+    BrowserAppLauncher();
+    virtual QList< KDevelop::LaunchConfigurationPageFactory* > configPages() const;
+    virtual QString description() const;
+    virtual QString id();
+    virtual QString name() const;
+    virtual KJob* start(const QString& launchMode, KDevelop::ILaunchConfiguration* cfg);
+    virtual QStringList supportedModes() const;
+};
+
+class BrowserAppPageFactory : public KDevelop::LaunchConfigurationPageFactory
+{
+public:
+    BrowserAppPageFactory();
+    virtual KDevelop::LaunchConfigurationPage* createWidget(QWidget* parent);
+};
+
+/**
+ * A specific configuration to start a launchable, this could be a native
+ * compiled application, or some script file or byte-compiled file or something else
+ * Provides access to the various configured informations, as well as its type and a name
+ */
+class BrowserAppConfigType : public KDevelop::LaunchConfigurationType
+{
+public:
+    BrowserAppConfigType();
+
+    QString id() const;
+    QString name() const;
+    QList<KDevelop::LaunchConfigurationPageFactory*> configPages() const;  
+    KIcon icon() const;
+private:
+    QList<KDevelop::LaunchConfigurationPageFactory*> factoryList;
+};
+#endif
+
diff --git a/browserappconfig.ui b/browserappconfig.ui
new file mode 100644
index 0000000..5faf321
--- /dev/null
+++ b/browserappconfig.ui
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BrowserAppPage</class>
+ <widget class="QWidget" name="BrowserAppPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>512</width>
+    <height>136</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Url</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_7">
+        <property name="text">
+         <string>Server:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="2">
+       <widget class="KLineEdit" name="arguments">
+        <property name="toolTip">
+         <string>Enter arguments to give to the executable</string>
+        </property>
+        <property name="clickMessage">
+         <string>Enter arguments to give to the url</string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>Arguments:</string>
+        </property>
+        <property name="buddy">
+         <cstring>arguments</cstring>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <widget class="KLineEdit" name="server">
+        <property name="clickMessage">
+         <string>localhost</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="2">
+       <widget class="KLineEdit" name="path">
+        <property name="clickMessage">
+         <string>Enter the path</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_2">
+        <property name="text">
+         <string>Path:</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KLineEdit</class>
+   <extends>QLineEdit</extends>
+   <header>klineedit.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/browserappjob.cpp b/browserappjob.cpp
new file mode 100644
index 0000000..1ee116f
--- /dev/null
+++ b/browserappjob.cpp
@@ -0,0 +1,79 @@
+/*  This file is part of KDevelop
+    Copyright 2009 Andreas Pakulat <apaku at gmx.de>
+    Copyright 2009 Niko Sams <niko.sams at gmail.com>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "browserappjob.h"
+
+#include <QDesktopServices>
+
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kconfiggroup.h>
+#include <kdebug.h>
+
+#include <interfaces/ilaunchconfiguration.h>
+#include <outputview/outputmodel.h>
+#include <util/processlinemaker.h>
+#include <util/environmentgrouplist.h>
+
+#include <kshell.h>
+#include <interfaces/icore.h>
+#include <interfaces/iuicontroller.h>
+#include <interfaces/iplugincontroller.h>
+#include <project/projectmodel.h>
+
+#include "iexecutebrowserplugin.h"
+
+BrowserAppJob::BrowserAppJob(QObject* parent, KDevelop::ILaunchConfiguration* cfg)
+    : KDevelop::OutputJob( parent )
+{
+    kDebug() << "creating browser app job";
+    setCapabilities(NoCapabilities);
+    
+    IExecuteBrowserPlugin* iface = KDevelop::ICore::self()->pluginController()->pluginForExtension("org.kdevelop.IExecuteBrowserPlugin")->extension<IExecuteBrowserPlugin>();
+    Q_ASSERT(iface);
+
+    QString err;
+    m_url = iface->url(cfg, err);
+    if (!err.isEmpty()) {
+        m_url.clear();
+        setError( -1 );
+        setErrorText( err );
+        return;
+    }
+
+    setTitle(cfg->name());
+}
+
+
+void BrowserAppJob::start()
+{
+    kDebug() << "launching?" << m_url;
+    if (!QDesktopServices::openUrl(m_url)) {
+        kWarning() << "openUrl failed, something went wrong when creating the job";
+        emitResult();
+    } else {
+//         startOutput();
+//         model()->appendLine( i18n("Starting: %1", proc->program().join(" ") ) );
+//         proc->start();
+    }
+}
+
+
+#include "browserappjob.moc"
diff --git a/browserappjob.h b/browserappjob.h
new file mode 100644
index 0000000..fb1cd20
--- /dev/null
+++ b/browserappjob.h
@@ -0,0 +1,46 @@
+/*  This file is part of KDevelop
+    Copyright 2009 Andreas Pakulat <apaku at gmx.de>
+    Copyright 2009 Niko Sams <niko.sams at gmail.com>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library 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
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef BROWSERAPPJOB_H
+#define BROWSERAPPJOB_H
+
+#include <QtCore/QProcess>
+#include <KUrl>
+#include <outputview/outputjob.h>
+
+namespace KDevelop
+{
+class ILaunchConfiguration;
+class ProcessLineMaker;
+class OutputModel;
+}
+
+class BrowserAppJob : public KDevelop::OutputJob
+{
+Q_OBJECT
+public:
+    BrowserAppJob( QObject* parent, KDevelop::ILaunchConfiguration* cfg );
+    virtual void start();
+
+private:
+    KUrl m_url;
+};
+
+#endif
diff --git a/executebrowser.kdev4 b/executebrowser.kdev4
new file mode 100644
index 0000000..08a21ef
--- /dev/null
+++ b/executebrowser.kdev4
@@ -0,0 +1,3 @@
+[Project]
+Manager=KDevCMakeManager
+Name=ExecuteBrowser
diff --git a/executebrowserplugin.cpp b/executebrowserplugin.cpp
new file mode 100644
index 0000000..48c9e5a
--- /dev/null
+++ b/executebrowserplugin.cpp
@@ -0,0 +1,108 @@
+/*
+  * This file is part of KDevelop
+ *
+ * Copyright 2007 Hamish Rodda <rodda at kde.org>
+ * Copyright 2009 Niko Sams <niko.sams at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 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, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "executebrowserplugin.h"
+
+#include <QApplication>
+
+#include <klocale.h>
+#include <kpluginfactory.h>
+#include <kpluginloader.h>
+#include <kdebug.h>
+#include <kjob.h>
+#include <kparts/mainwindow.h>
+#include <kmessagebox.h>
+#include <kaboutdata.h>
+
+#include <interfaces/icore.h>
+#include <interfaces/iruncontroller.h>
+#include <interfaces/ilaunchconfiguration.h>
+#include <interfaces/iprojectcontroller.h>
+#include <interfaces/iuicontroller.h>
+#include <util/environmentgrouplist.h>
+
+#include "browserappconfig.h"
+#include <project/projectmodel.h>
+#include <project/builderjob.h>
+#include <kshell.h>
+#include <util/kdevstringhandler.h>
+
+QString ExecuteBrowserPlugin::_browserAppConfigTypeId = "Browser Application";
+QString ExecuteBrowserPlugin::serverEntry = "Server";
+QString ExecuteBrowserPlugin::pathEntry = "Path";
+QString ExecuteBrowserPlugin::argumentsEntry = "Arguments";
+
+using namespace KDevelop;
+
+K_PLUGIN_FACTORY(KDevExecuteFactory, registerPlugin<ExecuteBrowserPlugin>(); )
+K_EXPORT_PLUGIN(KDevExecuteFactory(KAboutData("kdevexecutebrowser", "kdevexecutebrowser", ki18n("Execute browser support"), "0.1", ki18n("Allows running of browsers"), KAboutData::License_GPL)))
+
+ExecuteBrowserPlugin::ExecuteBrowserPlugin(QObject *parent, const QVariantList&)
+    : KDevelop::IPlugin(KDevExecuteFactory::componentData(), parent)
+{
+    KDEV_USE_EXTENSION_INTERFACE( IExecuteBrowserPlugin )
+    BrowserAppConfigType* t = new BrowserAppConfigType();
+    t->addLauncher( new BrowserAppLauncher() );
+    kDebug() << "adding script launch config";
+    core()->runController()->addConfigurationType( t );
+}
+
+ExecuteBrowserPlugin::~ExecuteBrowserPlugin()
+{
+}
+
+
+void ExecuteBrowserPlugin::unload()
+{
+}
+
+KUrl ExecuteBrowserPlugin::url( KDevelop::ILaunchConfiguration* cfg, QString& err_ ) const
+{
+    KUrl url;
+
+    if( !cfg )
+    {
+        return url;
+    }
+    KConfigGroup grp = cfg->config();
+
+    QString host = grp.readEntry( ExecuteBrowserPlugin::serverEntry, "" );
+    if( host.isEmpty() )
+    {
+        err_ = i18n("No valid server specified");
+        kWarning() << "Launch Configuration:" << cfg->name() << "no valid script set";
+        return url;
+    }
+    url.setScheme("http");
+    url.setHost(host);
+    url.setPath(grp.readEntry( ExecuteBrowserPlugin::pathEntry, "" ));
+    url.setQuery(grp.readEntry( ExecuteBrowserPlugin::argumentsEntry, "" ));
+    return url;
+}
+
+QString ExecuteBrowserPlugin::browserAppConfigTypeId() const
+{
+    return _browserAppConfigTypeId;
+}
+
+
+#include "executebrowserplugin.moc"
diff --git a/executebrowserplugin.h b/executebrowserplugin.h
new file mode 100644
index 0000000..0ff846b
--- /dev/null
+++ b/executebrowserplugin.h
@@ -0,0 +1,56 @@
+/*
+ * This file is part of KDevelop
+ *
+ * Copyright 2007 Hamish Rodda <rodda at kde.org>
+ * Copyright 2009 Niko Sams <niko.sams at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 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, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EXECUTEBROWSERPLUGIN_H
+#define EXECUTEBROWSERPLUGIN_H
+
+#include <interfaces/iplugin.h>
+#include <QtCore/QVariant>
+#include <QtCore/QProcess>
+#include "iexecutebrowserplugin.h"
+
+class KUrl;
+class KJob;
+
+class ExecuteBrowserPlugin : public KDevelop::IPlugin, public IExecuteBrowserPlugin
+{
+    Q_OBJECT
+    Q_INTERFACES( IExecuteBrowserPlugin )
+
+  public:
+    ExecuteBrowserPlugin(QObject *parent, const QVariantList & = QVariantList() );
+    virtual ~ExecuteBrowserPlugin();
+
+    static QString _browserAppConfigTypeId;
+    static QString serverEntry;
+    static QString pathEntry;
+    static QString argumentsEntry;
+    
+    virtual void unload();
+    
+    KUrl url( KDevelop::ILaunchConfiguration*, QString& err ) const;
+    QString browserAppConfigTypeId() const;
+};
+
+#endif // EXECUTEBROWSERPLUGIN_H
+
+// kate: space-indent on; indent-width 2; tab-width 4; replace-tabs on; auto-insert-doxygen on
diff --git a/iexecutebrowserplugin.h b/iexecutebrowserplugin.h
new file mode 100644
index 0000000..efdce68
--- /dev/null
+++ b/iexecutebrowserplugin.h
@@ -0,0 +1,55 @@
+/* KDevelop
+ *
+ * Copyright 2009 Andreas Pakulat <apaku at gmx.de>
+ * Copyright 2009 Niko Sams <niko.sams at gmail.com>
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef IEXECUTESCRIPTPLUGIN_H
+#define IEXECUTESCRIPTPLUGIN_H
+
+#include <interfaces/iextension.h>
+#include <QtCore/QString>
+
+namespace KDevelop
+{
+class ILaunchConfiguration;
+}
+
+class KJob;
+class KUrl;
+class QStringList;
+
+/**
+ at author Andreas Pakulat
+ at author Niko Sams
+*/
+
+class IExecuteBrowserPlugin
+{
+public:
+    virtual ~IExecuteBrowserPlugin() {}
+
+    virtual KUrl url( KDevelop::ILaunchConfiguration*, QString& ) const = 0;
+    virtual QString browserAppConfigTypeId() const = 0;
+};
+
+KDEV_DECLARE_EXTENSION_INTERFACE( IExecuteBrowserPlugin, "org.kdevelop.IExecuteBrowserPlugin" )
+Q_DECLARE_INTERFACE( IExecuteBrowserPlugin, "org.kdevelop.IExecuteBrowserPlugin" )
+
+#endif
+
diff --git a/kdevexecutebrowser.desktop b/kdevexecutebrowser.desktop
new file mode 100644
index 0000000..b437664
--- /dev/null
+++ b/kdevexecutebrowser.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=This plugin allows running browser.
+Name=Execute Browser
+GenericName=Browser Execution Support
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=kdevexecutebrowser
+X-KDevelop-Version=7
+X-KDevelop-Category=Global
+X-KDE-PluginInfo-Name=kdevexecutebrowser
+X-KDE-PluginInfo-Author=Niko Sams
+X-KDE-PluginInfo-License=GPL
+X-KDevelop-Interfaces=org.kdevelop.IExecuteBrowserPlugin
+X-KDevelop-Mode=NoGUI




More information about the KDevelop-devel mailing list