def define_actions(self): """ Required define_actions function for PageView. Builds the action group information required. We extend beyond the normal here, since we want to have more than one action group for the PersonView. Most PageViews really won't care about this. """ NavigationView.define_actions(self) self.edit_action = gtk.ActionGroup(self.title + '/ChangeOrder') self.edit_action.add_actions([ ('Add', gtk.STOCK_ADD, _("_Add..."), "<control>Insert", self.ADD_MSG, self.add), ('Remove', gtk.STOCK_REMOVE, _("_Remove"), "<control>Delete", self.DEL_MSG, self.remove), ('Merge', 'gramps-merge', _('_Merge...'), None, self.MERGE_MSG, self.merge), ('ExportTab', None, _('Export View...'), None, None, self.export), ]) self._add_action_group(self.edit_action) self._add_action('Edit', gtk.STOCK_EDIT, _("action|_Edit..."), accel="<control>Return", tip=self.EDIT_MSG, callback=self.edit)
def define_actions(self): """ Required define_actions function for NavigationView. Builds the action group information required. """ NavigationView.define_actions(self) HtmlView._define_actions_fw_bw(self)
def change_page(self): """ Called when a page is changed. """ NavigationView.change_page(self) if self.model: self.uistate.show_filter_results(self.dbstate, self.model.displayed(), self.model.total()) self.edit_action.set_visible(True) self.edit_action.set_sensitive(not self.dbstate.db.readonly)
def __init__(self, title, pdata, dbstate, uistate, get_bookmarks, bm_type, nav_group): NavigationView.__init__(self, title, pdata, dbstate, uistate, get_bookmarks, bm_type, nav_group) self.dbstate = dbstate self.dbstate.connect('database-changed', self.change_db) self.default_text = "Enter location here!" self.centerlon = config.get("geography.center-lon") self.centerlat = config.get("geography.center-lat") self.zoom = config.get("geography.zoom") self.lock = config.get("geography.lock") if config.get('geography.path') == "": config.set('geography.path', GEOGRAPHY_PATH) osmGpsMap.__init__(self) self.format_helper = FormattingHelper(self.dbstate) self.centerlat = self.centerlon = 0.0 self.cross_map = None self.current_map = None self.without = 0 self.place_list = [] self.places_found = [] self.select_fct = None self.geo_mainmap = gtk.gdk.pixbuf_new_from_file_at_size( os.path.join(const.ROOT_DIR, "images", "22x22", ('gramps-geo-mainmap' + '.png')), 22, 22) self.geo_altmap = gtk.gdk.pixbuf_new_from_file_at_size( os.path.join(const.ROOT_DIR, "images", "22x22", ('gramps-geo-altmap' + '.png')), 22, 22) if (config.get('geography.map_service') in (constants.OPENSTREETMAP, constants.OPENSTREETMAP_RENDERER)): default_image = self.geo_mainmap else: default_image = self.geo_altmap self.geo_othermap = {} for id in (gen.lib.EventType.BIRTH, gen.lib.EventType.DEATH, gen.lib.EventType.MARRIAGE): self.geo_othermap[id] = gtk.gdk.pixbuf_new_from_file_at_size( os.path.join( const.ROOT_DIR, "images", "22x22", (constants.ICONS.get(int(id), default_image) + '.png')), 22, 22)
def __init__(self, pdata, dbstate, uistate, title=_('HtmlView')): NavigationView.__init__(self, title, pdata, dbstate, uistate, dbstate.db.get_bookmarks(), Bookmarks.PersonBookmarks, nav_group=0) self.dbstate = dbstate self.back_action = None self.forward_action = None self.renderer = None self.urlfield = "" self.htmlfile = "" self.filter = gtk.HBox() self.table = "" self.browser = NOWEB self.bootstrap_handler = None self.box = None self.toolkit = None self.additional_uis.append(self.additional_ui())
def __init__(self, title, pdata, dbstate, uistate, columns, handle_col, make_model, signal_map, get_bookmarks, bm_type, nav_group, multiple=False, filter_class=None, markup=None): NavigationView.__init__(self, title, pdata, dbstate, uistate, get_bookmarks, bm_type, nav_group) #default is listviews keep themself in sync with database self._dirty_on_change_inactive = False self.filter_class = filter_class self.renderer = gtk.CellRendererText() self.renderer.set_property('ellipsize', pango.ELLIPSIZE_END) self.sort_col = 0 self.sort_order = gtk.SORT_ASCENDING self.columns = [] self.colinfo = columns self.handle_col = handle_col self.make_model = make_model self.model = None self.signal_map = signal_map self.multiple_selection = multiple self.generic_filter = None self.markup_columns = markup or [] dbstate.connect('database-changed', self.change_db) self.connect_signals()
def on_delete(self): """ Save all modified environment """ NavigationView.on_delete(self) self._config.save()
def change_page(self): """Called when the page changes.""" NavigationView.change_page(self) self.uistate.clear_filter_results() self.end_selection = None
def set_active(self): NavigationView.set_active(self) self.uistate.show_filter_results(self.dbstate, self.model.displayed(), self.model.total())