Workaround for broken introspection

8474: Crash after merge places
8498: Crash when attempting to add gramplet
8536: clicking on tag icon in person view causes gramps to crash
This commit is contained in:
Josip 2015-05-11 17:45:42 +02:00
parent c26fcf6d56
commit 45f82f1ec5
5 changed files with 45 additions and 5 deletions

View File

@ -292,10 +292,18 @@ class Navigator(object):
# Functions # Functions
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def cb_menu_position(menu, button): def cb_menu_position(*args):
""" """
Determine the position of the popup menu. Determine the position of the popup menu.
""" """
# takes two argument: menu, button
if len(args) == 2:
menu = args[0]
button = args[1]
# broken introspection can't handle MenuPositionFunc annotations corectly
else:
menu = args[0]
button = args[3]
ret_val, x_pos, y_pos = button.get_window().get_origin() ret_val, x_pos, y_pos = button.get_window().get_origin()
x_pos += button.get_allocation().x x_pos += button.get_allocation().x
y_pos += button.get_allocation().y + button.get_allocation().height y_pos += button.get_allocation().y + button.get_allocation().height

View File

@ -277,10 +277,18 @@ class Tags(DbGUIElement):
view.add_tag(trans, object_handle, tag_handle) view.add_tag(trans, object_handle, tag_handle)
status.end() status.end()
def cb_menu_position(menu, button): def cb_menu_position(*args):
""" """
Determine the position of the popup menu. Determine the position of the popup menu.
""" """
# takes two argument: menu, button
if len(args) == 2:
menu = args[0]
button = args[1]
# broken introspection can't handle MenuPositionFunc annotations corectly
else:
menu = args[0]
button = args[3]
ret_val, x_pos, y_pos = button.get_window().get_origin() ret_val, x_pos, y_pos = button.get_window().get_origin()
x_pos += button.get_allocation().x x_pos += button.get_allocation().x
y_pos += button.get_allocation().y + button.get_allocation().height y_pos += button.get_allocation().y + button.get_allocation().height

View File

@ -734,10 +734,18 @@ class TabLabel(Gtk.HBox):
else: else:
self.closebtn.hide() self.closebtn.hide()
def cb_menu_position(menu, button): def cb_menu_position(*args):
""" """
Determine the position of the popup menu. Determine the position of the popup menu.
""" """
# takes two argument: menu, button
if len(args) == 2:
menu = args[0]
button = args[1]
# broken introspection can't handle MenuPositionFunc annotations corectly
else:
menu = args[0]
button = args[3]
ret_val, x_pos, y_pos = button.get_window().get_origin() ret_val, x_pos, y_pos = button.get_window().get_origin()
x_pos += button.get_allocation().x x_pos += button.get_allocation().x
y_pos += button.get_allocation().y + button.get_allocation().height y_pos += button.get_allocation().y + button.get_allocation().height

View File

@ -205,10 +205,18 @@ class DropdownSidebar(BaseSidebar):
self.viewmanager.notebook.set_current_page(page_no) self.viewmanager.notebook.set_current_page(page_no)
self.__handlers_unblock() self.__handlers_unblock()
def cb_menu_position(menu, button): def cb_menu_position(*args):
""" """
Determine the position of the popup menu. Determine the position of the popup menu.
""" """
# takes two argument: menu, button
if len(args) == 2:
menu = args[0]
button = args[1]
# broken introspection can't handle MenuPositionFunc annotations corectly
else:
menu = args[0]
button = args[3]
ret_val, x_pos, y_pos = button.get_window().get_origin() ret_val, x_pos, y_pos = button.get_window().get_origin()
x_pos += button.get_allocation().x x_pos += button.get_allocation().x
y_pos += button.get_allocation().y + button.get_allocation().height y_pos += button.get_allocation().y + button.get_allocation().height

View File

@ -218,10 +218,18 @@ class ExpanderSidebar(BaseSidebar):
self.viewmanager.notebook.set_current_page(page_no) self.viewmanager.notebook.set_current_page(page_no)
self.__handlers_unblock() self.__handlers_unblock()
def cb_menu_position(menu, button): def cb_menu_position(*args):
""" """
Determine the position of the popup menu. Determine the position of the popup menu.
""" """
# takes two argument: menu, button
if len(args) == 2:
menu = args[0]
button = args[1]
# broken introspection can't handle MenuPositionFunc annotations corectly
else:
menu = args[0]
button = args[3]
ret_val, x_pos, y_pos = button.get_window().get_origin() ret_val, x_pos, y_pos = button.get_window().get_origin()
x_pos += button.get_allocation().x x_pos += button.get_allocation().x
y_pos += button.get_allocation().y + button.get_allocation().height y_pos += button.get_allocation().y + button.get_allocation().height