Update of /cvsroot/audacity/audacity-src/src/widgets
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20905/src/widgets

Modified Files:
        Warning.cpp 
Log Message:
Warning true state now means "Show" instead of "Hide".


Index: Warning.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/widgets/Warning.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Warning.cpp 3 Jun 2008 07:16:47 -0000       1.9
+++ Warning.cpp 9 Apr 2009 07:34:01 -0000       1.10
@@ -36,8 +36,6 @@
    // constructors and destructors
    WarningDialog(wxWindow *parent, 
                  wxString message);
-
-   bool dontShow;
    
  private:
    void OnOK(wxCommandEvent& event);
@@ -52,8 +50,7 @@
 END_EVENT_TABLE()
 
 WarningDialog::WarningDialog(wxWindow *parent, wxString message)
-:  wxDialog(parent, wxID_ANY, (wxString)_("Warning")),
-   dontShow( false )
+:  wxDialog(parent, wxID_ANY, (wxString)_("Warning"))
 {
    ShuttleGui S(this, eIsCreating);
 
@@ -61,44 +58,33 @@
    S.StartVerticalLay(false);
    {
       S.AddUnits(message);
-      mCheckBox = S.TieCheckBox(_("Don't show this warning again"), dontShow);
+      mCheckBox = S.AddCheckBox(_("Don't show this warning again"), 
wxT("false"));
    }
 
    S.SetBorder(0);
    S.AddStandardButtons(eOkButton);
 
    Fit();
+   CentreOnParent();
 }
 
 void WarningDialog::OnOK(wxCommandEvent& event)
 {
-   dontShow = mCheckBox->GetValue();
-
-   EndModal(wxID_OK);
+   EndModal(mCheckBox->GetValue() == false);
 }
 
 void ShowWarningDialog(wxWindow *parent,
                        wxString internalDialogName,
                        wxString message)
 {
-   bool dontShow = false;
-
-   gPrefs->SetPath(wxT("/Warnings"));
-   gPrefs->Read(internalDialogName, &dontShow, false);
-   gPrefs->SetPath(wxT("/"));
-
-   if (dontShow)
+   wxString key(wxT("/Warnings/") + internalDialogName);
+   if (!gPrefs->Read(key, (long) true)) {
       return;
+   }
 
    WarningDialog dlog(parent, message);
-   dlog.CentreOnParent();
-   dlog.ShowModal();
 
-   if (dlog.dontShow) {
-      gPrefs->SetPath(wxT("/Warnings"));
-      gPrefs->Write(internalDialogName, true);
-      gPrefs->SetPath(wxT("/"));
-   }
+   gPrefs->Write(key, (bool) dlog.ShowModal());
 }
 
 // Indentation settings for Vim and Emacs and unique identifier for Arch, a


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to