John Anderson wrote:
wxMessageBox(errText, _(u"Flickr Error"), wx.OK)

I was suggesting to Ted that that the native wx routines were about as simple as any wrapper routines we could write so I would prefer to get rid of the wrappers. Ted on the otherhand thought that for simple parcels you shouldn't need to know any wx so the wrapper routines were appropriate.

I have since wrapped the wrappers.. but why you may ask? To allow a preference to override the display of the box in the first place. This is for both CATS and for allowing the "Always ask" checkbox that is often seen in modal dialogs. However I haven't written the UI for "Always ask.." just yet. At the moment it still just uses wx.MessageBox

To use the pref-aware wrappers, you can say:

from osaf.framework.prompts import promptYesNoCancel

answer = promptYesNoCancel(_(u'Do you want to do this?'))

If you want to include a pref, you can say:

confirmationPref = schema.ns('foo.bar').myPref
answer = promptYesNoCancel(_(u'Do you want to do this?'), confirmationPref)

This will:
1) prompt the user if the confirmationPref says it should
2) If the user checks off the 'Always Ask' checkbox, then the next time that promptYesNoCancel is called, no dialog will pop up and the result will just be the same as the previous answer.

Alec

So I thought I'd ask for opinions on which option other people prefer.

John
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to