Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/labyrinthactivity.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2013-02-22 22:20:50 (GMT)
committer Walter Bender <walter.bender@gmail.com>2013-02-22 22:20:50 (GMT)
commit67ba6b26c6a9e112065a42be9ad785a7158e441c (patch)
tree191c55869fae3278cfe297f078adeb8dfba8fc4c /labyrinthactivity.py
parent1e622866f18294b956faa178c0a8675d3dac4315 (diff)
basic copy/paste working
Diffstat (limited to 'labyrinthactivity.py')
-rw-r--r--labyrinthactivity.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/labyrinthactivity.py b/labyrinthactivity.py
index a17eb93..571a60f 100644
--- a/labyrinthactivity.py
+++ b/labyrinthactivity.py
@@ -341,6 +341,7 @@ class TextAttributesToolbar(gtk.Toolbar):
def change_active_font(self):
current_font_name = None
+ index_cf = None
current_font = str(self.__attribute_values()["font"])
for index, size in enumerate(self.__font_sizes):
index_size = current_font.find(size)
@@ -355,8 +356,9 @@ class TextAttributesToolbar(gtk.Toolbar):
if font_name == current_font_name:
index_cf = index
break
- self.fonts_combo_box.combo.set_active(index_cf)
- self.font_sizes_combo_box.combo.set_active(index_cfs)
+ if index_cf is not None:
+ self.fonts_combo_box.combo.set_active(index_cf)
+ self.font_sizes_combo_box.combo.set_active(index_cfs)
class ThoughtsToolbar(gtk.Toolbar):
@@ -585,7 +587,6 @@ class LabyrinthActivity(activity.Activity):
def __text_selection_cb(self, thought, start, end, text):
"""Update state of copy button based on text selection
"""
- logging.debug('text_selection_cb %d %d %s' % (start, end, text))
if start != end:
self.__change_copy_state(True)
self.text_format_toolbar.props.page.change_active_font()
@@ -593,8 +594,9 @@ class LabyrinthActivity(activity.Activity):
self.__change_copy_state(False)
if self._mode == (MMapArea.MODE_TEXT and
- len(self._main_area.selected) and
- self._main_area.selected[0].editing):
+ len(self._main_area.selected)):
+ # With textview, we are always editing
+ # and self._main_area.selected[0].editing):
self.__change_paste_state(True)
else:
self.__change_paste_state(False)
@@ -762,8 +764,6 @@ class LabyrinthActivity(activity.Activity):
tar.close()
def write_file(self, file_path):
- logging.debug('write_file')
-
tar = Tarball(file_path, 'w')
self._main_area.update_save()