[pitivi] preset: Allow creating a new preset only when a preset is selected
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] preset: Allow creating a new preset only when a preset is selected
- Date: Wed, 25 Nov 2015 09:56:03 +0000 (UTC)
commit fa369837bbe4787dccac7379991c7eb7519a0801
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sun Oct 11 00:23:38 2015 +0200
preset: Allow creating a new preset only when a preset is selected
Differential Revision: https://phabricator.freedesktop.org/D369
Reviewed-by: Thibault Saunier <tsaunier gnome org>
pitivi/preset.py | 4 ++++
pitivi/project.py | 3 +++
2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/preset.py b/pitivi/preset.py
index f09d453..7bceed6 100644
--- a/pitivi/preset.py
+++ b/pitivi/preset.py
@@ -332,6 +332,10 @@ class PresetManager(Loggable):
return False
return True
+ def isNewButtonSensitive(self):
+ """Whether the New button should be enabled"""
+ return bool(self.cur_preset)
+
def _projectToPreset(self, project):
raise NotImplementedError()
diff --git a/pitivi/project.py b/pitivi/project.py
index 4aaf185..cfc00e6 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -1621,6 +1621,9 @@ class ProjectSettingsDialog():
can_remove = mgr.isRemoveButtonSensitive()
self.preset_actions[button]["remove"].set_enabled(can_remove)
+ can_create_new = mgr.isNewButtonSensitive()
+ self.preset_actions[button]["new"].set_enabled(can_create_new)
+
def _loadPresets(self, mgr, combo, button):
"""Set up the specified treeview to display the specified presets.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]