def on_actionAdd_triggered(self): filter = self.msg["d_ALLFiles"]+" (*.*)" for group in const.EXTENSION_GROUPS: filter += self.msg["d_"+group+"Files"]+" (" for ext in vars(const)[group+"_EXTENSIONS"]: filter += "*.%s " %ext filter += ");;" #filter += self.msg["d_ALLFiles"]+" (*.*)" fileName = QtGui.QFileDialog.getOpenFileNames(self, self.msg["d_addFilesCaption"], const.USER_HOME_PATH, filter) if fileName: for f in fileName: if fileNode(unicode(f)).ext in self.plugins.getExtList(): self.actionList.addItem([unicode(f)])
def checkInputList(self): for arg in sys.argv[1:]: if os.path.isfile(arg) and fileNode(arg).ext in self.plugins.getExtList(): self.actionList.addItem([unicode(arg)])