[sword-devel] installmgr warning dialog and confirmation (Re: [bt-devel] Bibletime 2.0.alpha3 FTBFS with sword 1.6.0RC1 library)

Eeli Kaikkonen eekaikko at mail.student.oulu.fi
Tue Apr 21 23:23:53 MST 2009


Quoting "Troy A. Griffitts" <scribe at crosswire.org>:

> All the InstallMgr calls which perform remote access now check if bool
> isUserDisclaimerConfirmed() returns true before performing their
> operation.
> Would it be useful to you, as a frontend programmer wishing to satisfy
> this criteria in Bibletime, to have isUserDisclaimerConfirmed be made a
> virtual method, which always returns false in the default impl (not
> pure virtual since installmgr can still be useful for local/CD
> installation).  Then we would remove setUserDisclaimerConfirmed(bool).
>
> This would essential mandate a best practices methodology for
> confirming that the user has accepted the disclaimer.  Something like:
>
> bool MyInstallMgr::isUserDisclaimerConfirmed() {
>    static bool confirmed = false;
>    if (!confirmed) {
>       confirmed = (showDisclaimerDialog() == mbOk);
>    }
> }
>
> Then the first time the user attempts a remote activity, InstallMgr
> checks isUserDisclaimerConfirmed() and your confirmation method is
> shown.  Obviously, if you'd rather choose to show the disclaimer at an
> earlier point, you can always call isUserDisclaimerConfirmed() yourself
> to trigger your confirmation method.
>
> What do you think?

Yes, that would be good. A virtual method is the most flexible way to  
handle this. The setter is not needed if the class is subclassed  
anyways. If a class is rarely subclassed but used on its own it's  
annoying to override one method just because there's no setter, but in  
this case the setter is not needed.

As a side note, personally I would go even further and put a "don't  
show this warning anymore" checkbox in the dialog. The result would be  
saved in the user configuration, so he doesn't need to answer that  
question again after quitting and starting BibleTime.

--Eeli Kaikkonen




More information about the sword-devel mailing list