From 3274d3dad9f9205752e79926c2fed01cd81bbf55 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 23 Apr 2006 22:14:28 +0000 Subject: [PATCH] * src/ColumnOrder.py: use ManagedWindow * src/DataViews/_MediaView.py: ColumnOrder update * src/DataViews/_RepositoryView.py: ColumnOrder update * src/DataViews/_SourceView.py: ColumnOrder update * src/DataViews/_EventView.py: ColumnOrder update * src/DataViews/_PlaceView.py: ColumnOrder update * src/DataViews/_PersonView.py: ColumnOrder update svn: r6424 --- ChangeLog | 7 +++++++ src/ColumnOrder.py | 23 ++++++++++++++++------- src/DataViews/_EventView.py | 7 +++++-- src/DataViews/_MediaView.py | 7 +++++-- src/DataViews/_PersonView.py | 7 +++++-- src/DataViews/_PlaceView.py | 7 +++++-- src/DataViews/_RepositoryView.py | 7 +++++-- src/DataViews/_SourceView.py | 7 +++++-- 8 files changed, 53 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99ee7b927..98076fc8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ 2006-04-23 Don Allingham + * src/ColumnOrder.py: use ManagedWindow + * src/DataViews/_MediaView.py: ColumnOrder update + * src/DataViews/_RepositoryView.py: ColumnOrder update + * src/DataViews/_SourceView.py: ColumnOrder update + * src/DataViews/_EventView.py: ColumnOrder update + * src/DataViews/_PlaceView.py: ColumnOrder update + * src/DataViews/_PersonView.py: ColumnOrder update * src/ColumnOrder.py: preserved column width * src/GrampsCfg.py: remove familyview stuff * src/plugins/TestcaseGenerator.py: fix BIRTH, DEATH constants diff --git a/src/ColumnOrder.py b/src/ColumnOrder.py index a68ffd968..56215c5ff 100644 --- a/src/ColumnOrder.py +++ b/src/ColumnOrder.py @@ -23,12 +23,13 @@ # GTK/Gnome modules # #------------------------------------------------------------------------- -import gobject import gtk.glade import const from gettext import gettext as _ +import ManagedWindow + #------------------------------------------------------------------------- # # set up logging @@ -37,16 +38,21 @@ from gettext import gettext as _ import logging log = logging.getLogger(".ColumnOrder") -class ColumnOrder: +class ColumnOrder(ManagedWindow.ManagedWindow): - def __init__(self,arglist,column_names,callback): + def __init__(self, uistate, arglist, column_names, callback): + + ManagedWindow.ManagedWindow.__init__(self, uistate, [], self) + self.glade = gtk.glade.XML(const.gladeFile,"columns","gramps") - self.top = self.glade.get_widget('columns') + + self.set_window(self.glade.get_widget('columns')) + self.tree = self.glade.get_widget('list') self.arglist = arglist self.callback = callback - self.top.set_title("%s - GRAMPS" % _('Select Columns')) + self.window.set_title("%s - GRAMPS" % _('Select Columns')) self.model = gtk.ListStore( bool , str , int , object ) @@ -77,6 +83,9 @@ class ColumnOrder: 2, item[1], 3, item) + def build_menu_names(self,obj): + return (_('Column Editor'), _('Column Editor')) + def ok_clicked(self,obj): newlist = [] for i in range(0,len(self.arglist)): @@ -87,10 +96,10 @@ class ColumnOrder: newlist.append((enable, index, value[2])) self.callback(newlist) - self.top.destroy() + self.close() def cancel_clicked(self,obj): - self.top.destroy() + self.close() def toggled(self, cell, path, model): node = model.get_iter((int(path),)) diff --git a/src/DataViews/_EventView.py b/src/DataViews/_EventView.py index 1187385e8..8c73017de 100644 --- a/src/DataViews/_EventView.py +++ b/src/DataViews/_EventView.py @@ -126,8 +126,11 @@ class EventView(PageView.ListView): def column_editor(self,obj): import ColumnOrder - ColumnOrder.ColumnOrder(self.dbstate.db.get_event_column_order(), - column_names, self.set_column_order) + ColumnOrder.ColumnOrder( + self.uistate, + self.dbstate.db.get_event_column_order(), + column_names, + self.set_column_order) def set_column_order(self,list): self.dbstate.db.set_event_column_order(list) diff --git a/src/DataViews/_MediaView.py b/src/DataViews/_MediaView.py index 45d2a4b62..db18318bc 100644 --- a/src/DataViews/_MediaView.py +++ b/src/DataViews/_MediaView.py @@ -83,8 +83,11 @@ class MediaView(PageView.ListView): def column_editor(self,obj): import ColumnOrder - ColumnOrder.ColumnOrder(self.dbstate.db.get_media_column_order(), - column_names, self.set_column_order) + ColumnOrder.ColumnOrder( + self.uistate, + self.dbstate.db.get_media_column_order(), + column_names, + self.set_column_order) def set_column_order(self,list): self.dbstate.db.set_media_column_order(list) diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index 88899f269..486ef9035 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -125,8 +125,11 @@ class PersonView(PageView.PersonNavView): def column_editor(self,obj): import ColumnOrder - ColumnOrder.ColumnOrder(self.dbstate.db.get_person_column_order(), - column_names, self.set_column_order) + ColumnOrder.ColumnOrder( + self.uistate, + self.dbstate.db.get_person_column_order(), + column_names, + self.set_column_order) def set_column_order(self, column_list): self.dbstate.db.set_person_column_order(column_list) diff --git a/src/DataViews/_PlaceView.py b/src/DataViews/_PlaceView.py index 0cc4ee3e7..9d04e49c1 100644 --- a/src/DataViews/_PlaceView.py +++ b/src/DataViews/_PlaceView.py @@ -89,8 +89,11 @@ class PlaceView(PageView.ListView): def column_editor(self,obj): import ColumnOrder - ColumnOrder.ColumnOrder(self.dbstate.db.get_place_column_order(), - column_names, self.set_column_order) + ColumnOrder.ColumnOrder( + self.uistate, + self.dbstate.db.get_place_column_order(), + column_names, + self.set_column_order) def set_column_order(self,list): self.dbstate.db.set_place_column_order(list) diff --git a/src/DataViews/_RepositoryView.py b/src/DataViews/_RepositoryView.py index cb58443fd..0626170b4 100644 --- a/src/DataViews/_RepositoryView.py +++ b/src/DataViews/_RepositoryView.py @@ -95,8 +95,11 @@ class RepositoryView(PageView.ListView): def column_editor(self,obj): import ColumnOrder - ColumnOrder.ColumnOrder(self.dbstate.db.get_repository_column_order(), - column_names, self.set_column_order) + ColumnOrder.ColumnOrder( + self.uistate, + self.dbstate.db.get_repository_column_order(), + column_names, + self.set_column_order) def set_column_order(self,list): self.dbstate.db.set_repository_column_order(list) diff --git a/src/DataViews/_SourceView.py b/src/DataViews/_SourceView.py index 2ac4ac492..dfdf09e96 100644 --- a/src/DataViews/_SourceView.py +++ b/src/DataViews/_SourceView.py @@ -88,8 +88,11 @@ class SourceView(PageView.ListView): def column_editor(self,obj): import ColumnOrder - ColumnOrder.ColumnOrder(self.dbstate.db.get_source_column_order(), - column_names, self.set_column_order) + ColumnOrder.ColumnOrder( + self.uistate, + self.dbstate.db.get_source_column_order(), + column_names, + self.set_column_order) def set_column_order(self,list): self.dbstate.db.set_source_column_order(list)