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

Modified Files:
        DirectoriesPrefs.h DirectoriesPrefs.cpp 
Log Message:
Fix for include space display in Dependencies dialog

Index: DirectoriesPrefs.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/prefs/DirectoriesPrefs.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- DirectoriesPrefs.h  6 Jun 2006 11:40:44 -0000       1.6
+++ DirectoriesPrefs.h  30 Sep 2006 03:24:57 -0000      1.7
@@ -34,7 +34,6 @@
    void PopulateOrExchange( ShuttleGui & S );
    void UpdateFreeSpace(wxCommandEvent &event);
    void OnChooseTempDir(wxCommandEvent &event);
-   wxString FormatSize(wxLongLong size);
 
    wxString mStrFreeSpace;
    wxStaticBox *mEnclosingBox;

Index: DirectoriesPrefs.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/prefs/DirectoriesPrefs.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- DirectoriesPrefs.cpp        23 Sep 2006 02:27:14 -0000      1.31
+++ DirectoriesPrefs.cpp        30 Sep 2006 03:24:57 -0000      1.32
@@ -67,7 +67,7 @@
    //BG: wxWindows 2.3.2 and higher claim to support this, through a function 
called wxGetDiskSpace
    wxLongLong freeSpace;
    wxGetDiskSpace(mTempDir, NULL, &freeSpace);
-   mStrFreeSpace = FormatSize(freeSpace);
+   mStrFreeSpace = Internat::FormatSize(freeSpace);
    //------------------------- Main section --------------------
    // Now construct the GUI itself.
    // Use 'eIsCreatingFromPrefs' so that the GUI is 
@@ -108,34 +108,6 @@
    S.EndStatic();
 }
 
-wxString DirectoriesPrefs::FormatSize(wxLongLong size)
-{
-   wxString sizeStr;
-
-   /* wxLongLong contains no built-in conversion to double */
-   double dSize = size.GetHi() * pow(2.0, 32);  // 2 ^ 32
-   dSize += size.GetLo();
-
-   if (size == -1L)
-      sizeStr = _("Unable to determine");
-   else {
-      /* make it look nice, by formatting into k, MB, etc */
-      if (size < 1024)
-         sizeStr.sprintf(wxT("%ld bytes"), size.GetLo());
-      else if (size < 1024 * 1024) {
-         sizeStr.sprintf(wxT("%.1f kB"), dSize / 1024);
-      }
-      else if (size < 1024 * 1024 * 1024) {
-         sizeStr.sprintf(wxT("%.1f MB"), dSize / (1024 * 1024));
-      }
-      else {
-         sizeStr.sprintf(wxT("%.1f GB"), dSize / (1024 * 1024 * 1024));
-      }
-   }
-
-   return sizeStr;
-}
-
 void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent &event)
 {
    wxDirDialog dlog(this, 
@@ -174,7 +146,7 @@
 
    //BG: wxWindows 2.3.2 and higher claim to support this, through a function 
called wxGetDiskSpace
    wxGetDiskSpace(tempDir, NULL, &space);
-   mFreeSpace->SetLabel(FormatSize(space));
+   mFreeSpace->SetLabel(Internat::FormatSize(space));
 }
    
 bool DirectoriesPrefs::Apply()


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