]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix compilation warnings with wxWidgets 2.6.0.
authorNicolas Boichat <nicolas@boichat.ch>
Tue, 3 May 2005 19:32:39 +0000 (19:32 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Tue, 3 May 2005 19:32:39 +0000 (19:32 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1989 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/wx-console/CHANGELOG
bacula/src/wx-console/wxbmainframe.cpp
bacula/src/wx-console/wxbrestorepanel.cpp
bacula/src/wx-console/wxbutils.cpp
bacula/src/wx-console/wxbutils.h

index 7f43e38a43219b5f8a10dc08e607af29635129c9..0c6ff41503948ac1cb7819b48922337259b5fb56 100644 (file)
@@ -1,4 +1,5 @@
 03-05-2005:
+ - Fix compilation warnings with wxWidgets 2.6.0.
  - Fix wxChoice height problem under wxGTK-2.6.0 (GTK+-2.0).
 
 26-04-2005 :
index d1373d97487c859c6ded88dfd9484f2fbab2e3f8..b261eac351482b7dee6dd3ace0e644dd7620cd46 100644 (file)
@@ -301,7 +301,11 @@ wxbMainFrame::wxbMainFrame(const wxString& title, const wxPoint& pos, const wxSi
 
    wxBoxSizer* globalSizer = new wxBoxSizer(wxHORIZONTAL);
 
+#if wxCHECK_VERSION(2, 6, 0)
+   globalSizer->Add(notebook, 1, wxEXPAND, 0);
+#else
    globalSizer->Add(new wxNotebookSizer(notebook), 1, wxEXPAND, 0);
+#endif
 
    global->SetSizer( globalSizer );
    globalSizer->SetSizeHints( global );
index ff9840a922d8ff8f2222830412a0103066c04b79..a08b606be95a487e1bd5fe82438fec98ec0eed64 100644 (file)
@@ -610,7 +610,7 @@ void wxbRestorePanel::CmdStart() {
    
       while (!tableparser->hasFinished() && !dt->hasFinished()) {
          wxTheApp->Yield(true);
-         ::wxUsleep(100);
+         wxbUtils::MilliSleep(100);
       }
       
       wxString str;
@@ -690,7 +690,7 @@ void wxbRestorePanel::CmdStart() {
             }
          }
          wxTheApp->Yield(true);
-         ::wxUsleep(1);
+         wxbUtils::MilliSleep(1);
       }
 
       gauge->SetValue(tot);
@@ -947,7 +947,7 @@ void wxbRestorePanel::CmdStart() {
          wxStopWatch sw2;
          while (sw2.Time() < 10000) {  
             wxTheApp->Yield(true);
-            ::wxUsleep(100);
+            wxbUtils::MilliSleep(100);
          }
          
          if (ended) {
@@ -988,7 +988,7 @@ void wxbRestorePanel::CmdCancel() {
    wxStopWatch sw;
    while ((IsWorking()) && (cancelled != 2)) {
       wxTheApp->Yield(true);
-      ::wxUsleep(100);
+      wxbUtils::MilliSleep(100);
       if (sw.Time() > 30000) { /* 30 seconds timeout */
          if (status == choosing) {
             wxbMainFrame::GetInstance()->Send("quit\n");
@@ -1000,7 +1000,7 @@ void wxbRestorePanel::CmdCancel() {
             
          }
          SetStatus(finished);
-         ::wxUsleep(1000);
+         wxbUtils::MilliSleep(1000);
          return;
       }
    }
@@ -1015,7 +1015,7 @@ void wxbRestorePanel::CmdCancel() {
    default:
       break;
    }
-   ::wxUsleep(1000);
+   wxbUtils::MilliSleep(1000);
    SetStatus(finished);
 }
 
@@ -1178,7 +1178,7 @@ void wxbRestorePanel::CmdListJobs() {
 
       while (!tableparser->hasFinished()) {
          wxTheApp->Yield(true);
-         ::wxUsleep(100);
+         wxbUtils::MilliSleep(100);
       }
          
       if (!tableparser->GetCount() == 0) {
@@ -1414,7 +1414,12 @@ void wxbRestorePanel::UpdateTreeItem(wxTreeItemId item, bool updatelist, bool re
       if (file[8].GetChar(file[8].Length()-1) == '/') {
          wxString itemStr;
 
+#if wxCHECK_VERSION(2, 6, 0)
+         wxTreeItemIdValue cookie;
+#else
          long cookie;
+#endif
+         
          treeid = tree->GetFirstChild(item, cookie);
 
          bool updated = false;
@@ -1521,7 +1526,11 @@ void wxbRestorePanel::SetListItemState(long listitem, int newstate) {
 
 /* Sets a tree item state, and update its children, parents and list (if necessary) */
 void wxbRestorePanel::SetTreeItemState(wxTreeItemId item, int newstate) {
+#if wxCHECK_VERSION(2, 6, 0)
+   wxTreeItemIdValue cookie;
+#else
    long cookie;
+#endif
    wxTreeItemId currentChild = tree->GetFirstChild(item, cookie);
 
    wxbTreeItemData* itemdata;
@@ -1563,7 +1572,11 @@ void wxbRestorePanel::UpdateTreeItemState(wxTreeItemId item) {
    
    int state = 0;
        
+#if wxCHECK_VERSION(2, 6, 0)
+   wxTreeItemIdValue cookie;
+#else
    long cookie;
+#endif
    wxTreeItemId currentChild = tree->GetFirstChild(item, cookie);
 
    bool onechildmarked = false;
@@ -1665,7 +1678,11 @@ void wxbRestorePanel::RefreshTree() {
    bool match;
    
    for (int i = current.Count()-1; i >= 0; i--) {
+#if wxCHECK_VERSION(2, 6, 0)
+      wxTreeItemIdValue cookie;
+#else
       long cookie;
+#endif
       wxTreeItemId currentChild = tree->GetFirstChild(item, cookie);
       
       match = false;
@@ -2150,7 +2167,11 @@ void wxbRestorePanel::OnListActivated(wxListEvent& event) {
 
       wxString itemStr;
 
+#if wxCHECK_VERSION(2, 6, 0)
+      wxTreeItemIdValue cookie;
+#else
       long cookie;
+#endif
 
       if (name.GetChar(name.Length()-1) == '/') {
          wxTreeItemId currentChild = tree->GetFirstChild(currentTreeItem, cookie);
index 7b82906184addc1ede1d5dc3d19029290b6728ca..7a1c515d2b9d6d3845a3929a87a4281f9b1b0d47 100644 (file)
 
 bool wxbUtils::inited = false;
 
+/* Sleeps during milliseconds (wrapper for wxUsleep (2.4) or wxMilliSleep (2.6)) */
+void wxbUtils::MilliSleep(unsigned long milliseconds) {
+#if wxCHECK_VERSION(2, 6, 0)
+   ::wxMilliSleep(milliseconds);
+#else
+   ::wxUsleep(milliseconds);
+#endif
+}
+
 /* Initialization */
 void wxbUtils::Init() {
    inited = true;
@@ -57,7 +66,7 @@ wxbTableParser* wxbUtils::CreateAndWaitForParser(wxString cmd) {
    while (!tableParser->hasFinished()) {
       //innerThread->Yield();
       wxTheApp->Yield(true);
-      ::wxUsleep(100);
+      wxbUtils::MilliSleep(100);
       //if (base+15 < wxDateTime::Now().GetTicks()) break;
    }
    return tableParser;
@@ -75,7 +84,7 @@ wxbPromptParser* wxbUtils::WaitForPrompt(wxString cmd, bool keepresults) {
    while (!promptParser->hasFinished()) {
       //innerThread->Yield();
       wxTheApp->Yield(true);
-      ::wxUsleep(100);
+      wxbUtils::MilliSleep(100);
       //if (base+15 < wxDateTime::Now().GetTicks()) break;
    }
      
@@ -100,7 +109,7 @@ wxbDataTokenizer* wxbUtils::WaitForEnd(wxString cmd, bool keepresults, bool line
    while (!datatokenizer->hasFinished()) {
       //innerThread->Yield();
       wxTheApp->Yield(true);
-      ::wxUsleep(100);
+      wxbUtils::MilliSleep(100);
       //if (base+15 < wxDateTime::Now().GetTicks()) break;
    }
    
index 6fa822ed22d6ddca1732d58457e87a12974b569b..155b1a4368d0e434892b07a6ad87ee6ccab45f79 100644 (file)
@@ -63,6 +63,9 @@ class wxbUtils
        * if keepresults is true, returns a valid pointer to a wxbPromptParser
        * containing the data. */
       static wxbPromptParser* WaitForPrompt(wxString cmd, bool keepresults = false);
+      
+      /* Sleeps during milliseconds (wrapper for wxUsleep (2.4) or wxMilliSleep (2.6)) */
+      static void MilliSleep(unsigned long milliseconds);
 
    private:
       static bool inited;