From 2d440821281b4a9d54157ecd9e136e282ef1d808 Mon Sep 17 00:00:00 2001 From: Paul Friederichsen Date: Sat, 24 Feb 2024 08:12:59 -0600 Subject: [PATCH] Clean up ClientMacIntegration.py --- hydrus/client/ClientMacIntegration.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hydrus/client/ClientMacIntegration.py b/hydrus/client/ClientMacIntegration.py index f87876ba..abd2aa66 100644 --- a/hydrus/client/ClientMacIntegration.py +++ b/hydrus/client/ClientMacIntegration.py @@ -1,9 +1,3 @@ -from hydrus.core import HydrusConstants as HC -from hydrus.core import HydrusData -from hydrus.core import HydrusGlobals as HG - -from hydrus.client import ClientGlobals as CG - import objc from Foundation import NSObject, NSURL from Quartz import QLPreviewPanel @@ -14,21 +8,21 @@ class HydrusQLDataSource(NSObject, protocols=[QLPreviewPanelDataSource]): def initWithCurrentlyLooking_(self, currently_showing): self = objc.super(HydrusQLDataSource, self).init() if self is None: return None - + self.currently_showing = currently_showing - + return self - + def numberOfPreviewItemsInPreviewPanel_(self, panel): return 1 if self.currently_showing is not None else 0 - + def previewPanel_previewItemAtIndex_(self, panel, index): return NSURL.fileURLWithPath_(self.currently_showing) # or whatever - + def show_quicklook_for_path( path ): hydrus_data_source = HydrusQLDataSource.alloc().initWithCurrentlyLooking_(path) - + panel = QLPreviewPanel.sharedPreviewPanel() panel.setDataSource_(hydrus_data_source) panel.makeKeyAndOrderFront_(None)