[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Avoiding blocking the UI while running hook scripts?

From: Roger Lipscombe <roger_at_differentpla.net>
Date: Sat, 19 Apr 2008 18:27:50 +0100

I'm looking into changing the way that hook scripts run, so that they
don't block the UI. The issue tracker hook script is the most obvious
example of this problem. I'm planning on having a dialog box pop up
while the hook is running. It would contain text, something like "Please
wait while the Issue Tracker hook runs".

It might contain a "Cancel" button, which wouldn't kill the script
(that's relatively hard), but it would abort the wait, and would return
to the calling dialog as if the script failed. I'll have to think a
little bit about how the background thread would be "garbage-collected"
later -- we don't want TortoiseProc instances hanging around because the
hook script is still running somewhere.

(My model is the "Wait"/"Switch To"/"Cancel" dialog that you see when an
OLE server is blocking).

I'm thinking that it might work something like the attached (if you
don't see any attached, let me know and I'll upload it somewhere). The
interesting bits are in CModalStateDlg::OnBnClickedButton1() and
CWaitForAsyncOperationDialog.

This pattern generally works pretty well. I've used it in the past.

Where I'm a little unsure is where to attach this to TortoiseProc. I
could implement it in CCommitDlg::OnBnClickedBugtextbutton, or I could
put it in CHooks::RunScript. That might require that RunScript be passed
an hWnd to parent to. Currently, CHooks doesn't have much in the way of
UI knowledge, and I'm reluctant to change that.

Thoughts or comments?

Cheers,
Roger.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_tortoisesvn.tigris.org
For additional commands, e-mail: dev-help_at_tortoisesvn.tigris.org

Received on 2008-04-19 19:28:51 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.