[pitivi] render: Select the YouTube preset initially



commit 485615669c2a7bcce7424cae42c7a3311baf02dc
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sun Sep 13 09:31:38 2020 +0200

    render: Select the YouTube preset initially

 pitivi/render.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/pitivi/render.py b/pitivi/render.py
index d3c7aa898..ef8a52805 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -317,6 +317,13 @@ class PresetsManager(GObject.Object, Loggable):
         self.action_save.set_enabled(writable)
         self.emit("profile-selected", preset_item)
 
+    def select_default_preset(self):
+        """Selects the default hardcoded preset."""
+        for item in self.model:
+            if item.name == "youtube":
+                self.select_preset(item)
+                break
+
 
 class Encoders(Loggable):
     """Registry of available Muxers, Audio encoders and Video encoders.
@@ -835,6 +842,10 @@ class RenderDialog(Loggable):
         self.widgets_group.add_edge(self.preset_selection_menubutton, self.video_encoder_combo)
         self.widgets_group.add_edge(self.video_encoder_combo, self.quality_adjustment)
 
+        if not self.project.vcodecsettings:
+            self.presets_manager.select_default_preset()
+            self.quality_adjustment.props.value = Quality.MEDIUM
+
     def _presets_manager_profile_selected_cb(self, unused_target, preset_item):
         """Handles the selection of a render preset."""
         set_icon_and_title(self.preset_icon, self.preset_label, preset_item)


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