diff --git a/src/DataViews/EventView.py b/src/DataViews/EventView.py index 1b510941a..087c03aa9 100644 --- a/src/DataViews/EventView.py +++ b/src/DataViews/EventView.py @@ -37,7 +37,7 @@ import gtk # #------------------------------------------------------------------------- import gen.lib -import PageView +from gui.views.listview import ListView import DisplayModels import Utils import Errors @@ -61,7 +61,7 @@ from gettext import gettext as _ # EventView # #------------------------------------------------------------------------- -class EventView(PageView.ListView): +class EventView(ListView): """ EventView class, derived from the ListView """ @@ -85,7 +85,6 @@ class EventView(PageView.ListView): """ Create the Event View """ - signal_map = { 'event-add' : self.row_add, 'event-update' : self.row_update, @@ -93,12 +92,7 @@ class EventView(PageView.ListView): 'event-rebuild' : self.object_build, } - self.func_list = { - 'J' : self.jump, - 'BackSpace' : self.key_delete, - } - - PageView.ListView.__init__( + ListView.__init__( self, _('Events'), dbstate, uistate, EventView.COLUMN_NAMES, len(EventView.COLUMN_NAMES), DisplayModels.EventModel, @@ -106,6 +100,11 @@ class EventView(PageView.ListView): Bookmarks.EventBookmarks, multiple=True, filter_class=EventSidebarFilter) + + self.func_list = { + 'J' : self.jump, + 'BackSpace' : self.key_delete, + } Config.client.notify_add("/apps/gramps/interface/filter", self.filter_toggle) @@ -183,7 +182,7 @@ class EventView(PageView.ListView): ''' def define_actions(self): - PageView.ListView.define_actions(self) + ListView.define_actions(self) self._add_action('FilterEdit', None, _('Event Filter Editor'), callback=self.filter_editor,) self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES, diff --git a/src/DataViews/FamilyList.py b/src/DataViews/FamilyList.py index 47fcf6a29..f1b1d6fab 100644 --- a/src/DataViews/FamilyList.py +++ b/src/DataViews/FamilyList.py @@ -43,7 +43,7 @@ import gtk # #------------------------------------------------------------------------- import gen.lib -import PageView +from gui.views.listview import ListView import DisplayModels import Bookmarks import Errors @@ -56,7 +56,7 @@ from ReportBase import CATEGORY_QR_FAMILY # FamilyListView # #------------------------------------------------------------------------- -class FamilyListView(PageView.ListView): +class FamilyListView(ListView): COLUMN_NAMES = [ _('ID'), @@ -82,18 +82,18 @@ class FamilyListView(PageView.ListView): 'family-rebuild' : self.object_build, } - self.func_list = { - 'J' : self.jump, - 'BackSpace' : self.key_delete, - } - - PageView.ListView.__init__( + ListView.__init__( self, _('Families'), dbstate, uistate, FamilyListView.COLUMN_NAMES, len(FamilyListView.COLUMN_NAMES), DisplayModels.FamilyModel, signal_map, dbstate.db.get_family_bookmarks(), Bookmarks.FamilyBookmarks, filter_class=FamilySidebarFilter) + self.func_list = { + 'J' : self.jump, + 'BackSpace' : self.key_delete, + } + Config.client.notify_add("/apps/gramps/interface/filter", self.filter_toggle) @@ -161,7 +161,7 @@ class FamilyListView(PageView.ListView): def define_actions(self): """Add the Forward action group to handle the Forward button.""" - PageView.ListView.define_actions(self) + ListView.define_actions(self) self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor...'), callback=self._column_editor) diff --git a/src/DataViews/GeoView.py b/src/DataViews/GeoView.py index 5723f6fa2..838829ef5 100644 --- a/src/DataViews/GeoView.py +++ b/src/DataViews/GeoView.py @@ -61,6 +61,7 @@ from gui.utils import add_menuitem from ReportBase import CSS_FILES from BasicUtils import name_displayer as _nd from PlaceUtils import conv_lat_lon +from gui.views.pageview import PageView #------------------------------------------------------------------------- # @@ -487,7 +488,7 @@ class GeoView(HtmlView): ]) self._add_action_group(self.lock_action) self._add_action('AllPlacesMaps', gtk.STOCK_HOME, _('_All Places'), - callback=self._all_places, tip=_("Attempt to view all places in " + callback=self._all_places, tip=_("Attempt to view all places in " "the family tree.")) self._add_action('PersonMaps', 'gramps-person', _('_Person'), callback=self._person_places, @@ -514,7 +515,7 @@ class GeoView(HtmlView): 4. set icon and label of the menutoolbutton now that it is realized 5. store label so it can be changed when selection changes """ - PageView.PageView.change_page(self) + PageView.change_page(self) # menutoolbutton actions are stored in PageView class, # obtain the widgets where we need to add to menu actionstyles = self.action_toolmenu['StyleSheet'] diff --git a/src/DataViews/GrampletView.py b/src/DataViews/GrampletView.py index 80e9dea84..e98addcbf 100644 --- a/src/DataViews/GrampletView.py +++ b/src/DataViews/GrampletView.py @@ -46,7 +46,7 @@ from gettext import gettext as _ #------------------------------------------------------------------------- import Errors import const -import PageView +from gui.views.pageview import PageView import ManagedWindow import ConfigParser from gui.utils import add_menuitem @@ -1081,7 +1081,7 @@ class MyScrolledWindow(gtk.ScrolledWindow): if gramplet.state == "minimized": gramplet.set_state("minimized") -class GrampletView(PageView.PersonNavView): +class GrampletView(PageView): """ GrampletView interface """ @@ -1090,7 +1090,7 @@ class GrampletView(PageView.PersonNavView): """ Create a GrampletView, with the current dbstate and uistate """ - PageView.PersonNavView.__init__(self, _('Gramplets'), dbstate, uistate) + PageView.__init__(self, _('Gramplets'), dbstate, uistate) self._popup_xy = None def build_widget(self): @@ -1377,47 +1377,6 @@ class GrampletView(PageView.PersonNavView): lambda obj:self.set_columns(3)), ]) self._add_action_group(self.action) - # Back, Forward, Home - self.fwd_action = gtk.ActionGroup(self.title + '/Forward') - self.fwd_action.add_actions([ - ('Forward', gtk.STOCK_GO_FORWARD, _("_Forward"), - "Right", _("Go to the next person in the history"), - self.fwd_clicked) - ]) - - # add the Backward action group to handle the Forward button - self.back_action = gtk.ActionGroup(self.title + '/Backward') - self.back_action.add_actions([ - ('Back', gtk.STOCK_GO_BACK, _("_Back"), - "Left", _("Go to the previous person in the history"), - self.back_clicked) - ]) - self._add_action('HomePerson', gtk.STOCK_HOME, _("_Home"), - accel="Home", - tip=_("Go to the default person"), callback=self.home) - self.other_action = gtk.ActionGroup(self.title + '/PersonOther') - self.other_action.add_actions([ - ('SetActive', gtk.STOCK_HOME, _("Set _Home Person"), None, - None, self.set_default_person), - ]) - self._add_action_group(self.back_action) - self._add_action_group(self.fwd_action) - self._add_action_group(self.other_action) - - def set_active(self): - PageView.PersonNavView.set_active(self) - self.key_active_changed = self.dbstate.connect('active-changed', - self.goto_active_person) - - def set_inactive(self): - PageView.PersonNavView.set_inactive(self) - self.dbstate.disconnect(self.key_active_changed) - - def goto_active_person(self, handle=None): - self.dirty = True - if handle: - self.handle_history(handle) - self.uistate.modify_statusbar(self.dbstate) def set_columns(self, num): # clear the gramplets: @@ -1535,28 +1494,12 @@ class GrampletView(PageView.PersonNavView): return """ - - - - - - - - - - - - - - - - diff --git a/src/DataViews/HtmlRenderer.py b/src/DataViews/HtmlRenderer.py index 5c52bb6ee..2aaab4573 100644 --- a/src/DataViews/HtmlRenderer.py +++ b/src/DataViews/HtmlRenderer.py @@ -49,7 +49,7 @@ import gtk # Gramps Modules # #------------------------------------------------------------------------- -import PageView +from gui.views.pageview import PageView import Utils import Config from const import TEMP_DIR @@ -414,14 +414,14 @@ class RendererMozilla(Renderer): # HtmlView # #------------------------------------------------------------------------- -class HtmlView(PageView.PageView): +class HtmlView(PageView): """ HtmlView is a view showing a top widget with controls, and a bottom part with an embedded webbrowser showing a given URL """ def __init__(self, dbstate, uistate, title=_('HtmlView')): - PageView.PageView.__init__(self, title, dbstate, uistate) + PageView.__init__(self, title, dbstate, uistate) self.dbstate = dbstate self.back_action = None self.forward_action = None diff --git a/src/DataViews/MediaView.py b/src/DataViews/MediaView.py index 0971ddacc..ba1631d11 100644 --- a/src/DataViews/MediaView.py +++ b/src/DataViews/MediaView.py @@ -47,7 +47,7 @@ import gtk # #------------------------------------------------------------------------- from gui.utils import open_file_with_default_application -import PageView +from gui.views.listview import ListView import DisplayModels import ThumbNails import const @@ -67,7 +67,7 @@ from DdTargets import DdTargets # MediaView # #------------------------------------------------------------------------- -class MediaView(PageView.ListView): +class MediaView(ListView): """ Provide the Media View interface on the GRAMPS main window. This allows people to manage all media items in their database. This is very similar @@ -101,7 +101,7 @@ class MediaView(PageView.ListView): 'media-rebuild' : self.object_build, } - PageView.ListView.__init__( + ListView.__init__( self, _('Media'), dbstate, uistate, MediaView.COLUMN_NAMES, len(MediaView.COLUMN_NAMES), DisplayModels.MediaModel, @@ -212,7 +212,7 @@ class MediaView(PageView.ListView): sure that the common List View actions are defined as well, so we call the parent function. """ - PageView.ListView.define_actions(self) + ListView.define_actions(self) self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor'), callback=self._column_editor) @@ -260,7 +260,7 @@ class MediaView(PageView.ListView): """ Builds the View from GTK components """ - base = PageView.ListView.build_widget(self) + base = ListView.build_widget(self) vbox = gtk.VBox() vbox.set_border_width(0) vbox.set_spacing(4) @@ -296,7 +296,7 @@ class MediaView(PageView.ListView): handle the normal operation, then call row_change to make sure that the thumbnail is updated properly if needed. """ - PageView.ListView.row_update(self, obj) + ListView.row_update(self, obj) if self.active: self.row_change(obj) diff --git a/src/DataViews/NoteView.py b/src/DataViews/NoteView.py index 78ffc6996..a833f6525 100644 --- a/src/DataViews/NoteView.py +++ b/src/DataViews/NoteView.py @@ -36,7 +36,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import PageView +from gui.views.listview import ListView import DisplayModels import Utils import Errors @@ -61,7 +61,7 @@ from gettext import gettext as _ # NoteView # #------------------------------------------------------------------------- -class NoteView(PageView.ListView): +class NoteView(ListView): COLUMN_NAMES = [ _('Preview'), @@ -89,7 +89,7 @@ class NoteView(PageView.ListView): 'BackSpace' : self.key_delete, } - PageView.ListView.__init__( + ListView.__init__( self, _('Notes'), dbstate, uistate, NoteView.COLUMN_NAMES, len(NoteView.COLUMN_NAMES), DisplayModels.NoteModel, signal_map, dbstate.db.get_note_bookmarks(), @@ -169,7 +169,7 @@ class NoteView(PageView.ListView): ''' def define_actions(self): - PageView.ListView.define_actions(self) + ListView.define_actions(self) self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor'), callback=self._column_editor) self._add_action('FilterEdit', None, _('Note Filter Editor'), diff --git a/src/DataViews/RepositoryView.py b/src/DataViews/RepositoryView.py index 07ade8ac3..9349e5710 100644 --- a/src/DataViews/RepositoryView.py +++ b/src/DataViews/RepositoryView.py @@ -37,7 +37,7 @@ import gtk # #------------------------------------------------------------------------- import gen.lib -import PageView +from gui.views.listview import ListView import DisplayModels import Utils import Bookmarks @@ -61,7 +61,7 @@ from gettext import gettext as _ # RepositoryView # #------------------------------------------------------------------------- -class RepositoryView(PageView.ListView): +class RepositoryView(ListView): COLUMN_NAMES = [ _('Name'), @@ -99,7 +99,7 @@ class RepositoryView(PageView.ListView): 'BackSpace' : self.key_delete, } - PageView.ListView.__init__( + ListView.__init__( self, _('Repositories'), dbstate, uistate, RepositoryView.COLUMN_NAMES, len(RepositoryView.COLUMN_NAMES), DisplayModels.RepositoryModel, signal_map, @@ -120,7 +120,7 @@ class RepositoryView(PageView.ListView): return DdTargets.REPO_LINK def define_actions(self): - PageView.ListView.define_actions(self) + ListView.define_actions(self) self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor'), callback=self._column_editor) self._add_action('FilterEdit', None, _('Repository Filter Editor'), diff --git a/src/DataViews/SourceView.py b/src/DataViews/SourceView.py index 8355adffd..239ee63f5 100644 --- a/src/DataViews/SourceView.py +++ b/src/DataViews/SourceView.py @@ -38,7 +38,7 @@ import gtk #------------------------------------------------------------------------- import gen.lib import Config -import PageView +from gui.views.listview import ListView import DisplayModels import Utils import Bookmarks @@ -61,7 +61,7 @@ from gettext import gettext as _ # SourceView # #------------------------------------------------------------------------- -class SourceView(PageView.ListView): +class SourceView(ListView): COLUMN_NAMES = [ _('Title'), @@ -91,7 +91,7 @@ class SourceView(PageView.ListView): 'BackSpace' : self.key_delete, } - PageView.ListView.__init__( + ListView.__init__( self, _('Sources'), dbstate, uistate, SourceView.COLUMN_NAMES, len(SourceView.COLUMN_NAMES), DisplayModels.SourceModel, signal_map, @@ -112,7 +112,7 @@ class SourceView(PageView.ListView): return DdTargets.SOURCE_LINK def define_actions(self): - PageView.ListView.define_actions(self) + ListView.define_actions(self) self._add_action('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor'), callback=self._column_editor) self._add_action('FastMerge', None, _('_Merge'), diff --git a/src/gui/views/listview.py b/src/gui/views/listview.py index 970974631..ef8daf28b 100644 --- a/src/gui/views/listview.py +++ b/src/gui/views/listview.py @@ -530,7 +530,7 @@ class ListView(NavigationView): search = (False, self.search_bar.get_value()) # TODO: This line is needed but gives a warning - self.list.set_model(None) + #self.list.set_model(None) if same_col: self.model.reverse_order() @@ -587,15 +587,15 @@ class ListView(NavigationView): selected_ids = self.selected_handles() if len(selected_ids) > 0: self.change_active(selected_ids[0]) - - if len(selected_ids) == 1: - self.list.drag_source_set(gtk.gdk.BUTTON1_MASK, + if self.drag_info(): + if len(selected_ids) == 1: + self.list.drag_source_set(gtk.gdk.BUTTON1_MASK, [self.drag_info().target()], gtk.gdk.ACTION_COPY) - # TODO: This needs putting back again - #elif len(selected_ids) > 1: - #self.list.drag_source_set(gtk.gdk.BUTTON1_MASK, + # TODO: This needs putting back again + #elif len(selected_ids) > 1: + #self.list.drag_source_set(gtk.gdk.BUTTON1_MASK, #[DdTargets.PERSON_LINK_LIST.target()], #gtk.gdk.ACTION_COPY) self.uistate.modify_statusbar(self.dbstate)