def _ExportToPngs( self ): export_object = self._GetExportObject() if export_object is None: return if not isinstance( export_object, HydrusSerialisable.SerialisableList ): self._ExportToPng() return from hydrus.client.gui import ClientGUITopLevelWindowsPanels from hydrus.client.gui import ClientGUISerialisable with ClientGUITopLevelWindowsPanels.DialogNullipotent( self, 'export to pngs' ) as dlg: panel = ClientGUISerialisable.PngsExportPanel( dlg, export_object ) dlg.SetPanel( panel ) dlg.exec()
def _ShowGallerySeedLogFrame(self): gallery_seed_log = self._gallery_seed_log_get_callable() tlw = self.window() title = '{} log'.format(self._gallery_type_string) if isinstance(tlw, QP.Dialog): if self._gallery_seed_log_set_callable is None: # throw up a dialog that edits the gallery_seed log in place with ClientGUITopLevelWindowsPanels.DialogNullipotent( self, title) as dlg: panel = EditGallerySeedLogPanel( dlg, self._controller, self._read_only, self._can_generate_more_pages, self._gallery_type_string, gallery_seed_log) dlg.SetPanel(panel) dlg.exec() else: # throw up a dialog that edits the gallery_seed log but can be cancelled dupe_gallery_seed_log = gallery_seed_log.Duplicate() with ClientGUITopLevelWindowsPanels.DialogEdit(self, title) as dlg: panel = EditGallerySeedLogPanel( dlg, self._controller, self._read_only, self._can_generate_more_pages, self._gallery_type_string, dupe_gallery_seed_log) dlg.SetPanel(panel) if dlg.exec() == QW.QDialog.Accepted: self._gallery_seed_log_set_callable( dupe_gallery_seed_log) else: # throw up a frame that edits the gallery_seed log in place frame_key = 'gallery_import_log' frame = ClientGUITopLevelWindowsPanels.FrameThatTakesScrollablePanel( self, title, frame_key) panel = EditGallerySeedLogPanel(frame, self._controller, self._read_only, self._can_generate_more_pages, self._gallery_type_string, gallery_seed_log) frame.SetPanel(panel)
def _ExportToPng( self ): payload = self._GetExportableURLsString() with ClientGUITopLevelWindowsPanels.DialogNullipotent( self, 'export to png' ) as dlg: panel = ClientGUISerialisable.PngExportPanel( dlg, payload ) dlg.SetPanel( panel ) dlg.exec()
def ExportToPNG(win: QW.QWidget, gallery_seed_log: ClientImportGallerySeeds.GallerySeedLog): payload = GetExportableURLsString(gallery_seed_log) with ClientGUITopLevelWindowsPanels.DialogNullipotent( win, 'export to png') as dlg: panel = ClientGUISerialisable.PNGExportPanel(dlg, payload) dlg.SetPanel(panel) dlg.exec()
def ExportToPNG(win: QW.QWidget, file_seed_cache: ClientImportFileSeeds.FileSeedCache): payload = GetExportableSourcesString(file_seed_cache) with ClientGUITopLevelWindowsPanels.DialogNullipotent( win, 'export to png') as dlg: panel = ClientGUISerialisable.PNGExportPanel(dlg, payload) dlg.SetPanel(panel) dlg.exec()
def _ShowFileSeedCacheFrame(self): file_seed_cache = self._file_seed_cache_get_callable() tlw = self.window() title = 'file log' if isinstance(tlw, QP.Dialog): if self._file_seed_cache_set_callable is None: # throw up a dialog that edits the file_seed cache in place with ClientGUITopLevelWindowsPanels.DialogNullipotent( self, title) as dlg: panel = EditFileSeedCachePanel(dlg, self._controller, file_seed_cache) dlg.SetPanel(panel) dlg.exec() else: # throw up a dialog that edits the file_seed cache but can be cancelled dupe_file_seed_cache = file_seed_cache.Duplicate() with ClientGUITopLevelWindowsPanels.DialogEdit(self, title) as dlg: panel = EditFileSeedCachePanel(dlg, self._controller, dupe_file_seed_cache) dlg.SetPanel(panel) if dlg.exec() == QW.QDialog.Accepted: self._file_seed_cache_set_callable( dupe_file_seed_cache) else: # throw up a frame that edits the file_seed cache in place frame_key = 'file_import_status' frame = ClientGUITopLevelWindowsPanels.FrameThatTakesScrollablePanel( self, title, frame_key) panel = EditFileSeedCachePanel(frame, self._controller, file_seed_cache) frame.SetPanel(panel)
def _ExportToPng( self ): export_object = self._GetExportObject() if export_object is not None: from hydrus.client.gui import ClientGUITopLevelWindowsPanels from hydrus.client.gui import ClientGUISerialisable with ClientGUITopLevelWindowsPanels.DialogNullipotent( self, 'export to png' ) as dlg: panel = ClientGUISerialisable.PngExportPanel( dlg, export_object ) dlg.SetPanel( panel ) dlg.exec()