3631: Cannot start Gramps without any view loaded (OK, it is stupid...)
svn: r14517
This commit is contained in:
parent
644d0ac540
commit
d91cbd91bf
@ -960,12 +960,21 @@ class ViewManager(CLIManager):
|
|||||||
uitoolitems)
|
uitoolitems)
|
||||||
#set view cat to last used in this category
|
#set view cat to last used in this category
|
||||||
self.notebook_cat[-1].set_current_page(default_cat_views[indexcat])
|
self.notebook_cat[-1].set_current_page(default_cat_views[indexcat])
|
||||||
|
|
||||||
|
if self.views:
|
||||||
|
self.active_page = self.pages[current_cat][current_cat_view]
|
||||||
|
self.buttons[current_cat].set_active(True)
|
||||||
|
self.active_page.set_active()
|
||||||
|
self.notebook.set_current_page(current_cat)
|
||||||
|
self.notebook_cat[current_cat].set_current_page(current_cat_view)
|
||||||
|
else:
|
||||||
|
#not one single view loaded
|
||||||
|
WarningDialog(
|
||||||
|
_("No views loaded"),
|
||||||
|
_("No view plugins plugins are loaded. Go to Help->Plugin "
|
||||||
|
"Manager, and make sure some plugins of type 'View' are "
|
||||||
|
"enabled. Then restart Gramps"))
|
||||||
|
|
||||||
self.active_page = self.pages[current_cat][current_cat_view]
|
|
||||||
self.buttons[current_cat].set_active(True)
|
|
||||||
self.active_page.set_active()
|
|
||||||
self.notebook.set_current_page(current_cat)
|
|
||||||
self.notebook_cat[current_cat].set_current_page(current_cat_view)
|
|
||||||
|
|
||||||
def __views_to_show(self, use_last = True):
|
def __views_to_show(self, use_last = True):
|
||||||
"""
|
"""
|
||||||
@ -1159,36 +1168,40 @@ class ViewManager(CLIManager):
|
|||||||
:Type view_page: integer >=0 to switch to a specific page, or -1 to
|
:Type view_page: integer >=0 to switch to a specific page, or -1 to
|
||||||
switch to the active view in the category
|
switch to the active view in the category
|
||||||
"""
|
"""
|
||||||
if view_page == -1:
|
if self.notebook_cat:
|
||||||
#just show active one
|
if view_page == -1:
|
||||||
view_page = self.notebook_cat[category_page].get_current_page()
|
#just show active one
|
||||||
if self.dbstate.open:
|
view_page = self.notebook_cat[category_page].get_current_page()
|
||||||
self.__disconnect_previous_page()
|
if self.dbstate.open:
|
||||||
if len(self.pages) > 0:
|
self.__disconnect_previous_page()
|
||||||
self.active_page = self.pages[category_page][view_page]
|
if len(self.pages) > 0:
|
||||||
self.active_page.set_active()
|
self.active_page = self.pages[category_page][view_page]
|
||||||
newcurpageid = self.views[category_page][view_page][0].id
|
self.active_page.set_active()
|
||||||
config.set('preferences.last-view', newcurpageid)
|
newcurpageid = self.views[category_page][view_page][0].id
|
||||||
olddefaults = config.get('preferences.last-views')
|
config.set('preferences.last-view', newcurpageid)
|
||||||
if len(olddefaults) != len(self.pages):
|
olddefaults = config.get('preferences.last-views')
|
||||||
#number views changed, we cannot trust the old
|
if len(olddefaults) != len(self.pages):
|
||||||
olddefaults = [''] * len(self.pages)
|
#number views changed, we cannot trust the old
|
||||||
olddefaults[category_page] = newcurpageid
|
olddefaults = [''] * len(self.pages)
|
||||||
config.set('preferences.last-views', olddefaults)
|
olddefaults[category_page] = newcurpageid
|
||||||
config.save()
|
config.set('preferences.last-views', olddefaults)
|
||||||
|
config.save()
|
||||||
|
|
||||||
self.__connect_active_page(category_page, view_page)
|
self.__connect_active_page(category_page, view_page)
|
||||||
|
|
||||||
self.uimanager.ensure_update()
|
self.uimanager.ensure_update()
|
||||||
|
|
||||||
while gtk.events_pending():
|
while gtk.events_pending():
|
||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
|
|
||||||
self.active_page.change_page()
|
self.active_page.change_page()
|
||||||
if self._key:
|
if self._key:
|
||||||
self.uistate.disconnect(self._key)
|
self.uistate.disconnect(self._key)
|
||||||
self._key = self.uistate.connect(
|
self._key = self.uistate.connect(
|
||||||
'nameformat-changed', self.active_page.build_tree)
|
'nameformat-changed', self.active_page.build_tree)
|
||||||
|
else:
|
||||||
|
#no views loaded
|
||||||
|
pass
|
||||||
|
|
||||||
def import_data(self, obj):
|
def import_data(self, obj):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user