mlhim-specs-dev team mailing list archive
-
mlhim-specs-dev team
-
Mailing list archive
-
Message #00651
[Branch ~cdd-dev/cdd/trunk] Rev 214: Added a timer to autosave the CDD.
------------------------------------------------------------
revno: 214
committer: Eduardo C. P. Ribeiro <eduardo.cesar@xxxxxxx>
branch nick: cdd
timestamp: Sat 2012-08-04 04:04:34 -0300
message:
Added a timer to autosave the CDD.
modified:
src/cdd.py
src/cdd_version.py
src/update_version.sh
--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk
Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== modified file 'src/cdd.py'
--- src/cdd.py 2012-08-02 23:13:32 +0000
+++ src/cdd.py 2012-08-04 07:04:34 +0000
@@ -184,10 +184,18 @@
self.metadata.set_meta_info()
- # self.metadata.read_config()
- # info.get_meta_info(self.metadata)
-
-
+ # Binds the function to EVT_TIMER
+ self.Bind(wx.EVT_TIMER, self.timer_worker)
+
+ # Timer that calls a function at a regular time.
+ self.timer = wx.Timer(self)
+ time = int(self.config_dialog.config.get('DEFAULT', 'autosave'))
+ if time > 0:
+ self.timer.Start(time*60000)
+
+ def timer_worker(self, event=None):
+ #TODO: Put the CDD automatic save routine here
+ pass
def OnSelChanged(self, event):
item = event.GetItem()
@@ -415,6 +423,14 @@
self.config_dialog.get_panel_configs()
self.config_dialog.save_config()
+ # Set the timer
+ time = int(self.config_dialog.config.get('DEFAULT', 'autosave'))
+ if time > 0:
+ self.timer.Start(time*60000)
+ else:
+ self.timer.Stop()
+
+
# end of class MainFrame
credits = ["Eduardo César", "Timothy W.Cook", "Luciana Tricai Cavalini"]
=== modified file 'src/cdd_version.py'
--- src/cdd_version.py 2012-08-04 05:58:34 +0000
+++ src/cdd_version.py 2012-08-04 07:04:34 +0000
@@ -1,2 +1,2 @@
-REVNO = 212
+REVNO = 213
VERSION = '2.3.0 Rev. %d' % (int(REVNO) + 1)
=== modified file 'src/update_version.sh'
--- src/update_version.sh 2012-08-02 23:34:08 +0000
+++ src/update_version.sh 2012-08-04 07:04:34 +0000
@@ -1,5 +1,6 @@
#!/bin/bash
REV=$(bzr revno)
+echo $REV
echo "REVNO = $REV
VERSION = '2.3.0 Rev. %d' % (int(REVNO) + 1)" > cdd_version.py