Changeset 1250

Show
Ignore:
Timestamp:
04/24/07 23:22:43 (2 years ago)
Author:
arj..@yirdis.nl
Message:

fixed bug in UML/properties.py, added some documentation about actions.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/TODO

    r1233 r1250  
    66 - 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. 
    77 Use a more recent version 
     8 
     9 - filename should not be part of the main window 
     10   Is it a transient property? 
    811 
    912 - Load / save regression testing 
  • gaphor/trunk/doc/actions.txt

    r1245 r1250  
    22=========================================== 
    33 
     4The GTK+ structure is like this:: 
    45 
    5  UIManager 
    6    | 
    7  ActionGroup 
    8    | 
    9  Action 
    10    | on_activate 
    11  perform action 
     6    UIManager 
     7        | 
     8   ActionGroup 
     9        | 
     10     Action 
    1211 
    13  * Where it should lead: 
    14     * Actions should be coded closer to the object their working on 
    15        - main actions - not dependent on GUI components (load/save/new/quit) 
    16        - main actions dependent on GUI component (sub-windows, console) 
    17        - Item actions, act either on a diagram, the selected or focused item 
    18          or no item. 
    19        - diagram actions (zoom, grid) work on active diagram (tab) 
    20        - menus and actions for diagram items through adapters 
     12The do_activate signal is emitted when an action is activated. 
    2113 
    22     * Each window has it's own action group / every item with a menu! 
    23     * One action group for the application/gui_manager 
    24     * One toplevel UIManager per window or one per application/gui_manager? 
    25     ? Actions should inherit from gtk.Action 
    26     ? Actions should be modeled as functions (methods) with action as 
    27       first (sec) parameter. 
    28  * filename should not be part of the main window 
     14Where it should lead: 
     15 * Actions should be coded closer to the object their working on 
     16    - main actions - not dependent on GUI components (load/save/new/quit) 
     17    - main actions dependent on GUI component (sub-windows, console) 
     18    - Item actions, act either on a diagram, the selected or focused item 
     19      or no item. 
     20    - diagram actions (zoom, grid) work on active diagram (tab) 
     21    - menus and actions for diagram items through adapters 
     22  
     23 * Actions should behave more like adapters. E.g. when a popup menu is created 
     24   for an Association item, the menu actions should present themselves in the 
     25   context of that menu item (with toggles set right) 
     26    - Could be registered as adapters with a name. 
     27 
     28 * Each window has it's own action group (every item with a menu?) 
     29 * One action group for the application/gui_manager (new/load/save/quit) 
     30 * One toplevel UIManager per window or one per application/gui_manager? 
     31 ? Actions should inherit from gtk.Action. 
     32   Depends on the structure. Preferbly not, since it ties actions to GTK+ 
     33   (which is not a good thing for testing) 
     34 ? Actions should be modeled as functions (methods) with action as 
     35   first (sec) parameter. 
     36   Normal actions can be modeled as functions. If an action is sensitive or 
     37   visible depends on the state in the action. Hence we require the update() 
     38   method. 
     39 
    2940 * some sort of factory mechanism (MultiAction?). 
    30      - RecentFiles will manage up to 10 recent files entries. 
    31      - same for stereotypes: should be managed by one "ObjectAction". 
    32      - can Placeholders play a role here? 
    33  
     41    - contains an ActionGroup and menu-XML. 
     42    - RecentFiles will manage up to 10 recent files entries. 
     43    - same for stereotypes: should be managed by one "ObjectAction". 
     44    - can Placeholders play a role here? Yes, they can be used to identify the 
     45      section where the actions should be put. 
     46    - In some cases multiple menu items may refer to the same action: 
     47      radio actions may (but this is not always the case) and the Recent files 
     48      functionality. 
  • gaphor/trunk/gaphor/UML/properties.py

    r1219 r1250  
    367367            setattr(obj, self._name, value) 
    368368            if do_notify: 
    369                 component.handle(AssociationSetEvent(obj, self, old, value)
     369                event = AssociationSetEvent(obj, self, old, value
    370370        else: 
    371371            # Set the actual value 
     
    382382            c.items.append(value) 
    383383            if do_notify: 
    384                 component.handle(AssociationAddEvent(obj, self, value)
     384                event = AssociationAddEvent(obj, self, value
    385385 
    386386        # Callbacks are only connected if a new relationship has 
     
    395395        if do_notify: 
    396396            self.notify(obj) 
     397            component.handle(event) 
    397398 
    398399    def _del(self, obj, value, from_opposite=False): 
  • gaphor/trunk/gaphor/diagram/tool.py

    r1243 r1250  
    247247                pool = Application.get_service('action_manager') 
    248248                pool.get_action('Pointer').active = True 
     249                log.debug('button-release pointer set to %s' % pool.get_action('Pointer').active) 
    249250            return gaphas.tool.PlacementTool.on_button_release(self, context, event) 
    250251        finally: 
  • gaphor/trunk/gaphor/ui/namespace.py

    r1239 r1250  
    99import operator 
    1010import stock 
    11 from gaphas.decorators import async 
    1211 
    1312from gaphor import UML 
     
    202201                                        [original] * len(children), children)) 
    203202 
    204     @async() 
    205203    def on_ownedmember_changed(self, element, pspec): 
    206204        """ 
  • gaphor/trunk/setup.py

    r1247 r1250  
    6363        # 'PyGTK >= 2.8.0', - Exclude, since it will not build anyway 
    6464        'decorator >= 2.0.1', 
    65         'gaphas >= 0.1.5.dev-r1235', 
     65        'gaphas >= 0.1.5.dev-r1236', 
    6666        'zope.component >= 3.3.0', # - won't compile on windows. 
    6767        # Add dependency on zope.testing to work around bug in zope.component