From: Nicolas Boichat Date: Tue, 3 May 2005 19:32:39 +0000 (+0000) Subject: Fix compilation warnings with wxWidgets 2.6.0. X-Git-Tag: Release-1.38.0~509 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=47fb422d06218c71efec47da108c8c6e69cc13be;p=bacula%2Fbacula Fix compilation warnings with wxWidgets 2.6.0. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1989 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/wx-console/CHANGELOG b/bacula/src/wx-console/CHANGELOG index 7f43e38a43..0c6ff41503 100644 --- a/bacula/src/wx-console/CHANGELOG +++ b/bacula/src/wx-console/CHANGELOG @@ -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 : diff --git a/bacula/src/wx-console/wxbmainframe.cpp b/bacula/src/wx-console/wxbmainframe.cpp index d1373d9748..b261eac351 100644 --- a/bacula/src/wx-console/wxbmainframe.cpp +++ b/bacula/src/wx-console/wxbmainframe.cpp @@ -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 ); diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index ff9840a922..a08b606be9 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -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); diff --git a/bacula/src/wx-console/wxbutils.cpp b/bacula/src/wx-console/wxbutils.cpp index 7b82906184..7a1c515d2b 100644 --- a/bacula/src/wx-console/wxbutils.cpp +++ b/bacula/src/wx-console/wxbutils.cpp @@ -37,6 +37,15 @@ 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; } diff --git a/bacula/src/wx-console/wxbutils.h b/bacula/src/wx-console/wxbutils.h index 6fa822ed22..155b1a4368 100644 --- a/bacula/src/wx-console/wxbutils.h +++ b/bacula/src/wx-console/wxbutils.h @@ -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;