aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2019-12-12 01:21:49 +0000
committerxiphon <xiphon@protonmail.com>2019-12-12 01:28:49 +0000
commit088d32e712a2c6e51a04f919c0ade96b643a49e3 (patch)
tree1a28761513ed460daeb77240f3d4391c8c0cfbf2 /src/qt
parentba24fd79bb50ff82f0fd94a5c0bd06f2130f3bd7 (diff)
downloadmonzero-gui-088d32e712a2c6e51a04f919c0ade96b643a49e3.tar.gz
monzero-gui-088d32e712a2c6e51a04f919c0ade96b643a49e3.tar.xz
monzero-gui-088d32e712a2c6e51a04f919c0ade96b643a49e3.zip
OSHelper: file preselection support (Windows and Mac)
Co-authored-by: selsta <selsta@sent.at>
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/macoshelper.h1
-rw-r--r--src/qt/macoshelper.mm8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/qt/macoshelper.h b/src/qt/macoshelper.h
index bddf70c6..a6caa79b 100644
--- a/src/qt/macoshelper.h
+++ b/src/qt/macoshelper.h
@@ -35,6 +35,7 @@ class MacOSHelper
public:
static bool isCapsLock();
+ static bool openFolderAndSelectItem(const QUrl &path);
};
#endif //MACOSHELPER_H
diff --git a/src/qt/macoshelper.mm b/src/qt/macoshelper.mm
index 0b29f25f..a7fb061d 100644
--- a/src/qt/macoshelper.mm
+++ b/src/qt/macoshelper.mm
@@ -47,3 +47,11 @@ bool MacOSHelper::isCapsLock()
return (flags & NSAlphaShiftKeyMask);
#endif
}
+
+bool MacOSHelper::openFolderAndSelectItem(const QUrl &path)
+{
+ NSURL *nspath = path.toNSURL();
+ NSArray *fileURLs = [NSArray arrayWithObjects:nspath, nil];
+ [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
+ return true;
+}