From 01ac98b167cf2ca8a3285ddd9be96c0b88f03e1d Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Mon, 18 Mar 2013 01:58:52 +0100 Subject: [PATCH] [qcineoob] try to guess subtitle extension at download --- weboob/applications/qcineoob/subtitle.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/weboob/applications/qcineoob/subtitle.py b/weboob/applications/qcineoob/subtitle.py index 794a9999..b211399e 100644 --- a/weboob/applications/qcineoob/subtitle.py +++ b/weboob/applications/qcineoob/subtitle.py @@ -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')