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

Modified Files:
        AudacityApp.cpp AudacityApp.h Makefile.in Menus.cpp Menus.h 
        Project.h 
Log Message:
Add FileHistory class to correct Unicode problem with wxFileHistory on OSX
and to allow adding "Clear" item at end of menu instead of beginning.


Index: Project.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.h,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- Project.h   31 Mar 2009 16:51:31 -0000      1.152
+++ Project.h   14 Apr 2009 05:25:32 -0000      1.153
@@ -39,8 +39,6 @@
 #include <wx/intl.h>
 #include <wx/dcclient.h>
 
-class wxFileHistory;
-
 const int AudacityProjectTimerID = 5200;
 
 class wxWindow;

Index: Makefile.in
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Makefile.in,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -d -r1.154 -r1.155
--- Makefile.in 25 Mar 2009 23:17:23 -0000      1.154
+++ Makefile.in 14 Apr 2009 05:25:32 -0000      1.155
@@ -200,6 +200,7 @@
        widgets/AttachableScrollBar.o \
        widgets/ErrorDialog.o \
        widgets/ExpandingToolBar.o \
+       widgets/FileHistory.o \
        widgets/Grabber.o \
        widgets/Grid.o \
        widgets/HtmlWindow.o \

Index: AudacityApp.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityApp.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- AudacityApp.h       30 Mar 2009 11:43:12 -0000      1.51
+++ AudacityApp.h       14 Apr 2009 05:25:32 -0000      1.52
@@ -23,6 +23,8 @@
 #include <wx/snglinst.h>
 #include <wx/log.h>
 
+#include "widgets/FileHistory.h"
+
 class IPCServ;
 class Importer;
 
@@ -105,6 +107,7 @@
    void OnReleaseKeyboard(wxCommandEvent & event);
 
    // Most Recently Used File support (for all platforms).
+   void OnMRUClear(wxCommandEvent &event);
    void OnMRUFile(wxCommandEvent &event);
 // void OnMRUProject(wxCommandEvent &event);
    // Backend for above - returns true for success, false for failure
@@ -146,14 +149,14 @@
                                    int flags, // wxFILE, wxDIR, or 0
                                    wxArrayString &results);
 
-   wxFileHistory *GetRecentFiles() {return mRecentFiles;}
+   FileHistory *GetRecentFiles() {return mRecentFiles;}
    void AddFileToHistory(const wxString & name);
 
    Importer *mImporter;
 
    wxLogWindow *mLogger;
  private:
-   wxFileHistory *mRecentFiles;
+   FileHistory *mRecentFiles;
 
    wxLocale *mLocale;
 

Index: AudacityApp.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityApp.cpp,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -d -r1.228 -r1.229
--- AudacityApp.cpp     30 Mar 2009 17:17:17 -0000      1.228
+++ AudacityApp.cpp     14 Apr 2009 05:25:32 -0000      1.229
@@ -473,6 +473,7 @@
    EVT_COMMAND(wxID_ANY, EVT_OPEN_AUDIO_FILE, AudacityApp::OnMacOpenFile)
 #endif
    // Recent file event handlers.  
+   EVT_MENU(wxID_FILE, AudacityApp::OnMRUClear)
    EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, AudacityApp::OnMRUFile)
 // EVT_MENU_RANGE(6050, 6060, AudacityApp::OnMRUProject)
 END_EVENT_TABLE()
@@ -532,6 +533,11 @@
    return(true);
 }
 
+void AudacityApp::OnMRUClear(wxCommandEvent& event)
+{
+   mRecentFiles->Clear();
+}
+
 void AudacityApp::OnMRUFile(wxCommandEvent& event) {
    AudacityProject *proj = GetActiveProject();
 
@@ -643,10 +649,8 @@
        #endif
 
    // TODO - read the number of files to store in history from preferences
-   mRecentFiles = new wxFileHistory(/* number of files */);
-   gPrefs->SetPath(wxT("/RecentFiles"));
-   mRecentFiles->Load(*gPrefs);
-   gPrefs->SetPath(wxT(".."));
+   mRecentFiles = new FileHistory(/* number of files */);
+   mRecentFiles->Load(*gPrefs, wxT("RecentFiles"));
 
    //
    // Paths: set search path and temp dir path
@@ -1370,9 +1374,7 @@
       }
    }
 
-   gPrefs->SetPath(wxT("/RecentFiles"));
-   mRecentFiles->Save(*gPrefs);
-   gPrefs->SetPath(wxT(".."));
+   mRecentFiles->Save(*gPrefs, wxT("RecentFiles"));
    delete mRecentFiles;
 
    FinishPreferences();

Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.470
retrieving revision 1.471
diff -u -d -r1.470 -r1.471
--- Menus.cpp   10 Apr 2009 14:28:04 -0000      1.470
+++ Menus.cpp   14 Apr 2009 05:25:32 -0000      1.471
@@ -1158,11 +1158,6 @@
    mRecentFilesMenu = c->BeginSubMenu(_("Recent &Files"));
 #endif
 
-   c->AddItem(wxT("ClearRecent"),  _("Clear"), FN(OnClearRecent));
-   c->SetCommandFlags(wxT("ClearRecent"),
-                      HaveRecentFiles, HaveRecentFiles);
-
-
    wxGetApp().GetRecentFiles()->UseMenu(mRecentFilesMenu);
    wxGetApp().GetRecentFiles()->AddFilesToMenu(mRecentFilesMenu);
 
@@ -2526,15 +2521,6 @@
    }
 #endif
 
-void AudacityProject::OnClearRecent()
-{
-   wxFileHistory *h = wxGetApp().GetRecentFiles();
-   while (h->GetCount()) {
-      h->RemoveFileFromHistory(0);
-   }
-}
-
-
 void AudacityProject::OnCheckDependencies()
 {
    ShowDependencyDialogIfNeeded(this, false);

Index: Menus.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.h,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- Menus.h     30 Mar 2009 11:07:35 -0000      1.132
+++ Menus.h     14 Apr 2009 05:25:32 -0000      1.133
@@ -163,7 +163,6 @@
 #ifdef USE_LIBVORBIS
    void OnSaveCompressed();
 #endif
-void OnClearRecent();
 
 void OnCheckDependencies();
 


------------------------------------------------------------------------------
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