[pitivi] ProjectSettings: allow adding and removing presets
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] ProjectSettings: allow adding and removing presets
- Date: Fri, 10 Dec 2010 17:52:57 +0000 (UTC)
commit c6aed943b7064f29846a6e453cc232c357a0cfaf
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Fri Nov 26 11:46:48 2010 +0000
ProjectSettings: allow adding and removing presets
pitivi/ui/projectsettings.glade | 6 ++++++
pitivi/ui/projectsettings.py | 33 +++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/projectsettings.glade b/pitivi/ui/projectsettings.glade
index 5aa82ec..fbdadc6 100644
--- a/pitivi/ui/projectsettings.glade
+++ b/pitivi/ui/projectsettings.glade
@@ -66,6 +66,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
+ <signal name="clicked" handler="_addVideoPresetButtonClickedCb"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -79,7 +80,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="sensitive">False</property>
<property name="use_stock">True</property>
+ <signal name="clicked" handler="_removeVideoPresetButtonClickedCb"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -372,6 +375,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
+ <signal name="clicked" handler="_addAudioPresetButtonClickedCb"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -385,7 +389,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="sensitive">False</property>
<property name="use_stock">True</property>
+ <signal name="clicked" handler="_removeAudioPresetButtonClickedCb"/>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/pitivi/ui/projectsettings.py b/pitivi/ui/projectsettings.py
index 708b085..5980f2e 100644
--- a/pitivi/ui/projectsettings.py
+++ b/pitivi/ui/projectsettings.py
@@ -185,7 +185,14 @@ class ProjectSettingsDialog(GladeWindow):
treeview.props.headers_visible = False
model = mgr.getModel()
treeview.set_model(model)
+ model.connect("row-inserted", self._newPresetCb,
+ column, renderer, treeview)
renderer.connect("edited", self.presetNameEditedCb, mgr)
+
+ def _newPresetCb(self, model, path, iter_, column, renderer, treeview):
+ treeview.set_cursor_on_cell(path, column, renderer, start_editing=True)
+ treeview.grab_focus()
+
def constrained(self):
return self.constrain_sar_button.props.active
@@ -211,6 +218,32 @@ class ProjectSettingsDialog(GladeWindow):
self.par_fraction_widget.set_sensitive(not state)
self.par_combo.set_sensitive(not state)
+ def _addAudioPresetButtonClickedCb(self, button):
+ self.audio_presets.addPreset(_("New Preset"), {
+ "channels" : get_combo_value(self.channels_combo),
+ "sample-rate" : get_combo_value(self.sample_rate_combo),
+ "depth" : get_combo_value(self.sample_depth_combo)
+ })
+
+ def _removeAudioPresetButtonClickedCb(self, button):
+ selection = self.audio_preset_treeview.get_selection()
+ model, iter_ = selection.get_selected()
+ if iter_:
+ self.audio_presets.removePreset(model[iter_][0])
+
+ def _addVideoPresetButtonClickedCb(self, button):
+ self.video_presets.addPreset(_("New Preset"), {
+ "width": int(self.width_spinbutton.get_value()),
+ "height": int(self.height_spinbutton.get_value()),
+ "frame-rate": self.frame_rate_fraction_widget.getWidgetValue(),
+ "par": self.par_fraction_widget.getWidgetValue(),
+ })
+
+ def _removeVideoPresetButtonClickedCb(self, button):
+ selection = self.video_preset_treeview.get_selection()
+ model, iter_ = selection.get_selected()
+ if iter_:
+ self.video_presets.removePreset(model[iter_][0])
def darSelected(self):
return self.select_dar_radiobutton.props.active
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]