[labyrinth] r364 committed - Fix issue 124 and fix regression that links could not be deleted

0 views
Skip to first unread message

codesite...@google.com

unread,
Apr 24, 2011, 9:22:25 AM4/24/11
to labyrinth-...@googlegroups.com
Revision: 364
Author: matthias.v...@gmail.com
Date: Sun Apr 24 06:21:28 2011
Log: Fix issue 124 and fix regression that links could not be deleted

http://code.google.com/p/labyrinth/source/detail?r=364

Modified:
/trunk/ChangeLog
/trunk/src/Links.py
/trunk/src/MMapArea.py

=======================================
--- /trunk/ChangeLog Sun Apr 24 04:48:58 2011
+++ /trunk/ChangeLog Sun Apr 24 06:21:28 2011
@@ -1,10 +1,15 @@
-2011-04-23 Matthias Vogelgesang <matthias.v...@gmail.com>
+2011-04-24 Matthias Vogelgesang <matthias.v...@gmail.com>
+ * src/Links.py
+ * src/MMapArea.py:
+ Fix issue 124 and fix regression that links could not be deleted
+
+2011-04-24 Matthias Vogelgesang <matthias.v...@gmail.com>
* po/pt_BR.po:
Really set to UTF-8
* configure.ac:
Prepare release candidate

-2011-04-23 Matthias Vogelgesang <matthias.v...@gmail.com>
+2011-04-24 Matthias Vogelgesang <matthias.v...@gmail.com>
* data/labyrinth-ui.xml
* src/MainWindow.py:
Removing 'delete from menu which interfered with application key
=======================================
--- /trunk/src/Links.py Sat Apr 23 07:28:34 2011
+++ /trunk/src/Links.py Sun Apr 24 06:21:28 2011
@@ -33,15 +33,16 @@
return [abs(x[0]-y[0]) / (mod), abs(x[1] - y[1]) / (mod)]

class Link (gobject.GObject):
- __gsignals__ = dict (select_link = (gobject.SIGNAL_RUN_FIRST,
-
gobject.TYPE_NONE,
-
(gobject.TYPE_PYOBJECT,)),
- update_view =
(gobject.SIGNAL_RUN_LAST,
-
gobject.TYPE_NONE,
-
()),
- popup_requested =
(gobject.SIGNAL_RUN_FIRST,
-
gobject.TYPE_NONE,
-
(gobject.TYPE_PYOBJECT,
gobject.TYPE_INT)))
+ __gsignals__ = dict (select_link = (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_PYOBJECT,)),
+ update_view = (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ ()),
+ popup_requested = (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_PYOBJECT,
gobject.TYPE_INT)))
+
def __init__ (self, save, parent = None, child = None, start_coords =
None, end_coords = None, strength = 2):
super (Link, self).__init__()
self.parent = parent
@@ -226,7 +227,7 @@
return False

def process_key_press (self, event, mode):
- if mode != BaseThought.MODE_EDITING:
+ if mode != BaseThought.MODE_EDITING or event.keyval ==
gtk.keysyms.Delete:
return False
if event.keyval == gtk.keysyms.plus or \
event.keyval == gtk.keysyms.KP_Add:
=======================================
--- /trunk/src/MMapArea.py Sun Apr 24 04:25:07 2011
+++ /trunk/src/MMapArea.py Sun Apr 24 06:21:28 2011
@@ -312,12 +312,14 @@
x.unselect ()
self.selected = [thought]
thought.select ()
+
if self.unending_link:
self.unending_link.set_child (thought)
self.links.append (self.unending_link)
element = self.unending_link.get_save_element ()
self.element.appendChild (element)
self.unending_link = None
+
self.undo.unblock ()
thought.foreground_color = self.foreground_color
thought.background_color = self.background_color
@@ -387,6 +389,7 @@
if not self.editing.process_key_press (event, self.mode):
return self.global_key_handler (event)
return True
+ b = self.selected[0].process_key_press (event, self.mode)
if len(self.selected) != 1 or not
self.selected[0].process_key_press (event, self.mode):
return self.global_key_handler (event)
return True
@@ -661,7 +664,7 @@
if self.unending_link:
del self.unending_link
self.unending_link = Links.Link (self.save, parent = thought,
start_coords = thought_coords,
-
end_coords
= child_coords, strength = strength)
+ end_coords = child_coords, strength = strength)

def set_mouse_cursor_cb (self, thought, cursor_type):
if not self.moving:
@@ -678,6 +681,7 @@
def claim_unending_link (self, thought):
if not self.unending_link:
return
+
if self.unending_link.parent == thought:
del self.unending_link
self.unending_link = None
@@ -688,7 +692,7 @@
x.change_strength (self.unending_link.parent, thought)
new_strength = x.strength
self.undo.add_undo (UndoManager.UndoAction (self,
UNDO_STRENGTHEN_LINK, self.undo_link_action, x, \
-
old_strength,
new_strength))
+ old_strength, new_strength))
del self.unending_link
self.unending_link = None
return
@@ -696,6 +700,7 @@
self.undo.add_undo (UndoManager.UndoAction (self,
UNDO_CREATE_LINK, self.undo_link_action, self.unending_link))
self.unending_link.set_child (thought)
self.links.append (self.unending_link)
+ self.connect_link(self.unending_link)
element = self.unending_link.get_save_element ()
self.element.appendChild (element)
self.unending_link = None

Reply all
Reply to author
Forward
0 new messages