[pitivi/ges] Set a default value to TextWidget to allow resetting it
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges] Set a default value to TextWidget to allow resetting it
- Date: Sun, 8 Apr 2012 13:25:01 +0000 (UTC)
commit da1b9a217486c810fd4f90e8fa3f488900bed56f
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date: Sun Apr 8 09:22:25 2012 -0400
Set a default value to TextWidget to allow resetting it
Fixes bug #657393
pitivi/utils/widgets.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index a7b9035..28a8256 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -105,6 +105,10 @@ class TextWidget(gtk.HBox, DynamicWidget):
__NORMAL__ = gtk.gdk.Color(0, 0, 0)
def __init__(self, matches=None, choices=None, default=None):
+ if not default:
+ # In the case of text widgets, a blank default is an empty string
+ default = ""
+
gtk.HBox.__init__(self)
DynamicWidget.__init__(self, default)
@@ -742,8 +746,8 @@ def make_property_widget(unused_element, prop, value=None):
if value == None:
value = prop.default_value
- if (type_name == 'gchararray'):
- widget = TextWidget()
+ if type_name == "gchararray":
+ widget = TextWidget(default=prop.default_value)
elif (type_name in ['guint64', 'gint64', 'guint', 'gint', 'gfloat',
'gulong', 'gdouble']):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]