Update of /cvsroot/audacity/audacity-src/src/prefs
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv1749/prefs

Modified Files:
        DirectoriesPrefs.cpp KeyConfigPrefs.cpp 
Log Message:
1) Rework of XML file writing.
2) Cleaned up old (FROM)FILENAME() macro usage and added OSFILENAME() usage 
only where needed.
3) Removed Mac specific filename encodings as it's handled by WX now.
4) Fixed a couple of missing wxT()s (one resulted in a day or so debugging 
session ;-)).
5) Commented all PACKAGE_* macros in configtemplate.h as they conflict with the 
latest SoundTouch.


Index: DirectoriesPrefs.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/prefs/DirectoriesPrefs.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- DirectoriesPrefs.cpp        19 Jul 2006 20:55:30 -0000      1.30
+++ DirectoriesPrefs.cpp        23 Sep 2006 02:27:14 -0000      1.31
@@ -189,7 +189,7 @@
             wxYES_NO|wxCENTRE|wxICON_EXCLAMATION);
 
       if(ans == wxYES) {
-         if(!wxMkdir(FILENAME(mTempDir), 0755)) {
+         if(!wxMkdir(mTempDir, 0755)) {
             /* wxWindows throws up a decent looking dialog */
             return false;
          }
@@ -202,14 +202,14 @@
       /* If the directory already exists, make sure it is writable */
       wxLogNull logNo;
       wxString tempDir = mTempDir + wxFILE_SEP_PATH + wxT("canicreate");
-      if(!wxMkdir(FILENAME(tempDir), 0755)) {
+      if(!wxMkdir(tempDir, 0755)) {
          wxMessageBox(
                wxString::Format(_("Directory %s is not writable"),
                                 mTempDir.c_str()),
                _("Error"), wxOK|wxICON_ERROR);
          return false;
       }
-      wxRmdir(FILENAME(tempDir));
+      wxRmdir(tempDir);
    }
 
    gPrefs->Write(wxT("/Directories/TempDir"), mTempDir);

Index: KeyConfigPrefs.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/prefs/KeyConfigPrefs.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- KeyConfigPrefs.cpp  4 Aug 2006 03:53:21 -0000       1.64
+++ KeyConfigPrefs.cpp  23 Sep 2006 02:27:14 -0000      1.65
@@ -155,7 +155,7 @@
 
    wxString fName = wxT("Audacity-keys.xml");
    wxString path = gPrefs->Read(wxT("/DefaultExportPath"),
-                                FROMFILENAME(::wxGetCwd()));
+                                ::wxGetCwd());
 
    fName = wxFileSelector(_("Export Keyboard Shortcuts As:"),
                           NULL,
@@ -169,7 +169,9 @@
    path = wxPathOnly(fName);
    gPrefs->Write(wxT("/DefaultExportPath"), path);
 
-   wxFFile prefFile(FILENAME(fName).c_str(), wxT("wb"));
+   XMLFileWriter prefFile;
+   
+   prefFile.Open(fName, wxT("wb"));
 
    if (!prefFile.IsOpened()) {
       wxMessageBox(_("Couldn't write to file: ") + fName,
@@ -178,14 +180,15 @@
       return;
    }
 
-   mManager->WriteXML(0, prefFile.fp());
+   mManager->WriteXML(prefFile);
+
    prefFile.Close();
 }
 
 void KeyConfigPrefs::OnLoad(wxCommandEvent& event)
 {
    wxString path = gPrefs->Read(wxT("/DefaultOpenPath"),
-                                FROMFILENAME(::wxGetCwd()));
+                                ::wxGetCwd());
 
    wxString fileName = wxFileSelector(_("Select an XML file containing 
Audacity keyboard shortcuts..."),
                                       path,     // Path


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to