fixed bug in UML/properties.py, added some documentation about actions.
git-svn-id: file:///Users/arjan/backup/gaphor/gaphor/trunk@1250 a8418922-720d-0410-834f-a69b97ada669
This commit is contained in:
parent
05fdbc1b4a
commit
c07247dc3b
3
TODO
3
TODO
@ -6,6 +6,9 @@ For 0.10.0 and later:
|
||||
- bug in zope.component package: in zope.component.globalregistry.py zope.testing is included. This package is only a dependency for the [test] setting. zope.testing is not mandatory.
|
||||
Use a more recent version
|
||||
|
||||
- filename should not be part of the main window
|
||||
Is it a transient property?
|
||||
|
||||
- Load / save regression testing
|
||||
!!! Create some example diagrams,
|
||||
|
||||
|
@ -1,33 +1,48 @@
|
||||
Actions, menu items, toolbars and toolboxes
|
||||
===========================================
|
||||
|
||||
The GTK+ structure is like this::
|
||||
|
||||
UIManager
|
||||
|
|
||||
ActionGroup
|
||||
|
|
||||
Action
|
||||
| on_activate
|
||||
perform action
|
||||
UIManager
|
||||
|
|
||||
ActionGroup
|
||||
|
|
||||
Action
|
||||
|
||||
* Where it should lead:
|
||||
* Actions should be coded closer to the object their working on
|
||||
- main actions - not dependent on GUI components (load/save/new/quit)
|
||||
- main actions dependent on GUI component (sub-windows, console)
|
||||
- Item actions, act either on a diagram, the selected or focused item
|
||||
or no item.
|
||||
- diagram actions (zoom, grid) work on active diagram (tab)
|
||||
- menus and actions for diagram items through adapters
|
||||
The do_activate signal is emitted when an action is activated.
|
||||
|
||||
Where it should lead:
|
||||
* Actions should be coded closer to the object their working on
|
||||
- main actions - not dependent on GUI components (load/save/new/quit)
|
||||
- main actions dependent on GUI component (sub-windows, console)
|
||||
- Item actions, act either on a diagram, the selected or focused item
|
||||
or no item.
|
||||
- diagram actions (zoom, grid) work on active diagram (tab)
|
||||
- menus and actions for diagram items through adapters
|
||||
|
||||
* Actions should behave more like adapters. E.g. when a popup menu is created
|
||||
for an Association item, the menu actions should present themselves in the
|
||||
context of that menu item (with toggles set right)
|
||||
- Could be registered as adapters with a name.
|
||||
|
||||
* Each window has it's own action group (every item with a menu?)
|
||||
* One action group for the application/gui_manager (new/load/save/quit)
|
||||
* One toplevel UIManager per window or one per application/gui_manager?
|
||||
? Actions should inherit from gtk.Action.
|
||||
Depends on the structure. Preferbly not, since it ties actions to GTK+
|
||||
(which is not a good thing for testing)
|
||||
? Actions should be modeled as functions (methods) with action as
|
||||
first (sec) parameter.
|
||||
Normal actions can be modeled as functions. If an action is sensitive or
|
||||
visible depends on the state in the action. Hence we require the update()
|
||||
method.
|
||||
|
||||
* Each window has it's own action group / every item with a menu!
|
||||
* One action group for the application/gui_manager
|
||||
* One toplevel UIManager per window or one per application/gui_manager?
|
||||
? Actions should inherit from gtk.Action
|
||||
? Actions should be modeled as functions (methods) with action as
|
||||
first (sec) parameter.
|
||||
* filename should not be part of the main window
|
||||
* some sort of factory mechanism (MultiAction?).
|
||||
- RecentFiles will manage up to 10 recent files entries.
|
||||
- same for stereotypes: should be managed by one "ObjectAction".
|
||||
- can Placeholders play a role here?
|
||||
|
||||
- contains an ActionGroup and menu-XML.
|
||||
- RecentFiles will manage up to 10 recent files entries.
|
||||
- same for stereotypes: should be managed by one "ObjectAction".
|
||||
- can Placeholders play a role here? Yes, they can be used to identify the
|
||||
section where the actions should be put.
|
||||
- In some cases multiple menu items may refer to the same action:
|
||||
radio actions may (but this is not always the case) and the Recent files
|
||||
functionality.
|
||||
|
@ -366,7 +366,7 @@ class association(umlproperty):
|
||||
# undosetassociationaction(self, obj, value)
|
||||
setattr(obj, self._name, value)
|
||||
if do_notify:
|
||||
component.handle(AssociationSetEvent(obj, self, old, value))
|
||||
event = AssociationSetEvent(obj, self, old, value)
|
||||
else:
|
||||
# Set the actual value
|
||||
c = self._get(obj)
|
||||
@ -381,7 +381,7 @@ class association(umlproperty):
|
||||
# undosetassociationaction(self, obj, value)
|
||||
c.items.append(value)
|
||||
if do_notify:
|
||||
component.handle(AssociationAddEvent(obj, self, value))
|
||||
event = AssociationAddEvent(obj, self, value)
|
||||
|
||||
# Callbacks are only connected if a new relationship has
|
||||
# been established.
|
||||
@ -394,6 +394,7 @@ class association(umlproperty):
|
||||
|
||||
if do_notify:
|
||||
self.notify(obj)
|
||||
component.handle(event)
|
||||
|
||||
def _del(self, obj, value, from_opposite=False):
|
||||
"""
|
||||
|
@ -246,6 +246,7 @@ class PlacementTool(gaphas.tool.PlacementTool):
|
||||
if Application.get_service('properties')('reset-tool-after-create', False):
|
||||
pool = Application.get_service('action_manager')
|
||||
pool.get_action('Pointer').active = True
|
||||
log.debug('button-release pointer set to %s' % pool.get_action('Pointer').active)
|
||||
return gaphas.tool.PlacementTool.on_button_release(self, context, event)
|
||||
finally:
|
||||
self._tx.commit()
|
||||
|
@ -8,7 +8,6 @@ import gobject
|
||||
import gtk
|
||||
import operator
|
||||
import stock
|
||||
from gaphas.decorators import async
|
||||
|
||||
from gaphor import UML
|
||||
from gaphor.transaction import Transaction
|
||||
@ -201,7 +200,6 @@ class NamespaceModel(gtk.GenericTreeModel):
|
||||
map(list.index,
|
||||
[original] * len(children), children))
|
||||
|
||||
@async()
|
||||
def on_ownedmember_changed(self, element, pspec):
|
||||
"""
|
||||
Update the tree model when the ownedMember list changes.
|
||||
|
2
setup.py
2
setup.py
@ -62,7 +62,7 @@ setup(
|
||||
install_requires = [
|
||||
# 'PyGTK >= 2.8.0', - Exclude, since it will not build anyway
|
||||
'decorator >= 2.0.1',
|
||||
'gaphas >= 0.1.5.dev-r1235',
|
||||
'gaphas >= 0.1.5.dev-r1236',
|
||||
'zope.component >= 3.3.0', # - won't compile on windows.
|
||||
# Add dependency on zope.testing to work around bug in zope.component
|
||||
'zope.testing >= 3.3.0',
|
||||
|
Loading…
x
Reference in New Issue
Block a user