/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/base.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/base.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 319 by bh, Wed Jul 24 17:16:09 2002 UTC revision 320 by bh, Fri Sep 13 14:21:30 2002 UTC
# Line 13  __version__ = "$Revision$" Line 13  __version__ = "$Revision$"
13    
14  from Thuban.Lib.connector import Publisher  from Thuban.Lib.connector import Publisher
15    
16  from messages import TITLE_CHANGED  from messages import TITLE_CHANGED, CHANGED
17    
18  class TitledObject:  class TitledObject:
19    
# Line 42  class Modifiable(Publisher): Line 42  class Modifiable(Publisher):
42          return self.modified          return self.modified
43    
44      def UnsetModified(self):      def UnsetModified(self):
45          """Unset the modified flag"""          """Unset the modified flag.
46    
47            If the modified flag is changed from set to inset by he call,
48            issue a CHANGED message.
49    
50            The modified flag itself is part of the state of the object so
51            some other objects such as a field in the status bar indication
52            whether e.g. the session has changed might be interested in
53            being notified when this flag has changed.
54            """
55            was_modified = self.modified
56          self.modified = 0          self.modified = 0
57            if was_modified:
58                self.issue(CHANGED)
59    
60      def changed(self, channel = None, *args):      def changed(self, channel = None, *args):
61          """Set the modified flag and issue a message          """Set the modified flag and optionally issue a message
62    
63          The message is issued on the channel given by channel with args          The message is issued on the channel given by channel with args
64          as the arguments.          as the arguments. If channel is None issue no message.
65    
66          Subclasses should call this method whenever anything has          Subclasses should call this method whenever anything has
67          changed.          changed.

Legend:
Removed from v.319  
changed lines
  Added in v.320

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26