Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Don't annoy me again!

(1/4) > >>

Alpha:
Annoying dialogues a great, however I think in most cases, the user expects the dialogue to remember their choice when they dismiss the dialogue (ex. here), not use a default value.
Of course, for some situations (rebuild confirmation, clean project confirmation, ...) this does not make sense (as that could make the rebuild button useless).

I want to allow annoying dialogues to be (optionally) set to remember what the user clicked when they dismissed it.  Any thoughts on this?

oBFusCATed:

--- Quote from: Alpha on May 02, 2013, 04:24:35 am ---Any thoughts on this?

--- End quote ---
Go on and show a patch, so we can discuss the implementation.

Alpha:
Oops, I forgot I was working on this.  Here is a patch.

oBFusCATed:
1. ADRet is quite confusing, something longer should be used here. Being verbose is no such problem.
2. AD_SAVE_CHOICE should be a constant and it should not be in the header
3. Mixing eol changes with other changes is not good!
4. Converting wxID_????? to string is dangerous, you should define your own constants.
    Probably an enum, which is stable with different versions of wx.
5. Some comments are needed in regard to the formatting of the string. BeforeLast and After
6. What will happen if you use older C::B with newconfig? Probably you should use another config path.

Alpha:

--- Quote from: oBFusCATed on May 08, 2013, 10:03:33 pm ---1. ADRet is quite confusing, something longer should be used here. Being verbose is no such problem.
[...]
5. Some comments are needed in regard to the formatting of the string. BeforeLast and After

--- End quote ---
Will do.


--- Quote from: oBFusCATed on May 08, 2013, 10:03:33 pm ---2. AD_SAVE_CHOICE should be a constant and it should not be in the header

--- End quote ---
It is in the header so other files can use it:

--- Code: ---AnnoyingDialog dlg(_("XYZ question?"), msg, wxART_INFORMATION,
                   AnnoyingDialog::YES_NO, AD_SAVE_CHOICE);

--- End code ---
Is static const int the preferred type?


--- Quote from: oBFusCATed on May 08, 2013, 10:03:33 pm ---3. Mixing eol changes with other changes is not good!

--- End quote ---
Oops...
I see, I format.  Bad habit.


--- Quote from: oBFusCATed on May 08, 2013, 10:03:33 pm ---4. Converting wxID_????? to string is dangerous, you should define your own constants.
    Probably an enum, which is stable with different versions of wx.

--- End quote ---
The problem with defining my own enums, is that the parameter for default return type could *technically* be any number (not just the specific ones I registered).  How should I handle an unknown return type?  Currently, I always save the default type when AD_SAVE_CHOICE is not specified.  This is so it will show up in the dismissed dialogues box with the choice it will use.


--- Quote from: oBFusCATed on May 08, 2013, 10:03:33 pm ---6. What will happen if you use older C::B with newconfig? Probably you should use another config path.

--- End quote ---
Don't.  Unless you want to be annoyed, because all the annoying dialogues will pop up again.

Navigation

[0] Message Index

[#] Next page

Go to full version