Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added RippleUpdateGroup to control save button

Conflicts:

	pitivi/ui/encodingdialog.py
  • Loading branch information...
commit baba3db2d1d6d68b7fc0a94fc2980e92db82e2df 1 parent b4fd9b3
Feroze Naina authored
Showing with 38 additions and 5 deletions.
  1. +38 −5 pitivi/ui/encodingdialog.py
43 pitivi/ui/encodingdialog.py
View
@@ -36,6 +36,7 @@
from pitivi.ui.encodingprogress import EncodingProgressDialog
from pitivi.ui.gstwidget import GstElementSettingsDialog
from pitivi.actioner import Renderer
+from pitivi.ui.ripple_update_group import RippleUpdateGroup
from pitivi.ui.common import\
model,\
frame_rates,\
@@ -162,6 +163,18 @@ def __init__(self, app, project, pipeline=None):
self.window.connect("delete-event", self._deleteEventCb)
self.settings.connect("settings-changed", self._settingsChanged)
+ # Monitor changes
+
+ self.wg = RippleUpdateGroup()
+ self.wg.addVertex(self.frame_rate_combo, signal="changed")
+ self.wg.addVertex(self.save_render_preset_button,
+ update_func=self._updateRenderSaveButton)
+ self.wg.addVertex(self.channels_combo, signal="changed")
+ self.wg.addVertex(self.sample_rate_combo, signal="changed")
+ self.wg.addVertex(self.sample_depth_combo, signal="changed")
+ self.wg.addVertex(self.muxercombobox, signal="changed")
+ self.wg.addVertex(self.audio_encoder_combo, signal="changed")
+ self.wg.addVertex(self.video_encoder_combo, signal="changed")
self.render_presets = RenderPresetManager()
self.render_presets.load()
@@ -169,10 +182,24 @@ def __init__(self, app, project, pipeline=None):
self.render_preset_treeview, self.render_presets,
self._updateRenderPresetButtons)
+ self.wg.addEdge(self.frame_rate_combo,
+ self.save_render_preset_button)
+ self.wg.addEdge(self.audio_encoder_combo,
+ self.save_render_preset_button)
+ self.wg.addEdge(self.video_encoder_combo,
+ self.save_render_preset_button)
+ self.wg.addEdge(self.muxercombobox,
+ self.save_render_preset_button)
+ self.wg.addEdge(self.channels_combo,
+ self.save_render_preset_button)
+ self.wg.addEdge(self.sample_rate_combo,
+ self.save_render_preset_button)
+ self.wg.addEdge(self.sample_depth_combo,
+ self.save_render_preset_button)
+
self._infobarForPresetManager = {
self.render_presets: self.render_preset_infobar}
-
# Bind widgets to RenderPresetsManager
self.bindCombo(self.render_presets, "channels",
self.channels_combo)
@@ -207,7 +234,6 @@ def createNoPreset(self, mgr):
"width": self.getDimension("width")
})
-
def bindCombo(self, mgr, name, widget):
if name == "container":
mgr.bindWidget(name,
@@ -333,8 +359,6 @@ def _fillPresetsTreeview(self, treeview, mgr, update_buttons_func):
mgr, update_buttons_func)
treeview.connect("focus-out-event", self._treeviewDefocusedCb, mgr)
-
-
def _newPresetCb(self, model, path, iter_, column, renderer, treeview):
"""Handle the addition of a preset to the model of the preset manager.
"""
@@ -379,6 +403,10 @@ def _hidePresetManagerError(self, mgr):
infobar = self._infobarForPresetManager[mgr]
infobar.hide()
+
+ def _updateRenderSaveButton(self, unused_in, button):
+ button.set_sensitive(self.render_presets.isCurrentPresetChanged())
+
@staticmethod
def _getUniquePresetName(mgr):
"""Get a unique name for a new preset for the specified PresetManager.
@@ -418,6 +446,12 @@ def _copyRenderPresets(self, cur_preset):
self.render_presets.savePreset()
self.render_presets.save()
+ def _updateRenderPresetButtons(self):
+ preset_changed = self.render_presets.isCurrentPresetChanged()
+ self.save_render_preset_button.set_sensitive(preset_changed)
+ preset_selected = bool(self.render_presets.cur_preset)
+ self.remove_render_preset_button.set_sensitive(preset_selected)
+
def _removeRenderPresetButtonClickedCb(self, button):
selection = self.render_preset_treeview.get_selection()
model, iter_ = selection.get_selected()
@@ -465,7 +499,6 @@ def _setProperties(self):
self.render_preset_infobar = self.builder.get_object(
"render-preset-infobar")
-
def _settingsChanged(self, settings):
self.updateResolution()
Please sign in to comment.
Something went wrong with that request. Please try again.