CVSROOT:        /cvs/gnome
Module name:    sketch
Changes by:     bherzog 05/12/17 20:48:11

Modified files:
        test           : test_aligntool.py ChangeLog 
        Sketch/UI      : toolbox.py skapp.py mainwindow.py canvas.py 
        Sketch/Editor  : doceditor.py context.py aligntool.py 
        .              : ChangeLog 
Added files:
        test           : test_context.py 

Log message:
Change which objects manage which tool is active.  Previously it
was the main context object, no it's the document editor.
Savannah patch #4695, partly by Valentin Ungureanu

* Sketch/Editor/context.py: Change the meaning of the context's
TOOL message a little.  Previously it indicated that the user
selected a new tool and all editors had to be updated accordingly.
Now it means that the current editor has switched to a different
tool (or that a different editor has been made current).
(tool) The tool attribute is now determined on the fly based on
the current tool.  It may be None now.
(Context.editor_channels): Add TOOL so that the editor's new TOOL
messages are forwarded by the context.
(Context.__getattr__): New.  Recognize "tool" attributes and
return something sensible, usually the current editor's toolname.
(Context.__init__): "tool" is no longer an instance variable.
(Context.set_editor): Issue a TOOL message when the editor
changes.  The new editor may currently have a different tool than
the previous one.
(Context.SetTool): Simply call the current editor's SetTool
method.  Do not issue messages anymore.

* Sketch/Editor/doceditor.py (EditorWithSelection.SetTool): Issue
a TOOL message when the tool changes.

* Sketch/UI/mainwindow.py (tool_changed): Removed.
(SketchMainWindow.__init__, SketchMainWindow.close): removed the
code that handled the TOOL messages or set the current tool.

* Sketch/UI/toolbox.py (ToolButton.ToolChanged): Make the button
insensitive when tool is None.

* Sketch/UI/skapp.py (SketchApplication.__init__): No need to set
the current tool anymore.  That is done by the editor now.
(SketchApplication.SetTool): Removed.

* Sketch/Editor/aligntool.py (AlignToolInstance.ButtonClick):
The tool is now managed directly by the editor.

* Sketch/UI/canvas.py (SketchCanvas.subscribe_editor)
(SketchCanvas.unsubscribe_editor): (Un)subscribe to/from the
editor's TOOL messages too.
(SketchCanvas.SetTool): Simply pass the tool through to the
editor.
(SketchCanvas.tool_changed): New.  Has the cursor update logic
formerly in SetTool.  This method is subscribed to the TOOL
message.
(SketchCanvas.realize_method): New. Extend
inherited method so that the cursors are set properly

* test_context.py: New.  Some tests for the context object.

* test_aligntool.py: Adapt to new tool management.
(MinimalCanvas.__init__): Removed application parameter/instance
variable.
(MinimalCanvas.SetTool): Removed.  Not needed anymore.
(MockApplication, MockMainWindow): Removed.  No longer needed
since the tool is now managed directly by the editor.
(AlignTest.set_application, AlignTest.tearDown): Do not set/unset
self.application and self.main_window anymore

URL : 
http://cvs.gnome.org/bonsai/cvsquery.cgi?branch=&dir=sketch&who=bherzog&date=explicit&mindate=2005-12-17%2020:47&maxdate=2005-12-17%2020:49

_______________________________________________
cvs-commits-list mailing list
cvs-commits-list@gnome.org
http://mail.gnome.org/mailman/listinfo/cvs-commits-list

Reply via email to