[patch] break glib bindings by adding timeout_milliseconds

Thiago Macieira thiago.macieira at trolltech.com
Wed Mar 1 02:26:02 PST 2006


David Zeuthen wrote:
>I think it comes down to whether we want to support methods that can
>take minutes, hours, even months (for e.g. Hibernate) to return. If we
>don't we may as well hide the concept of timeouts from the application
>developers completely. Perhaps this is why it was omitted in the glib
>bindings.

I support that.

Methods that know they will take a long time to complete its work should 
instead use signals. The return value should be whether the call 
succeeded or not -- e.g., the user may not be allowed to place the 
machine in hibernation; hibernating is not available on this computer, 
etc.

Then it should communicate via signals: AboutToHibernate and 
ReturnFromHibernate, for instance.

Your example about formatting hard-disks could also use a signal 
FormattingPercept with an integer from 0 to 100 describing how much is 
complete.

The rationale is very simple: if a method takes a long time to complete 
and was called as a result of user interaction, there should be some kind 
of indication to the user that the call was made and there should be some 
feedback, in the form of growing progress bars or a simple "Erasing all 
your data, please wait" dialog box with no Cancel button.

-- 
Thiago José Macieira - thiago.macieira AT trolltech.com
Trolltech AS - Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060301/d8af47a0/attachment.pgp


More information about the dbus mailing list