[qcineoob] try to guess subtitle extension at download
This commit is contained in:
parent
233c18b2e1
commit
01ac98b167
1 changed files with 8 additions and 1 deletions
|
|
@ -60,8 +60,15 @@ class Subtitle(QFrame):
|
|||
self.ui.verticalLayout.setAlignment(Qt.AlignTop)
|
||||
|
||||
def download(self):
|
||||
if not empty(self.subtitle.url):
|
||||
if self.subtitle.url.endswith('.rar'):
|
||||
ext = '.rar'
|
||||
elif self.subtitle.url.endswith('.srt'):
|
||||
ext = '.srt'
|
||||
else:
|
||||
ext = '.zip'
|
||||
fileDial = QFileDialog(self, 'Save "%s" subtitle file' %
|
||||
self.subtitle.name, '%s' % self.subtitle.name, 'all files (*)')
|
||||
self.subtitle.name, '%s%s' % (self.subtitle.name, ext), 'all files (*)')
|
||||
fileDial.setAcceptMode(QFileDialog.AcceptSave)
|
||||
fileDial.setLabelText(QFileDialog.Accept, 'Save subtitle file')
|
||||
fileDial.setLabelText(QFileDialog.FileName, 'Subtitle file name')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue