def onMenuImportClick(self, event): wildcard = '*.yaml|*.yaml|{}|*.*'.format(_('All files')) path = filedlg.showOpenFileDlg(self, wildcard=wildcard) if path: tasks = SyncTaskList.load(path) self.m_items.removeAll() self.m_items.addTasks(tasks)
def showOpenFileDlg(self): wildcard = '|'.join([ _('All supported files'), subtitleWildcard + ';' + videoWildcard, _('Subtitle files'), subtitleWildcard, _('Video files'), videoWildcard, _('All files'), '*.*' ]) return filedlg.showOpenFileDlg(self, multiple=True, wildcard=wildcard)
def addFiles(self, col=None): wildcard = '|'.join([ _('All supported files'), subtitleWildcard + ';' + videoWildcard, _('Subtitle files'), subtitleWildcard, _('Video files'), videoWildcard, _('All files'), '*.*' ]) paths = filedlg.showOpenFileDlg(self, multiple=True, wildcard=wildcard) if paths: self.m_items.addFiles(paths, col=col)
def showOpenFileDlg(parent, file): props = {} if file.path != None: props['defaultFile'] = file.path props['wildcard'] = '|'.join([ _('All supported files'), subtitleWildcard + ';' + videoWildcard, _('Subtitle files'), subtitleWildcard, _('Video files'), videoWildcard, _('All files'), '*.*' ]) path = filedlg.showOpenFileDlg(parent, **props) return readStream(parent, path, file.types)
def onMenuItemImportListClick(self, event): wildcard = '*.yaml|*.yaml|{}|*.*'.format(_('All files')) path = filedlg.showOpenFileDlg(self, wildcard=wildcard) if path: tasks = SyncTaskList.load(path) self.setTasks(tasks)