GEPS008: Moved ListModel module

svn: r19774
This commit is contained in:
Nick Hall 2012-06-06 16:59:43 +00:00
parent 6a15f8fd18
commit a41b175b09
21 changed files with 36 additions and 36 deletions

View File

@ -7,7 +7,6 @@
src/AutoComp.py src/AutoComp.py
src/Errors.py src/Errors.py
src/ImgManip.py src/ImgManip.py
src/ListModel.py
src/RecentFiles.py src/RecentFiles.py
src/Sort.py src/Sort.py
src/soundex.py src/soundex.py
@ -230,6 +229,7 @@ src/gui/dbguielement.py
src/gui/ddtargets.py src/gui/ddtargets.py
src/gui/display.py src/gui/display.py
src/gui/glade.py src/gui/glade.py
src/gui/listmodel.py
src/gui/managedwindow.py src/gui/managedwindow.py
src/gui/navigator.py src/gui/navigator.py
src/gui/pluginmanager.py src/gui/pluginmanager.py

View File

@ -52,7 +52,7 @@ import gtk
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gui.display import display_help from gui.display import display_help
import ListModel from gui.listmodel import ListModel
import Utils import Utils
import const import const
from gen.ggettext import sgettext as _ from gen.ggettext import sgettext as _
@ -212,7 +212,7 @@ class Bookmarks :
name_titles = [(_('Name'), -1, 200), (_('ID'), -1, 50), ('', -1, 0)] name_titles = [(_('Name'), -1, 200), (_('ID'), -1, 50), ('', -1, 0)]
self.namelist = gtk.TreeView() 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) self.namemodel_cols = len(name_titles)
slist = gtk.ScrolledWindow() slist = gtk.ScrolledWindow()

View File

@ -26,7 +26,6 @@ gdir_PYTHON = \
gramps.py\ gramps.py\
ImgManip.py\ ImgManip.py\
LdsUtils.py \ LdsUtils.py \
ListModel.py\
Lru.py\ Lru.py\
MacTransUtils.py\ MacTransUtils.py\
RecentFiles.py\ RecentFiles.py\

View File

@ -33,7 +33,7 @@ from gen.ggettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gen.db import DbTxn from gen.db import DbTxn
from gen.display.name import displayer as name_displayer from gen.display.name import displayer as name_displayer
import ListModel from gui.listmodel import ListModel
from gui.managedwindow import ManagedWindow from gui.managedwindow import ManagedWindow
from gui.glade import Glade from gui.glade import Glade
@ -59,10 +59,10 @@ class Reorder(ManagedWindow):
self.set_window(top, None, _("Reorder Relationships")) self.set_window(top, None, _("Reorder Relationships"))
self.ptree = xml.get_object('ptree') 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.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('ok').connect('clicked', self.ok_clicked)
xml.get_object('cancel').connect('clicked', self.cancel_clicked) xml.get_object('cancel').connect('clicked', self.cancel_clicked)

View File

@ -35,6 +35,7 @@ pkgpython_PYTHON = \
glade.py \ glade.py \
grampsbar.py \ grampsbar.py \
grampsgui.py \ grampsgui.py \
listmodel.py \
makefilter.py \ makefilter.py \
managedwindow.py \ managedwindow.py \
navigator.py \ navigator.py \

View File

