From a41b175b09b766329e66eb51ef0ac39b8bce5e8a Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 6 Jun 2012 16:59:43 +0000 Subject: [PATCH] GEPS008: Moved ListModel module svn: r19774 --- po/POTFILES.skip | 2 +- src/Bookmarks.py | 4 ++-- src/Makefile.am | 1 - src/Reorder.py | 6 +++--- src/gui/Makefile.am | 1 + src/gui/filtereditor.py | 6 +++--- src/{ListModel.py => gui/listmodel.py} | 0 src/gui/plug/report/_styleeditor.py | 6 +++--- src/gui/viewmanager.py | 2 +- src/gui/views/tags.py | 2 +- src/gui/widgets/tageditor.py | 2 +- src/plugins/BookReport.py | 10 +++++----- src/plugins/gramplet/Attributes.py | 2 +- src/plugins/gramplet/Backlinks.py | 2 +- src/plugins/gramplet/Children.py | 2 +- src/plugins/gramplet/Citations.py | 2 +- src/plugins/gramplet/Events.py | 2 +- src/plugins/gramplet/PersonResidence.py | 2 +- src/plugins/lib/libmetadata.py | 2 +- src/plugins/tool/DumpGenderStats.py | 10 +++++----- src/plugins/tool/FindDupes.py | 6 +++--- 21 files changed, 36 insertions(+), 36 deletions(-) rename src/{ListModel.py => gui/listmodel.py} (100%) diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 2c3e0f452..cb941a725 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -7,7 +7,6 @@ src/AutoComp.py src/Errors.py src/ImgManip.py -src/ListModel.py src/RecentFiles.py src/Sort.py src/soundex.py @@ -230,6 +229,7 @@ src/gui/dbguielement.py src/gui/ddtargets.py src/gui/display.py src/gui/glade.py +src/gui/listmodel.py src/gui/managedwindow.py src/gui/navigator.py src/gui/pluginmanager.py diff --git a/src/Bookmarks.py b/src/Bookmarks.py index bf58f0068..2d08d3267 100644 --- a/src/Bookmarks.py +++ b/src/Bookmarks.py @@ -52,7 +52,7 @@ import gtk # #------------------------------------------------------------------------- from gui.display import display_help -import ListModel +from gui.listmodel import ListModel import Utils import const from gen.ggettext import sgettext as _ @@ -212,7 +212,7 @@ class Bookmarks : name_titles = [(_('Name'), -1, 200), (_('ID'), -1, 50), ('', -1, 0)] self.namelist = gtk.TreeView() - self.namemodel = ListModel.ListModel(self.namelist, name_titles) + self.namemodel = ListModel(self.namelist, name_titles) self.namemodel_cols = len(name_titles) slist = gtk.ScrolledWindow() diff --git a/src/Makefile.am b/src/Makefile.am index d875f20b8..e433e1ea4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,6 @@ gdir_PYTHON = \ gramps.py\ ImgManip.py\ LdsUtils.py \ - ListModel.py\ Lru.py\ MacTransUtils.py\ RecentFiles.py\ diff --git a/src/Reorder.py b/src/Reorder.py index 3ac458ef6..ca2981531 100644 --- a/src/Reorder.py +++ b/src/Reorder.py @@ -33,7 +33,7 @@ from gen.ggettext import gettext as _ #------------------------------------------------------------------------- from gen.db import DbTxn from gen.display.name import displayer as name_displayer -import ListModel +from gui.listmodel import ListModel from gui.managedwindow import ManagedWindow from gui.glade import Glade @@ -59,10 +59,10 @@ class Reorder(ManagedWindow): self.set_window(top, None, _("Reorder Relationships")) self.ptree = xml.get_object('ptree') - self.pmodel = ListModel.ListModel(self.ptree, PARENT_TITLES) + self.pmodel = ListModel(self.ptree, PARENT_TITLES) self.ftree = xml.get_object('ftree') - self.fmodel = ListModel.ListModel(self.ftree, FAMILY_TITLES) + self.fmodel = ListModel(self.ftree, FAMILY_TITLES) xml.get_object('ok').connect('clicked', self.ok_clicked) xml.get_object('cancel').connect('clicked', self.cancel_clicked) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 7b882ecf7..ca685ea33 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -35,6 +35,7 @@ pkgpython_PYTHON = \ glade.py \ grampsbar.py \ grampsgui.py \ + listmodel.py \ makefilter.py \ managedwindow.py \ navigator.py \ diff --git a/src/gui/filtereditor.py b/src/gui/filtereditor.py index c6231082c..16c1461f4 100644 --- a/src/gui/filtereditor.py +++ b/src/gui/filtereditor.py @@ -56,7 +56,7 @@ import gobject from gen.filters import (GenericFilterFactory, FilterList, reload_custom_filters) from gen.filters.rules._matchesfilterbase import MatchesFilterBase -import ListModel +from gui.listmodel import ListModel from gui.managedwindow import ManagedWindow from gui.dialog import QuestionDialog import const @@ -737,7 +737,7 @@ class EditFilter(ManagedWindow): self.get_widget('definition_title'), _('Define filter')) - self.rlist = ListModel.ListModel( + self.rlist = ListModel( self.get_widget('rule_list'), [(_('Name'),-1,150),(_('Values'),-1,150)], self.select_row, @@ -1020,7 +1020,7 @@ class FilterEditor(ManagedWindow): self.uistate.connect('filter-name-changed', self.clean_after_rename) - self.clist = ListModel.ListModel( + self.clist = ListModel( self.filter_list, [(_('Filter'), 0, 150), (_('Comment'), 1, 150)], self.filter_select_row, diff --git a/src/ListModel.py b/src/gui/listmodel.py similarity index 100% rename from src/ListModel.py rename to src/gui/listmodel.py diff --git a/src/gui/plug/report/_styleeditor.py b/src/gui/plug/report/_styleeditor.py index 634d6ea32..759de49c5 100644 --- a/src/gui/plug/report/_styleeditor.py +++ b/src/gui/plug/report/_styleeditor.py @@ -54,7 +54,7 @@ import const from gen.plug.docgen import (StyleSheet, FONT_SERIF, FONT_SANS_SERIF, PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT, PARA_ALIGN_JUSTIFY) -import ListModel +from gui.listmodel import ListModel from gui.managedwindow import ManagedWindow from gui.glade import Glade @@ -102,7 +102,7 @@ class StyleListDisplay(object): title_label.set_text(Utils.title(_('Style Editor'))) title_label.set_use_markup(True) - self.list = ListModel.ListModel(self.top.get_object("list"), + self.list = ListModel(self.top.get_object("list"), [(_('Style'), -1, 10)], ) self.redraw() if parent_window: @@ -217,7 +217,7 @@ class StyleEditor(object): self.top.get_object("label6").set_text(_("point size|pt")) titles = [(_('Paragraph'), 0, 130)] - self.plist = ListModel.ListModel(self.top.get_object("ptree"), titles, + self.plist = ListModel(self.top.get_object("ptree"), titles, self.change_display) self.top.get_object('color').connect('color-set', self.fg_color_set) diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index 7f2bc4a70..d695ba7d6 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -444,7 +444,7 @@ class ViewManager(CLIManager): def update_addons(self, addon_update_list): from gui.glade import Glade from gui.managedwindow import ManagedWindow - from ListModel import ListModel, NOSORT, TOGGLE + from gui.listmodel import ListModel, NOSORT, TOGGLE glade = Glade("updateaddons.glade") self.update_dialog = glade.toplevel ManagedWindow.set_titles(self.update_dialog, diff --git a/src/gui/views/tags.py b/src/gui/views/tags.py index 068c21144..655ec67f5 100644 --- a/src/gui/views/tags.py +++ b/src/gui/views/tags.py @@ -45,7 +45,7 @@ from gen.ggettext import sgettext as _ from gen.lib import Tag from gen.db import DbTxn from gui.dbguielement import DbGUIElement -from ListModel import ListModel, NOSORT, COLOR, INTEGER +from gui.listmodel import ListModel, NOSORT, COLOR, INTEGER import const from gui.display import display_help from gui.dialog import ErrorDialog, QuestionDialog2 diff --git a/src/gui/widgets/tageditor.py b/src/gui/widgets/tageditor.py index 141b8fa9e..f262fe49e 100644 --- a/src/gui/widgets/tageditor.py +++ b/src/gui/widgets/tageditor.py @@ -37,7 +37,7 @@ from gen.ggettext import sgettext as _ from gui.managedwindow import ManagedWindow import const from gui.display import display_help -from ListModel import ListModel, TOGGLE +from gui.listmodel import ListModel, TOGGLE #------------------------------------------------------------------------- # diff --git a/src/plugins/BookReport.py b/src/plugins/BookReport.py index 9fd3c0d6c..dfd4fb8c4 100644 --- a/src/plugins/BookReport.py +++ b/src/plugins/BookReport.py @@ -69,7 +69,7 @@ import gobject #------------------------------------------------------------------------- import const import Utils -import ListModel +from gui.listmodel import ListModel import Errors from gui.pluginmanager import GuiPluginManager from gen.plug.docgen import StyleSheet, StyleSheetList, PaperStyle @@ -625,8 +625,8 @@ class BookListDisplay(object): title_label.set_text(Utils.title(_('Book List'))) title_label.set_use_markup(True) - self.blist = ListModel.ListModel(self.xml.get_object("list"), - [('Name',-1,10)],) + self.blist = ListModel(self.xml.get_object("list"), [('Name',-1,10)],) + self.redraw() self.selection = None self.top.run() @@ -785,8 +785,8 @@ class BookReportSelector(ManagedWindow): self.avail_nr_cols = len(avail_titles) self.book_nr_cols = len(book_titles) - self.avail_model = ListModel.ListModel(self.avail_tree, avail_titles) - self.book_model = ListModel.ListModel(self.book_tree, book_titles) + self.avail_model = ListModel(self.avail_tree, avail_titles) + self.book_model = ListModel(self.book_tree, book_titles) self.draw_avail_list() self.book = Book() diff --git a/src/plugins/gramplet/Attributes.py b/src/plugins/gramplet/Attributes.py index 7d734c607..7f98e4dc5 100644 --- a/src/plugins/gramplet/Attributes.py +++ b/src/plugins/gramplet/Attributes.py @@ -19,7 +19,7 @@ # $Id$ # -from ListModel import ListModel, NOSORT +from gui.listmodel import ListModel, NOSORT from gui.plug.quick import run_quick_report_by_name from gen.plug import Gramplet from gen.ggettext import gettext as _ diff --git a/src/plugins/gramplet/Backlinks.py b/src/plugins/gramplet/Backlinks.py index ab6c0afa4..d235e4872 100644 --- a/src/plugins/gramplet/Backlinks.py +++ b/src/plugins/gramplet/Backlinks.py @@ -20,7 +20,7 @@ # $Id$ # -from ListModel import ListModel, NOSORT +from gui.listmodel import ListModel, NOSORT from Utils import navigation_label from gen.plug import Gramplet from gen.ggettext import gettext as _ diff --git a/src/plugins/gramplet/Children.py b/src/plugins/gramplet/Children.py index 78f69495b..59a877c43 100644 --- a/src/plugins/gramplet/Children.py +++ b/src/plugins/gramplet/Children.py @@ -20,7 +20,7 @@ # from gui.editors import EditPerson -from ListModel import ListModel, NOSORT +from gui.listmodel import ListModel, NOSORT from gen.plug import Gramplet from gen.ggettext import gettext as _ from gen.display.name import displayer as name_displayer diff --git a/src/plugins/gramplet/Citations.py b/src/plugins/gramplet/Citations.py index af3c51660..f9a46026c 100644 --- a/src/plugins/gramplet/Citations.py +++ b/src/plugins/gramplet/Citations.py @@ -21,7 +21,7 @@ # from gui.editors import EditSource, EditCitation -from ListModel import ListModel, NOSORT +from gui.listmodel import ListModel, NOSORT from gen.plug import Gramplet from gen.ggettext import gettext as _ import Errors diff --git a/src/plugins/gramplet/Events.py b/src/plugins/gramplet/Events.py index ea4d37752..a9ae70e0e 100644 --- a/src/plugins/gramplet/Events.py +++ b/src/plugins/gramplet/Events.py @@ -20,7 +20,7 @@ # from gui.editors import EditEvent -from ListModel import ListModel, NOSORT +from gui.listmodel import ListModel, NOSORT from gen.plug import Gramplet from gen.ggettext import gettext as _ from gen.display.name import displayer as name_displayer diff --git a/src/plugins/gramplet/PersonResidence.py b/src/plugins/gramplet/PersonResidence.py index 0818316c7..71b8898c3 100644 --- a/src/plugins/gramplet/PersonResidence.py +++ b/src/plugins/gramplet/PersonResidence.py @@ -21,7 +21,7 @@ from gen.lib import EventType, EventRoleType from gui.editors import EditEvent -from ListModel import ListModel, NOSORT +from gui.listmodel import ListModel, NOSORT from gen.plug import Gramplet from gen.ggettext import gettext as _ import gen.datehandler diff --git a/src/plugins/lib/libmetadata.py b/src/plugins/lib/libmetadata.py index 75cd14689..61851f5c9 100644 --- a/src/plugins/lib/libmetadata.py +++ b/src/plugins/lib/libmetadata.py @@ -22,7 +22,7 @@ # $Id$ # -from ListModel import ListModel +from gui.listmodel import ListModel from gen.ggettext import gettext as _ from PlaceUtils import conv_lat_lon from fractions import Fraction diff --git a/src/plugins/tool/DumpGenderStats.py b/src/plugins/tool/DumpGenderStats.py index 1482ea743..9a3c8fcf7 100644 --- a/src/plugins/tool/DumpGenderStats.py +++ b/src/plugins/tool/DumpGenderStats.py @@ -28,7 +28,7 @@ """ from gen.ggettext import gettext as _ import gtk -import ListModel +from gui.listmodel import ListModel, INTEGER from gui.managedwindow import ManagedWindow from gui.plug import tool @@ -60,14 +60,14 @@ class DumpGenderStats(tool.Tool, ManagedWindow): if uistate: titles = [ (_('Name'),0,100), - (_('Male'),1,70,ListModel.INTEGER), - (_('Female'),2,70,ListModel.INTEGER), - (_('Unknown'),3,70,ListModel.INTEGER), + (_('Male'),1,70,INTEGER), + (_('Female'),2,70,INTEGER), + (_('Unknown'),3,70,INTEGER), (_('Guess'),4,70) ] treeview = gtk.TreeView() - model = ListModel.ListModel(treeview,titles) + model = ListModel(treeview,titles) for entry in stats_list: model.add(entry,entry[0]) diff --git a/src/plugins/tool/FindDupes.py b/src/plugins/tool/FindDupes.py index 88d7c7e60..f7f4b3fd9 100644 --- a/src/plugins/tool/FindDupes.py +++ b/src/plugins/tool/FindDupes.py @@ -43,7 +43,7 @@ from gui.plug import tool import soundex from gen.display.name import displayer as name_displayer from gui.dialog import OkDialog -import ListModel +from gui.listmodel import ListModel import Errors from gui.merge import MergePerson from gui.display import display_help @@ -559,8 +559,8 @@ class ShowMatches(ManagedWindow): (_('Second Person'),2,200), ('',-1,0) ] - self.list = ListModel.ListModel(self.mlist,mtitles, - event_func=self.on_do_merge_clicked) + self.list = ListModel(self.mlist,mtitles, + event_func=self.on_do_merge_clicked) self.redraw() self.show()