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

Re: Proposal: Adding a class to automatically manage the wait cursor and OK button enabled status

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Sun, 02 Jun 2013 13:20:27 +0200

On 01.06.2013 21:25, Friedrich Brunzema wrote:
>> I like your suggestion. Will do as you suggest and keep the class
>> just for the Wait cursor - even though then it really does not do
>> much. Still its nice not to have to worry about undoing an action
>> at every function exit.
>>
>> Friedrich
>
> OK, I have reverted the changes and replaced all instances of
> DoWaitCursor() with a CLogWndHourglass local variable (see the
> attached patch).
>
> I have not really seriously tested it, but something already feels
> wrong about it. I'm not really sure what the hourglass desired
> behavior is during a long operation that does a spawn process. Have
> a look - I'm OK if we don't make the changes and let the reverted
> code stand as is. If we don't end up using the CLowWndHourglass
> class, I should remove it.

As I mentioned before: setting the cursor with your helper class only
works if the long-running operation is *not* done on a different thread.
Because it only works as long as the UI message queue is not handled. As
soon as the message queue is handled again the cursor is reset by that
message handling (See OnSetCursor() ).

That's why in OnSetCursor(), we determine whether a thread is currently
running and set the wait cursor there if there is one running.

So: you only need to use your helper class for non-thread operations.
But it doesn't hurt if you use it for thread operations as well: it just
won't do anything.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest interface to (Sub)version control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3056896
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2013-06-02 13:20:34 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.