Wait Timer for Commands in TaskDialog library


I’ve got several requests to implement timer functionality in TaskDialog commands.  The latest code drop contains requested changes. This is a preliminary design and I invite a discussion on implementation which would cover the most common use cases.

Here are the main points of current implementation:

TaskDialog.Command interface now includes getWaitInterval function which should return required wait interval in seconds.
TaskDialog.StandardCommand
by default returns 0, but includes new variant of the derive function with additional waitInterval parameter. This allows for adding custom commands with specified wait interval.

How would we do it with our very convenient methods from TaskDialogs class? By passing special commands with instruction text. Following will show a warning dialog with wait interval of 10 seconds.

TaskDialogs.warn( "Are you sure you want to quit?@@10", "Please do not quit yet!");


This works on all TaskDialogs methods except choice and showException.
My current feeling is that more work is required to make it perfect.

As always… Your comments and suggestions are welcome 🙂
The project is available at http://code.google.com/p/oxbow under BSD license.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s