summaryrefslogtreecommitdiffstats
path: root/src/PortalService.h
diff options
context:
space:
mode:
authorEmanoil Kotsev <deloptes@gmail.com>2024-07-12 18:28:43 +0000
committerEmanoil Kotsev <deloptes@gmail.com>2024-07-12 18:28:43 +0000
commit6e430ca48a0533f445ef60270a2c79d609e8e7be (patch)
tree6d83955a7e20f5bfd0e18bc00f7a8dfb09a90c05 /src/PortalService.h
parent4b20e27f327a0844c5bdc0db31c914e824e6bbfe (diff)
downloadxdg-desktop-portal-tde-feat/improvements.tar.gz
xdg-desktop-portal-tde-feat/improvements.zip
Added the FileChooser functions and deleted the original filesfeat/improvements
Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
Diffstat (limited to 'src/PortalService.h')
-rw-r--r--src/PortalService.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/PortalService.h b/src/PortalService.h
index fb744bb..1c7500e 100644
--- a/src/PortalService.h
+++ b/src/PortalService.h
@@ -27,6 +27,7 @@
#include <tqdbusobject.h>
#include <tqmap.h>
+#include <tqdialog.h>
#include <printInterface.h>
#include <settingsInterface.h>
@@ -47,6 +48,28 @@
#include <dbusbaseNode.h>
#include <sessionNode.h>
+// FileChooser
+#include <tdefile.h>
+struct FileDialogOpts
+{
+ TQString caption;
+ TQString okButtonText;
+ TQString startDir;
+ TQString startName;
+ TQString filters;
+ bool multiple = false;
+ bool directory = false;
+ bool savingMode = false;
+ bool modal = true;
+ WId windowId = 0;
+
+ inline KFile::Mode mode()
+ {
+ if (directory) return KFile::Directory;
+ return multiple ? KFile::Files : KFile::File;
+ }
+};
+
class PropertiesService: public org::freedesktop::DBus::PropertiesInterface
{
public:
@@ -223,6 +246,19 @@ protected:
protected:
// implement sending replies
virtual void handleMethodReply(const TQT_DBusMessage& reply);
+
+private:
+ WId parseWindowId(const TQString data);
+ TQString parseFilter(const TQT_DBusData data);
+ TQString parseFilterList(const TQT_DBusVariant filterData,
+ const TQT_DBusVariant currentFilterData);
+
+ bool execFileDialog(FileDialogOpts options,
+ const TQT_DBusObjectPath& handle,
+ TQ_UINT32& response,
+ TQMap<TQString, TQT_DBusVariant> &results,
+ TQT_DBusError& error);
+
private:
TQT_DBusConnection *m_connection;
};