GTK3: adjustment value via get and set
svn: r20294
This commit is contained in:
parent
2ed067932e
commit
cc58908d34
@ -33,6 +33,14 @@ from gen.ggettext import sgettext as _
|
|||||||
from gen.ggettext import ngettext
|
from gen.ggettext import ngettext
|
||||||
import cgi
|
import cgi
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Set up logging
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
import logging
|
||||||
|
_LOG = logging.getLogger("plugin.relview")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GTK/Gnome modules
|
# GTK/Gnome modules
|
||||||
@ -474,6 +482,9 @@ class RelationshipView(NavigationView):
|
|||||||
try:
|
try:
|
||||||
return self._change_person(obj)
|
return self._change_person(obj)
|
||||||
except AttributeError, msg:
|
except AttributeError, msg:
|
||||||
|
import traceback
|
||||||
|
exc = traceback.format_exc()
|
||||||
|
_LOG.error(str(msg) +"\n" + exc)
|
||||||
from gui.dialog import RunDatabaseRepair
|
from gui.dialog import RunDatabaseRepair
|
||||||
RunDatabaseRepair(str(msg))
|
RunDatabaseRepair(str(msg))
|
||||||
self.redrawing = False
|
self.redrawing = False
|
||||||
@ -482,14 +493,14 @@ class RelationshipView(NavigationView):
|
|||||||
def _change_person(self, obj):
|
def _change_person(self, obj):
|
||||||
if obj == self.old_handle:
|
if obj == self.old_handle:
|
||||||
#same object, keep present scroll position
|
#same object, keep present scroll position
|
||||||
old_vadjust = self.scroll.get_vadjustment().value
|
old_vadjust = self.scroll.get_vadjustment().get_value()
|
||||||
self.old_handle = obj
|
self.old_handle = obj
|
||||||
else:
|
else:
|
||||||
#different object, scroll to top
|
#different object, scroll to top
|
||||||
old_vadjust = self.scroll.get_vadjustment().get_lower()
|
old_vadjust = self.scroll.get_vadjustment().get_lower()
|
||||||
self.old_handle = obj
|
self.old_handle = obj
|
||||||
self.scroll.get_vadjustment().value = \
|
self.scroll.get_vadjustment().set_value(
|
||||||
self.scroll.get_vadjustment().get_lower()
|
self.scroll.get_vadjustment().get_lower())
|
||||||
if self.redrawing:
|
if self.redrawing:
|
||||||
return False
|
return False
|
||||||
self.redrawing = True
|
self.redrawing = True
|
||||||
@ -571,7 +582,7 @@ class RelationshipView(NavigationView):
|
|||||||
|
|
||||||
self.vbox.pack_start(self.child, False, True, 0)
|
self.vbox.pack_start(self.child, False, True, 0)
|
||||||
#reset scroll position as it was before
|
#reset scroll position as it was before
|
||||||
self.scroll.get_vadjustment().value = old_vadjust
|
self.scroll.get_vadjustment().set_value(old_vadjust)
|
||||||
self.redrawing = False
|
self.redrawing = False
|
||||||
self.uistate.modify_statusbar(self.dbstate)
|
self.uistate.modify_statusbar(self.dbstate)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user