Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/labyrinthactivity.py
diff options
context:
space:
mode:
authorGary Martin <gary@garycmartin.com>2009-11-04 03:04:06 (GMT)
committer Gary Martin <gary@garycmartin.com>2009-11-04 03:04:06 (GMT)
commit06382061e0be6c7cb4029dd8036bb03d54bb3b6e (patch)
tree79a53645ffe117f194cea9c19d6f1d692e78f9b2 /labyrinthactivity.py
parent92936ad979cbc4e6b43caeb83aa16663b8321948 (diff)
Make copy button state change work for old toolbars.
Diffstat (limited to 'labyrinthactivity.py')
-rw-r--r--labyrinthactivity.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/labyrinthactivity.py b/labyrinthactivity.py
index 054f865..29025ce 100644
--- a/labyrinthactivity.py
+++ b/labyrinthactivity.py
@@ -314,15 +314,21 @@ class LabyrinthActivity(activity.Activity):
"""Update state of copy button based on text selection
"""
if start != end:
- self.edit_toolbar.props.page.copy.child.set_sensitive(True)
+ self.__change_copy_state(True)
else:
- self.edit_toolbar.props.page.copy.child.set_sensitive(False)
+ self.__change_copy_state(False)
# TODO: implement copy/paste for a thought object or objects
def __thought_selected_cb(self, arg, background_color, foreground_color):
"""Disable copy button if whole thought object is selected
"""
- self.edit_toolbar.props.page.copy.child.set_sensitive(False)
+ self.__change_copy_state(False)
+
+ def __change_copy_state(self, state):
+ try:
+ self.edit_toolbar.props.page.copy.child.set_sensitive(state)
+ except AttributeError:
+ self.edit_toolbar.copy.child.set_sensitive(state)
def __expose(self, widget, event):
"""Create canvas hint message at start