summaryrefslogtreecommitdiff
path: root/raveos-calamares-module/desktopselect/DesktopBackend.h
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-calamares-module/desktopselect/DesktopBackend.h')
-rw-r--r--raveos-calamares-module/desktopselect/DesktopBackend.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/raveos-calamares-module/desktopselect/DesktopBackend.h b/raveos-calamares-module/desktopselect/DesktopBackend.h
new file mode 100644
index 0000000..4ceb6cb
--- /dev/null
+++ b/raveos-calamares-module/desktopselect/DesktopBackend.h
@@ -0,0 +1,31 @@
+#pragma once
+#include <QObject>
+#include <QStringList>
+#include <QVariantList>
+
+class DesktopBackend : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QVariantList desktops READ desktops NOTIFY desktopsChanged)
+ Q_PROPERTY(int selectedIndex READ selectedIndex NOTIFY selectedIndexChanged)
+
+public:
+ explicit DesktopBackend(QObject* parent = nullptr);
+
+ QVariantList desktops() const { return m_desktops; }
+ int selectedIndex() const { return m_selectedIndex; }
+
+ void setDesktops(const QVariantList& desktops);
+ QStringList selectedPackages() const;
+
+ Q_INVOKABLE void selectDesktop(int index);
+
+signals:
+ void desktopsChanged();
+ void selectedIndexChanged();
+ void selectionMade();
+
+private:
+ QVariantList m_desktops;
+ int m_selectedIndex = -1;
+};