Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-10-20 17:58:53 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-10-20 17:58:53 +0400
commitcb8f7fd385251d22ab97a48466e33ce0e42d5e4d (patch)
treefac9b9510d58bc04ff94dbc658621c3de31ed466 /source/blender/windowmanager/intern/wm_jobs.c
parentb8eec2b8fe123b118aef925ce2f786842764413d (diff)
Auto Save
Auto save is now working again in 2.5. It will also remember now what the location of the original file was when recovering it, so that library links still work and saving the restored file does not save to the temp directory. There is also a new Recover Auto Save operator which will open the filebrowser in the temp directory and show the auto saved .blends. Implemenation Notes: * Timer storage was moved from window to windowmanager, so we can have windowmanager level timers too now, doesn't make sense to have autosave timer attached to a particular window. * FileGlobal now has a filename field storing where the file was saved. Note that this is only used when loading a file through the recover operators, regular file read doesn't use it, so copying the quit.blend manually over the original file will still work as expected. * Jobs timer no longer uses operator now, this seems more like an internal thing, changing keymaps should not make it possible to break the jobs manager. * Autosave is postponed by 10 seconds when a modal operator is running, e.g. transform or file browsing. * Moved setting G.sce in setup_app_data before depsgraph updates, these can use the filename for pointcaches.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_jobs.c')
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index 498306484e9..c2ecf0c59e7 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -255,7 +255,7 @@ void WM_jobs_start(wmWindowManager *wm, wmJob *steve)
/* restarted job has timer already */
if(steve->wt==NULL)
- steve->wt= WM_event_add_window_timer(steve->win, TIMERJOBS, steve->timestep);
+ steve->wt= WM_event_add_timer(wm, steve->win, TIMERJOBS, steve->timestep);
}
else printf("job fails, not initialized\n");
}
@@ -271,7 +271,7 @@ static void wm_jobs_kill_job(wmWindowManager *wm, wmJob *steve)
}
if(steve->wt)
- WM_event_remove_window_timer(steve->win, steve->wt);
+ WM_event_remove_timer(wm, steve->win, steve->wt);
if(steve->customdata)
steve->free(steve->customdata);
if(steve->run_customdata)
@@ -317,14 +317,13 @@ void wm_jobs_timer_ended(wmWindowManager *wm, wmTimer *wt)
}
/* hardcoded to event TIMERJOBS */
-static int wm_jobs_timer(bContext *C, wmOperator *op, wmEvent *evt)
+void wm_jobs_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
{
- wmWindowManager *wm= CTX_wm_manager(C);
wmJob *steve= wm->jobs.first;
for(; steve; steve= steve->next) {
- if(evt->customdata==steve->wt) {
+ if(steve->wt==wt) {
/* running threads */
if(steve->threads.first) {
@@ -358,7 +357,7 @@ static int wm_jobs_timer(bContext *C, wmOperator *op, wmEvent *evt)
WM_jobs_start(wm, steve);
}
else {
- WM_event_remove_window_timer(steve->win, steve->wt);
+ WM_event_remove_timer(wm, steve->win, steve->wt);
steve->wt= NULL;
/* remove steve */
@@ -370,23 +369,7 @@ static int wm_jobs_timer(bContext *C, wmOperator *op, wmEvent *evt)
else if(steve->suspended) {
WM_jobs_start(wm, steve);
}
-
- return OPERATOR_FINISHED;
}
}
- return OPERATOR_PASS_THROUGH;
}
-void WM_OT_jobs_timer(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Jobs timer";
- ot->idname= "WM_OT_jobs_timer";
- ot->description="Jobs timer operator.";
-
- /* api callbacks */
- ot->invoke= wm_jobs_timer;
-
- ot->poll= ED_operator_screenactive;
-
-}