[pitivi] render: Cleanup abused callback method



commit 24b94d96821a16d40b6a3ecbe9d5a52fd15b2c53
Author: vinayak <vinayak saxena 90 gmail com>
Date:   Wed Feb 27 12:11:12 2019 +0530

    render: Cleanup abused callback method

 data/ui/renderingdialog.ui | 4 ++--
 pitivi/render.py           | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/renderingdialog.ui b/data/ui/renderingdialog.ui
index 5a100f20..c9225750 100644
--- a/data/ui/renderingdialog.ui
+++ b/data/ui/renderingdialog.ui
@@ -91,7 +91,7 @@
                     <property name="halign">start</property>
                     <property name="hexpand">True</property>
                     <property name="action">select-folder</property>
-                    <signal name="current-folder-changed" handler="_checkForExistingFile" swapped="no"/>
+                    <signal name="current-folder-changed" handler="_current_folder_changed_cb" swapped="no"/>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -133,7 +133,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="activates_default">True</property>
-                    <signal name="changed" handler="_checkForExistingFile" swapped="no"/>
+                    <signal name="changed" handler="_filename_changed_cb" swapped="no"/>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
diff --git a/pitivi/render.py b/pitivi/render.py
index 03968099..b4498ae0 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -696,7 +696,7 @@ class RenderDialog(Loggable):
         set_combo_value(self.muxer_combo,
                         Encoders().factories_by_name.get(self.project.muxer))
 
-    def _checkForExistingFile(self, *unused_args):
+    def _check_filename(self):
         """Displays a warning if the file path already exists."""
         path = self.filebutton.get_current_folder()
         if not path:
@@ -1072,6 +1072,12 @@ class RenderDialog(Loggable):
     def _containerContextHelpClickedCb(self, unused_button):
         show_user_manual("codecscontainers")
 
+    def _current_folder_changed_cb(self, *unused_args):
+        self._check_filename()
+
+    def _filename_changed_cb(self, *unused_args):
+        self._check_filename()
+
     # Periodic (timer) callbacks
     def _updateTimeEstimateCb(self):
         if self._rendering_is_paused:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]