[pitivi] ui.prefs: remember size of dialog
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] ui.prefs: remember size of dialog
- Date: Thu, 30 Apr 2009 12:20:05 -0400 (EDT)
commit 75eafbd7de6c7c9b4598e9317009254d7c8009e5
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Fri Apr 17 22:53:12 2009 -0700
ui.prefs: remember size of dialog
---
pitivi/ui/mainwindow.py | 1 -
pitivi/ui/prefs.py | 20 +++++++++++++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index 9492848..4b898de 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -656,7 +656,6 @@ class PitiviMainWindow(gtk.Window, Loggable):
self.prefsdialog = PreferencesDialog(self.app)
self.prefsdialog.set_transient_for(self)
self.prefsdialog.connect("delete-event", self._hideChildWindow)
- self.prefsdialog.set_default_size(400, 300)
self.prefsdialog.show()
def rewind(self, unused_action):
diff --git a/pitivi/ui/prefs.py b/pitivi/ui/prefs.py
index 8ea3bd1..9a5f5b4 100644
--- a/pitivi/ui/prefs.py
+++ b/pitivi/ui/prefs.py
@@ -28,6 +28,16 @@ from gettext import gettext as _
import pitivi.ui.dynamic as dynamic
from pitivi.settings import GlobalSettings
+GlobalSettings.addConfigOption('prefsDialogWidth',
+ section = "user-interface",
+ key = "prefs-dialog-width",
+ default = 400)
+
+GlobalSettings.addConfigOption('prefsDialogHeight',
+ section = "user-interface",
+ key = "prefs-dialog-height",
+ default = 300)
+
class PreferencesDialog(gtk.Window):
prefs = {}
@@ -42,11 +52,13 @@ class PreferencesDialog(gtk.Window):
self._createUi()
self._fillContents()
-
def _createUi(self):
self.set_title(_("Preferences"))
self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
self.set_border_width(12)
+ self.connect("configure-event", self._configureCb)
+ self.set_default_size(self.settings.prefsDialogWidth,
+ self.settings.prefsDialogHeight)
# basic layout
vbox = gtk.VBox()
@@ -72,6 +84,8 @@ class PreferencesDialog(gtk.Window):
scrolled = gtk.ScrolledWindow()
scrolled.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
scrolled.add(self.treeview)
+ scrolled.set_shadow_type(gtk.SHADOW_ETCHED_IN)
+ self.treeview.props.headers_visible = False
self.treeview.show()
pane.pack1(scrolled)
scrolled.show()
@@ -337,6 +351,10 @@ class PreferencesDialog(gtk.Window):
value = type(value)(real_widget.getWidgetValue())
setattr(self.settings, attrname, value)
+ def _configureCb(self, unused_widget, event):
+ self.settings.prefsDialogWidth = event.width
+ self.settings.prefsDialogHeight = event.height
+
## Preference Test Cases
if False:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]