@ -56,7 +56,7 @@ import gobject
from gen.filters import (GenericFilterFactory, FilterList, from gen.filters import (GenericFilterFactory, FilterList,
reload_custom_filters) reload_custom_filters)
from gen.filters.rules._matchesfilterbase import MatchesFilterBase from gen.filters.rules._matchesfilterbase import MatchesFilterBase
import ListModel from gui.listmodel import ListModel
from gui.managedwindow import ManagedWindow from gui.managedwindow import ManagedWindow
from gui.dialog import QuestionDialog from gui.dialog import QuestionDialog
import const import const
@ -737,7 +737,7 @@ class EditFilter(ManagedWindow):
self.get_widget('definition_title'), self.get_widget('definition_title'),
_('Define filter')) _('Define filter'))
self.rlist = ListModel.ListModel( self.rlist = ListModel(
self.get_widget('rule_list'), self.get_widget('rule_list'),
[(_('Name'),-1,150),(_('Values'),-1,150)], [(_('Name'),-1,150),(_('Values'),-1,150)],
self.select_row, self.select_row,
@ -1020,7 +1020,7 @@ class FilterEditor(ManagedWindow):
self.uistate.connect('filter-name-changed', self.clean_after_rename) self.uistate.connect('filter-name-changed', self.clean_after_rename)
self.clist = ListModel.ListModel( self.clist = ListModel(
self.filter_list, self.filter_list,
[(_('Filter'), 0, 150), (_('Comment'), 1, 150)], [(_('Filter'), 0, 150), (_('Comment'), 1, 150)],
self.filter_select_row, self.filter_select_row,

View File

@ -54,7 +54,7 @@ import const
from gen.plug.docgen import (StyleSheet, FONT_SERIF, FONT_SANS_SERIF, from gen.plug.docgen import (StyleSheet, FONT_SERIF, FONT_SANS_SERIF,
PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT, PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT,
PARA_ALIGN_JUSTIFY) PARA_ALIGN_JUSTIFY)
import ListModel from gui.listmodel import ListModel
from gui.managedwindow import ManagedWindow from gui.managedwindow import ManagedWindow
from gui.glade import Glade from gui.glade import Glade
@ -102,7 +102,7 @@ class StyleListDisplay(object):
title_label.set_text(Utils.title(_('Style Editor'))) title_label.set_text(Utils.title(_('Style Editor')))
title_label.set_use_markup(True) 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)], ) [(_('Style'), -1, 10)], )
self.redraw() self.redraw()
if parent_window: if parent_window:
@ -217,7 +217,7 @@ class StyleEditor(object):
self.top.get_object("label6").set_text(_("point size|pt")) self.top.get_object("label6").set_text(_("point size|pt"))
titles = [(_('Paragraph'), 0, 130)] 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.change_display)
self.top.get_object('color').connect('color-set', self.fg_color_set) self.top.get_object('color').connect('color-set', self.fg_color_set)

View File

