Exemplo n.º 1
0
    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))
Exemplo n.º 2
0
    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))
Exemplo n.º 3
0
 def systemViewOneFile(self, url):
     if self.__adapter.mountsFaker:
         viewOneFile(self.__adapter.mountsFaker.convertToLocalPath(url))
Exemplo n.º 4
0
 def systemViewOneFile(self, url):
     if self.__adapter.mountsFaker:
         viewOneFile(self.__adapter.mountsFaker.convertToLocalPath(url))
Exemplo n.º 5
0
 def systemViewOneFile(self, url):
     adapter = app.adapterManager[0]
     if adapter.mountsFaker:
         viewOneFile(adapter.mountsFaker.convertToLocalPath(url))
Exemplo n.º 6
0
 def viewOneTask(self, task: QModelIndex):
     taskData = self.get(task)
     viewOneFile(taskData.fullpath)
Exemplo n.º 7
0
 def viewOneTask(self, task: QModelIndex):
     taskData = self.get(task)
     viewOneFile(taskData.fullpath)
Exemplo n.º 8
0
 def do_viewOneTask(task):
     filename = task["path"] + task["name"]
     viewOneFile(filename)