57 lines
1.3 KiB
C++
Executable File
57 lines
1.3 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Gui Plugin for AppStarter
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*
|
|
* Created by Mike Wille, SLSE, 2016-11-03
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Plugins/AppStarter/app_gui_plugin_interface.h>
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
#include <QProcess>
|
|
|
|
namespace AppStarter
|
|
{
|
|
|
|
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
|
{
|
|
Q_PLUGIN_METADATA(IID "gui:3:app")
|
|
Q_INTERFACES(GuiPluginBase::Plugin)
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit GuiPlugin() = default;
|
|
~GuiPlugin() = default;
|
|
|
|
QString pluginName() override { return ForeignGuiInterface::pluginName(); }
|
|
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
|
bool availableInPartition(IDL::PartitionType) const override
|
|
{
|
|
return true;
|
|
}
|
|
};
|
|
|
|
|
|
class InterfaceImpl final : public QObject, public GuiPluginBase::Interface
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
|
|
|
QVector<LtsWidgets::PluginData> getActions() override;
|
|
QString menuGroup() const override;
|
|
|
|
private:
|
|
void startProcess(const QString &procName, const QStringList &args, const QString &title, const QString &identifier);
|
|
void startApp(LtsAppDescriptor::App appId);
|
|
QMap< QString, QPointer<QProcess> > m_ProcMap;
|
|
};
|
|
|
|
} // namespace AppStarter
|