[pitivi] preset: Fix combo item activation when saving
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] preset: Fix combo item activation when saving
- Date: Tue, 19 Dec 2017 20:59:16 +0000 (UTC)
commit 8b2927ee6f29e3770c110c96ce7a4eefc4647064
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Dec 19 02:30:21 2017 +0100
preset: Fix combo item activation when saving
TestRender.test_remove_profile was failing because after saving the
proper item was not selected.
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1921
pitivi/preset.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/preset.py b/pitivi/preset.py
index db8afb4..065ceaa 100644
--- a/pitivi/preset.py
+++ b/pitivi/preset.py
@@ -147,6 +147,8 @@ class PresetManager(GObject.Object, Loggable):
entry = self.combo.get_child()
preset_name = entry.get_text()
self.saveCurrentPreset(preset_name)
+ # Useful when a new preset has just been created.
+ self.combo.set_active_id(preset_name)
self.updateMenuActions()
def updateMenuActions(self):
@@ -321,9 +323,8 @@ class PresetManager(GObject.Object, Loggable):
def saveCurrentPreset(self, new_name=None):
"""Updates the current preset values from the widgets and saves it."""
-
if not self.cur_preset:
- self.createPreset(preset_name)
+ self.createPreset(new_name)
if new_name:
self._renameCurrentPreset(new_name)
values = self.presets[self.cur_preset]
@@ -569,7 +570,6 @@ class EncodingTargetManager(PresetManager):
target.save()
self._add_target(target)
- self.combo.set_active(len(self.combo.props.model) - 1)
def select_preset(self, combo):
"""Selects preset from currently active row in @combo.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]