@ -444,7 +444,7 @@ class ViewManager(CLIManager):
def update_addons(self, addon_update_list): def update_addons(self, addon_update_list):
from gui.glade import Glade from gui.glade import Glade
from gui.managedwindow import ManagedWindow from gui.managedwindow import ManagedWindow
from ListModel import ListModel, NOSORT, TOGGLE from gui.listmodel import ListModel, NOSORT, TOGGLE
glade = Glade("updateaddons.glade") glade = Glade("updateaddons.glade")
self.update_dialog = glade.toplevel self.update_dialog = glade.toplevel
ManagedWindow.set_titles(self.update_dialog, ManagedWindow.set_titles(self.update_dialog,

View File

@ -45,7 +45,7 @@ from gen.ggettext import sgettext as _
from gen.lib import Tag from gen.lib import Tag
from gen.db import DbTxn from gen.db import DbTxn
from gui.dbguielement import DbGUIElement from gui.dbguielement import DbGUIElement
from ListModel import ListModel, NOSORT, COLOR, INTEGER from gui.listmodel import ListModel, NOSORT, COLOR, INTEGER
import const import const
from gui.display import display_help from gui.display import display_help
from gui.dialog import ErrorDialog, QuestionDialog2 from gui.dialog import ErrorDialog, QuestionDialog2

View File

@ -37,7 +37,7 @@ from gen.ggettext import sgettext as _
from gui.managedwindow import ManagedWindow from gui.managedwindow import ManagedWindow
import const import const
from gui.display import display_help from gui.display import display_help
from ListModel import ListModel, TOGGLE from gui.listmodel import ListModel, TOGGLE
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -69,7 +69,7 @@ import gobject
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import const import const
import Utils import Utils
import ListModel from gui.listmodel import ListModel
import Errors import Errors
from gui.pluginmanager import GuiPluginManager from gui.pluginmanager import GuiPluginManager
from gen.plug.docgen import StyleSheet, StyleSheetList, PaperStyle 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_text(Utils.title(_('Book List')))
title_label.set_use_markup(True) title_label.set_use_markup(True)
self.blist = ListModel.ListModel(self.xml.get_object("list"), self.blist = ListModel(self.xml.get_object("list"), [('Name',-1,10)],)
[('Name',-1,10)],)
self.redraw() self.redraw()
self.selection = None self.selection = None
self.top.run() self.top.run()
@ -785,8 +785,8 @@ class BookReportSelector(ManagedWindow):
self.avail_nr_cols = len(avail_titles) self.avail_nr_cols = len(avail_titles)
self.book_nr_cols = len(book_titles) self.book_nr_cols = len(book_titles)
self.avail_model = ListModel.ListModel(self.avail_tree, avail_titles) self.avail_model = ListModel(self.avail_tree, avail_titles)
self.book_model = ListModel.ListModel(self.book_tree, book_titles) self.book_model = ListModel(self.book_tree, book_titles)
self.draw_avail_list() self.draw_avail_list()
self.book = Book() self.book = Book()

View File

@ -19,7 +19,7 @@
# $Id$ # $Id$
# #
from ListModel import ListModel, NOSORT from gui.listmodel import ListModel, NOSORT
from gui.plug.quick import run_quick_report_by_name from gui.plug.quick import run_quick_report_by_name
from gen.plug import Gramplet from gen.plug import Gramplet
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _

View File

@ -20,7 +20,7 @@
# $Id$ # $Id$
# #
from ListModel import ListModel, NOSORT from gui.listmodel import ListModel, NOSORT
from Utils import navigation_label from Utils import navigation_label
from gen.plug import Gramplet from gen.plug import Gramplet
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _

View File

@ -20,7 +20,7 @@
# #
from gui.editors import EditPerson from gui.editors import EditPerson
from ListModel import ListModel, NOSORT from gui.listmodel import ListModel, NOSORT
from gen.plug import Gramplet from gen.plug import Gramplet
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
from gen.display.name import displayer as name_displayer from gen.display.name import displayer as name_displayer

View File

@ -21,7 +21,7 @@
# #
from gui.editors import EditSource, EditCitation from gui.editors import EditSource, EditCitation
from ListModel import ListModel, NOSORT from gui.listmodel import ListModel, NOSORT
from gen.plug import Gramplet from gen.plug import Gramplet
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
import Errors import Errors

View File

@ -20,7 +20,7 @@
# #
from gui.editors import EditEvent from gui.editors import EditEvent
from ListModel import ListModel, NOSORT from gui.listmodel import ListModel, NOSORT
from gen.plug import Gramplet from gen.plug import Gramplet
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
from gen.display.name import displayer as name_displayer from gen.display.name import displayer as name_displayer

View File

@ -21,7 +21,7 @@
from gen.lib import EventType, EventRoleType from gen.lib import EventType, EventRoleType
from gui.editors import EditEvent from gui.editors import EditEvent
from ListModel import ListModel, NOSORT from gui.listmodel import ListModel, NOSORT
from gen.plug import Gramplet from gen.plug import Gramplet
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
import gen.datehandler import gen.datehandler

View File

@ -22,7 +22,7 @@
# $Id$ # $Id$
# #
from ListModel import ListModel from gui.listmodel import ListModel
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
from PlaceUtils import conv_lat_lon from PlaceUtils import conv_lat_lon
from fractions import Fraction from fractions import Fraction

View File

@ -28,7 +28,7 @@
""" """
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
import gtk import gtk
import ListModel from gui.listmodel import ListModel, INTEGER
from gui.managedwindow import ManagedWindow from gui.managedwindow import ManagedWindow
from gui.plug import tool from gui.plug import tool
@ -60,14 +60,14 @@ class DumpGenderStats(tool.Tool, ManagedWindow):
if uistate: if uistate:
titles = [ titles = [
(_('Name'),0,100), (_('Name'),0,100),
(_('Male'),1,70,ListModel.INTEGER), (_('Male'),1,70,INTEGER),
(_('Female'),2,70,ListModel.INTEGER), (_('Female'),2,70,INTEGER),
(_('Unknown'),3,70,ListModel.INTEGER), (_('Unknown'),3,70,INTEGER),
(_('Guess'),4,70) (_('Guess'),4,70)
] ]
treeview = gtk.TreeView() treeview = gtk.TreeView()
model = ListModel.ListModel(treeview,titles) model = ListModel(treeview,titles)
for entry in stats_list: for entry in stats_list:
model.add(entry,entry[0]) model.add(entry,entry[0])

View File

@ -43,7 +43,7 @@ from gui.plug import tool
import soundex import soundex
from gen.display.name import displayer as name_displayer from gen.display.name import displayer as name_displayer
from gui.dialog import OkDialog from gui.dialog import OkDialog
import ListModel from gui.listmodel import ListModel
import Errors import Errors
from gui.merge import MergePerson from gui.merge import MergePerson
from gui.display import display_help from gui.display import display_help
@ -559,8 +559,8 @@ class ShowMatches(ManagedWindow):
(_('Second Person'),2,200), (_('Second Person'),2,200),
('',-1,0) ('',-1,0)
] ]
self.list = ListModel.ListModel(self.mlist,mtitles, self.list = ListModel(self.mlist,mtitles,
event_func=self.on_do_merge_clicked) event_func=self.on_do_merge_clicked)
self.redraw() self.redraw()
self.show() self.show()