forked from Public/monero-gui
OSHelper: file preselection support (Windows and Mac)
Co-authored-by: selsta <selsta@sent.at>
This commit is contained in:
@@ -35,6 +35,7 @@ class MacOSHelper
|
||||
|
||||
public:
|
||||
static bool isCapsLock();
|
||||
static bool openFolderAndSelectItem(const QUrl &path);
|
||||
};
|
||||
|
||||
#endif //MACOSHELPER_H
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user