diff options
-rw-r--r-- | wayland/democompositor/main.cpp | 3 | ||||
-rw-r--r-- | wayland/democompositor/qml/Screen.qml | 60 |
2 files changed, 24 insertions, 39 deletions
diff --git a/wayland/democompositor/main.cpp b/wayland/democompositor/main.cpp index c10e9c2..ac25eaf 100644 --- a/wayland/democompositor/main.cpp +++ b/wayland/democompositor/main.cpp @@ -55,11 +55,14 @@ #include <QtGui/QFont> #include <QtQml/qqml.h> #include <QtQml/QQmlApplicationEngine> + +#include "apps/applistmodel.h" #include "processlauncher.h" static void registerTypes() { qmlRegisterType<WaylandProcessLauncher>("com.theqtcompany.wlprocesslauncher", 1, 0, "ProcessLauncher"); + qmlRegisterType<AppListModel>("com.theqtcompany.wlapplistmodel", 1, 0, "AppListModel"); } diff --git a/wayland/democompositor/qml/Screen.qml b/wayland/democompositor/qml/Screen.qml index 34fd090..b609ca2 100644 --- a/wayland/democompositor/qml/Screen.qml +++ b/wayland/democompositor/qml/Screen.qml @@ -53,6 +53,7 @@ import QtQuick.Window 2.2 import QtWayland.Compositor 1.0 import com.theqtcompany.wlprocesslauncher 1.0 +import com.theqtcompany.wlapplistmodel 1.0 WaylandOutput { @@ -85,6 +86,13 @@ WaylandOutput { id: launcher } + AppListModel { + id: apps + } + + Component.onCompleted: { + apps.addAndWatchDir("/data/user/democompositor/apps/") + } Rectangle { id: curtain @@ -252,46 +260,20 @@ WaylandOutput { height: 5 width: 1 } - LaunchButton { - height: 60 - width: sidebar.width - 10 - buttonColor: backgroundCol - pressedColor: pressedCol - textColor: textCol - text.text: "Clocks" - executable: "./clocks" - icon.source: "qrc:/images/Icon_Clocks.png" - } - LaunchButton { - height: 60 - width: sidebar.width - 10 - buttonColor: backgroundCol - pressedColor: pressedCol - textColor: textCol - text.text: "RSS News" - executable: "./rssnews" - icon.source: "qrc:/images/Icon_RSS.png" - } - LaunchButton { - height: 60 - width: sidebar.width - 10 - buttonColor: backgroundCol - pressedColor: pressedCol - textColor: textCol - text.text: "StoQt" - executable: "./stocqt" - icon.source: "qrc:/images/Icon_StocQt.png" - } - LaunchButton { - height: 60 - width: sidebar.width - 10 - buttonColor: backgroundCol - pressedColor: pressedCol - textColor: textCol - text.text: "Maps" - executable: "./qml_location_mapviewer" - icon.source: "qrc:/images/Icon_Maps.png" + Repeater { + model: apps + + LaunchButton { + height: 60 + width: sidebar.width - 10 + buttonColor: backgroundCol + pressedColor: pressedCol + textColor: textCol + text.text: model.applicationName + executable: model.executableName + icon.source: model.iconName + } } TimedButton { |