[pitivi] prefs: Set instance attributes in __init__
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] prefs: Set instance attributes in __init__
- Date: Wed, 8 Jan 2014 18:39:44 +0000 (UTC)
commit d53cc5c326ff583aef0234bf9adfce5364bcf68a
Author: Mathieu Duponchelle <mduponchelle1 gmail com>
Date: Thu Dec 26 16:14:50 2013 +0100
prefs: Set instance attributes in __init__
pitivi/dialogs/prefs.py | 29 +++++++++++++----------------
1 files changed, 13 insertions(+), 16 deletions(-)
---
diff --git a/pitivi/dialogs/prefs.py b/pitivi/dialogs/prefs.py
index 0f1b9fa..0c6b582 100644
--- a/pitivi/dialogs/prefs.py
+++ b/pitivi/dialogs/prefs.py
@@ -58,7 +58,19 @@ class PreferencesDialog(object):
self.widgets = {}
self.resets = {}
self._current = None
- self._createUi()
+
+ # Identify the widgets we'll need
+ builder = Gtk.Builder()
+ builder.add_from_file(os.path.join(get_ui_dir(), "preferences.ui"))
+ builder.connect_signals(self)
+ self.dialog = builder.get_object("dialog1")
+ self.model = builder.get_object("liststore1")
+ self.treeview = builder.get_object("treeview1")
+ self.contents = builder.get_object("box1")
+ self.revert_button = builder.get_object("revertButton")
+ self.factory_settings = builder.get_object("resetButton")
+ self.restart_warning = builder.get_object("restartWarning")
+
self._fillContents()
req = self.contents.size_request()
min_width = req.width
@@ -72,21 +84,6 @@ class PreferencesDialog(object):
"""Run the internal dialog"""
self.dialog.run()
- def _createUi(self):
- """Create the Gtk builder"""
- builder = Gtk.Builder()
- builder.add_from_file(os.path.join(get_ui_dir(), "preferences.ui"))
- builder.connect_signals(self)
-
- # widgets we'll need
- self.dialog = builder.get_object("dialog1")
- self.model = builder.get_object("liststore1")
- self.treeview = builder.get_object("treeview1")
- self.contents = builder.get_object("box1")
- self.revert_button = builder.get_object("revertButton")
- self.factory_settings = builder.get_object("resetButton")
- self.restart_warning = builder.get_object("restartWarning")
-
## Public API
@classmethod
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]