def show_droplet(self, checked): if checked: if api.check_actionlist(self.tree.export_forms(), wx.GetApp().settings): self.droplet = droplet.Frame(self, title=_("Drag & Drop") + ' - ' + ct.TITLE, bitmap=graphics.bitmap(images.DROPLET), method=self.on_drop, label=self.droplet_label_format( system.filename_to_title(self.filename)), label_color=wx.Colour(217, 255, 186), label_pos=(8, 8), label_angle=0, pos=self.GetPosition(), auto=True, OnShow=self.on_show_droplet, tooltip=_( "Drop any files and/or folders on this Phatch droplet\n" "to batch process them.\n" "Right-click or double-click to switch to normal view.")) else: wx.CallAfter(self.on_show_droplet, False) else: if self.droplet: self.droplet.show(False)
def remove_phatch_explorer_actions(actionlist): labels = [ RECENT, INSPECTOR, ct.LABEL_PHATCH_ACTIONLIST % system.filename_to_title(actionlist), ] deregister_extensions(labels, _IMAGE_READ_EXTENSIONS, folder=True)
def create_phatch_droplet(actionlist, folder, icon='phatch'): """""" create_droplet( name=system.filename_to_title(actionlist), command=ct.COMMAND['DROP'] % actionlist, folder=folder, icon=icon, )
def create_phatch_thunar_action(actionlist, description='', icon='phatch'): """""" return create_thunar_action( name=ct.LABEL_PHATCH_ACTIONLIST % system.filename_to_title(actionlist), description=description, command=ct.COMMAND['DROP'] % actionlist, icon=icon, types='<directories/><image-files/>', )
def create_phatch_droplet(actionlist, folder): """""" name = os.path.splitext(os.path.basename(actionlist))[0] create_droplet( name=name, arguments=ct.COMMAND_ARGUMENTS['DROP'] % actionlist, folder=folder, description=ct.LABEL_PHATCH_ACTIONLIST % \ system.filename_to_title(name))
def create_phatch_explorer_action(actionlist): """""" return register_phatch( label=ct.LABEL_PHATCH_ACTIONLIST % \ system.filename_to_title(actionlist), arguments=ct.COMMAND_ARGUMENTS['DROP'] % actionlist, extensions=_IMAGE_READ_EXTENSIONS, folder=True, )
def create_phatch_thunar_action(actionlist, description="", icon="phatch"): """""" return create_thunar_action( name=ct.LABEL_PHATCH_ACTIONLIST % system.filename_to_title(actionlist), description=description, command=ct.COMMAND["DROP"] % actionlist, icon=icon, types="<directories/><image-files/>", )
def show_notification(self, message, force=False, report=None): self.set_report(report) active = wx.GetApp().IsActive() or self.IsActive() if force or not active: notify.send(title=system.filename_to_title(self.filename), message=message, icon=self.get_icon_filename(), wxicon=graphics.bitmap(images.ICON_PHATCH_64)) if not active: self.RequestUserAttention()
def show_notification(self, message, force=False, report=None): self.set_report(report) active = wx.GetApp().IsActive() or self.IsActive() if force or not active: notify.send( title=system.filename_to_title(self.filename), message=message, icon=self.get_icon_filename(), wxicon=graphics.bitmap(images.ICON_PHATCH_64)) if not active: self.RequestUserAttention()
def get_action_list(self, file_list): if not file_list: file_list = self.get_action_list_files() d = {} for f in file_list: d[system.filename_to_title(f)] = f actionlists = d.keys() actionlists.sort() dlg = wx.SingleChoiceDialog(None, _('Select action list'), ct.TITLE, actionlists, wx.CHOICEDLG_STYLE) if dlg.ShowModal() == wx.ID_OK: actionlist = d[dlg.GetStringSelection()] else: actionlist = None dlg.Destroy() return actionlist
def remove_phatch_explorer_actions(actionlist): for label in [RECENT, INSPECTOR, ct.LABEL_PHATCH_ACTIONLIST % system.filename_to_title(actionlist)]: deregister_extensions(label, _IMAGE_READ_EXTENSIONS, folder=True)
def create_phatch_droplet(actionlist, folder, icon="phatch"): """""" create_droplet( name=system.filename_to_title(actionlist), command=ct.COMMAND["DROP"] % actionlist, folder=folder, icon=icon )