Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Don't annoy me again!
Alpha:
As there seem to be no objections, I will commit the conversion soon (including contrib plugins).
Alpha:
Hmm... I just discovered a rather major design flaw in my plan. If I set the "Layout changed" dialogue to rtSAVE_CHOICE, the user could potentially save rtCANCEL, which would cause strange errors of sometimes not being able to switch layouts. If I do the following, the behavior will be inconsistent:
--- Code: ---Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 9113)
+++ src/src/main.cpp (working copy)
@@ -1488,7 +1488,9 @@
AnnoyingDialog dlg(_("Layout changed"),
wxString::Format(_("The perspective '%s' has changed. Do you want to save it?"), m_LastLayoutName.wx_str()),
wxART_QUESTION,
- canCancel ? AnnoyingDialog::YES_NO_CANCEL : AnnoyingDialog::YES_NO);
+ canCancel ? AnnoyingDialog::YES_NO_CANCEL : AnnoyingDialog::YES_NO,
+ // do not let the user save 'rtCANCEL' otherwise we will have problems...
+ canCancel ? AnnoyingDialog::rtYES : AnnoyingDialog::rtSAVE_CHOICE);
switch (dlg.ShowModal())
{
case AnnoyingDialog::rtYES:
--- End code ---
Also, in this situation, if the user checked do not annoy, and pressed 'No' (such that rtNO is saved), then the layout will still be saved when cancel is enabled because the previous return type is only read if the dialogue specifies rtSAVE_CHOICE.
Ideas?
Navigation
[0] Message Index
[*] Previous page
Go to full version