fak3 avatar fak3 committed 11c5f9e

gui_dialogs.py - show ActionDailog while calculationg lengths

Comments (0)

Files changed (1)

 import utils
 import conf
 
-from gui_utils import HBox, VBox, TreeItem, TreeWidget, TimeBox, TimeDeltaBox, DownloadFileDialog, StatusDialog, TextButton
+from gui_utils import HBox, VBox, TreeItem, TreeWidget, TimeBox, TimeDeltaBox, DownloadFileDialog, ActionDialog, StatusDialog, TextButton
 
 from main_utils import *
 
             parse_order_videolen(settings['download_dir'], o)
     finally:
         dump_orders(orders)
+    logging.info(u'Завершено: Длительность всех скачанных видеофайлов вычислена')
         
         
 class GetLenAction(ActionSetting):
         text = textwrap.dedent(u'''
             Вычислить длительность всех скачанных видеофайлов
         ''').replace('\n', '')
-        super(GetLenAction,self).__init__(u'Длительность видео', u'Вычислить', text, parse_lengths, parent)
+        super(GetLenAction,self).__init__(u'Длительность видео', u'Вычислить', text, self.rename, parent)
         
-    #def rename(self):
-        #parse_lengths(self.settings)
+    def rename(self):
+        self.button.setEnabled(False)
+        
+        dlg = ActionDialog(u'Вычисляенся длительность всех скачанных видеофайлов', parse_lengths)
+        res = dlg.exec_()
+        
+        if res == ActionDialog.OK:
+            QMessageBox.information(None, u'Завершено', u'OK')
+            
+        self.button.setEnabled(True)
         
     
     
             self.error.emit()
             return
             
-        dlg = DownloadFileDialog(src.raw, dst_path, self)
+        dlg = DownloadFileDialog(src.raw, dst_path)
         res = dlg.exec_()
         
         if res == DownloadFileDialog.OK:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.