def slotActionInvoked(self, msg): notifyId, action = msg.arguments() taskId = self._notified.get(notifyId, None) if not taskId: # other applications' notifications return taskItem = app.taskModel.taskManager.get(taskId, None) if not taskItem: logging.debug("taskItem cannot be found anymore in TaskModel.") return fullpath = taskItem.fullpath # path + name if action == "open": return systemOpen(fullpath) elif action == "viewOneFile": return viewOneFile(fullpath) elif action == "default": # Unity's notify osd always have a default action. return else: raise Exception("Unknown action from slotActionInvoked: {}.".format(action))
def slotActionInvoked(self, msg): notifyId, action = msg.arguments() taskId = self._notified.get(notifyId, None) if not taskId: # other applications' notifications return taskItem = self.__taskModel.adapterMap.get(taskId, None) if not taskItem: logging.debug("taskItem cannot be found anymore in TaskModel.") return fullpath = taskItem.fullpath # path + name if action == "open": return systemOpen(fullpath) elif action == "viewOneFile": return viewOneFile(fullpath) elif action == "default": # Unity's notify osd always have a default action. return else: raise Exception( "Unknown action from slotActionInvoked: {}.".format(action))
def systemViewOneFile(self, url): if self.__adapter.mountsFaker: viewOneFile(self.__adapter.mountsFaker.convertToLocalPath(url))
def systemViewOneFile(self, url): adapter = app.adapterManager[0] if adapter.mountsFaker: viewOneFile(adapter.mountsFaker.convertToLocalPath(url))
def viewOneTask(self, task: QModelIndex): taskData = self.get(task) viewOneFile(taskData.fullpath)
def do_viewOneTask(task): filename = task["path"] + task["name"] viewOneFile(filename)