mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
homescreens/halcyon: Port to new app launch method
This commit is contained in:
parent
7385ca9dca
commit
3e47bbd584
9 changed files with 4 additions and 23 deletions
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
|
|
||||||
#include <KIO/ApplicationLauncherJob>
|
|
||||||
#include <KNotificationJobUiDelegate>
|
#include <KNotificationJobUiDelegate>
|
||||||
#include <KService>
|
#include <KService>
|
||||||
|
|
||||||
|
|
@ -102,19 +101,6 @@ void Application::setWindow(KWayland::Client::PlasmaWindow *window)
|
||||||
Q_EMIT windowChanged();
|
Q_EMIT windowChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::runApplication()
|
|
||||||
{
|
|
||||||
if (m_window) {
|
|
||||||
m_window->requestActivate();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
KService::Ptr service = KService::serviceByStorageId(m_storageId);
|
|
||||||
KIO::ApplicationLauncherJob *job = new KIO::ApplicationLauncherJob(service);
|
|
||||||
job->setUiDelegate(new KNotificationJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled));
|
|
||||||
job->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::setMinimizedDelegate(QQuickItem *delegate)
|
void Application::setMinimizedDelegate(QQuickItem *delegate)
|
||||||
{
|
{
|
||||||
QWindow *delegateWindow = delegate->window();
|
QWindow *delegateWindow = delegate->window();
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#include <KIO/ApplicationLauncherJob>
|
||||||
#include <KService>
|
#include <KService>
|
||||||
|
|
||||||
#include <KWayland/Client/connection_thread.h>
|
#include <KWayland/Client/connection_thread.h>
|
||||||
|
|
@ -43,7 +44,6 @@ public:
|
||||||
void setStorageId(QString &storageId);
|
void setStorageId(QString &storageId);
|
||||||
void setWindow(KWayland::Client::PlasmaWindow *window);
|
void setWindow(KWayland::Client::PlasmaWindow *window);
|
||||||
|
|
||||||
Q_INVOKABLE void runApplication();
|
|
||||||
Q_INVOKABLE void setMinimizedDelegate(QQuickItem *delegate);
|
Q_INVOKABLE void setMinimizedDelegate(QQuickItem *delegate);
|
||||||
Q_INVOKABLE void unsetMinimizedDelegate(QQuickItem *delegate);
|
Q_INVOKABLE void unsetMinimizedDelegate(QQuickItem *delegate);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include "pinnedmodel.h"
|
#include "pinnedmodel.h"
|
||||||
#include "windowlistener.h"
|
#include "windowlistener.h"
|
||||||
|
|
||||||
|
#include <KIO/ApplicationLauncherJob>
|
||||||
#include <KWindowSystem>
|
#include <KWindowSystem>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import QtQuick.Layouts 1.1
|
||||||
import QtQuick.Controls 2.3 as Controls
|
import QtQuick.Controls 2.3 as Controls
|
||||||
import QtGraphicalEffects 1.6
|
import QtGraphicalEffects 1.6
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
import org.kde.kquickcontrolsaddons 2.0
|
import org.kde.kquickcontrolsaddons 2.0
|
||||||
|
|
@ -89,7 +88,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
application.setMinimizedDelegate(delegate);
|
application.setMinimizedDelegate(delegate);
|
||||||
application.runApplication();
|
MobileShell.ShellUtil.launchApp(application.storageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import QtQuick.Controls 2.15 as QQC2
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import QtQml.Models 2.15
|
import QtQml.Models 2.15
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import QtQuick.Controls 2.15 as QQC2
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import QtQml.Models 2.15
|
import QtQml.Models 2.15
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import QtQuick.Layouts 1.1
|
||||||
import QtQml.Models 2.15
|
import QtQml.Models 2.15
|
||||||
import QtGraphicalEffects 1.12
|
import QtGraphicalEffects 1.12
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import QtQuick.Layouts 1.1
|
||||||
import QtQuick.Controls 2.15 as Controls
|
import QtQuick.Controls 2.15 as Controls
|
||||||
import QtGraphicalEffects 1.6
|
import QtGraphicalEffects 1.6
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
import org.kde.kquickcontrolsaddons 2.0
|
import org.kde.kquickcontrolsaddons 2.0
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import QtQuick 2.15
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
import QtQuick.Controls 2.15 as Controls
|
import QtQuick.Controls 2.15 as Controls
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||||
|
|
@ -86,7 +85,7 @@ MobileShell.GridView {
|
||||||
}
|
}
|
||||||
|
|
||||||
application.setMinimizedDelegate(delegate);
|
application.setMinimizedDelegate(delegate);
|
||||||
application.runApplication();
|
MobileShell.ShellUtil.launchApp(application.storageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue