Commit 036689e7 authored by Javier Hernández's avatar Javier Hernández

Fix for bug #675989 - Use python object attributes instead of gobject ones

parent a08782aa
......@@ -366,8 +366,8 @@ class EventMonitor(ViewportPlugin):
foreground='blue',
underline=Pango.Underline.SINGLE)
hyperlink.connect('event', self._onLinkClicked)
hyperlink.set_data('acc', acc)
hyperlink.set_data('islink', True)
setattr(hyperlink, 'acc', acc)
setattr(hyperlink, 'islink', True)
return hyperlink
def _onLinkClicked(self, tag, widget, event, iter):
......@@ -385,7 +385,7 @@ class EventMonitor(ViewportPlugin):
'''
if event.type == gdk.EventType.BUTTON_RELEASE and \
event.button == 1 and not self.monitor_buffer.get_has_selection():
self.node.update(tag.get_data('acc'))
self.node.update(getattr(tag, 'acc'))
def _onLinkKeyPress(self, textview, event):
'''
......@@ -404,7 +404,7 @@ class EventMonitor(ViewportPlugin):
iter = buffer.get_iter_at_mark(buffer.get_insert())
acc = None
for tag in iter.get_tags():
acc = tag.get_data('acc')
acc = getattr(tag, 'acc')
if acc:
self.node.update(acc)
break
......@@ -426,7 +426,7 @@ class EventMonitor(ViewportPlugin):
iter = textview.get_iter_at_location(x, y)
cursor = gdk.Cursor(gdk.CursorType.XTERM)
for tag in iter.get_tags():
if tag.get_data('islink'):
if getattr(tag, 'islink'):
cursor = gdk.Cursor(gdk.CursorType.HAND2)
break
window = textview.get_window(gtk.TextWindowType.TEXT)
......
......@@ -1128,7 +1128,7 @@ class _SectionTable(_InterfaceSection):
self.cell_button)]:
button.set_label(str(desc or '<no description>'))
button.set_sensitive(bool(acc))
button.set_data('acc', acc)
setattr(button, 'acc', acc)
def _onTableButtonClicked(self, button):
'''
......@@ -1138,7 +1138,7 @@ class _SectionTable(_InterfaceSection):
@param button: Button that triggered event.
@type button: gtk.Button
'''
self.node.update(button.get_data('acc'))
self.node.update(getattr(button, 'acc'))
class _SectionText(_InterfaceSection):
'''
......
......@@ -107,7 +107,7 @@ class AccerciserMainWindow(gtk.Window):
if not self.gsettings.get_int(paned.get_name()): continue
paned_position = self.gsettings.get_int(paned.get_name())
paned.set_position(paned_position)
paned.set_data('last_position', paned.get_position())
setattr(paned, 'last_position', paned.get_position())
self.add(main_vbox)
......@@ -126,10 +126,10 @@ class AccerciserMainWindow(gtk.Window):
@type action: string
'''
if pluginview.get_n_pages() == 1 and action == 'added':
last_pos = self._vpaned.get_data('last_position')
last_pos = getattr(self._vpaned, 'last_position')
self._vpaned.set_position(last_pos or 350)
elif pluginview.get_n_pages() == 0:
self._vpaned.set_data('last_position', self._vpaned.get_position())
setattr(self._vpaned, 'last_position', self._vpaned.get_position())
self._vpaned.set_position(self._vpaned.get_allocated_height() - 30)
def _onBottomPanelRealize(self, pluginview):
......@@ -169,7 +169,7 @@ class AccerciserMainWindow(gtk.Window):
if self.pluginview2.get_n_pages():
position = self._vpaned.get_position()
else:
position = self._vpaned.get_data('last_position')
position = getattr(self._vpaned, 'last_position')
if position is not None:
self.gsettings.set_int('vpaned', position)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment