]> Creatis software - creaImageIO.git/commitdiff
correction bug Fedora 64 bits
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Fri, 28 Jan 2011 14:29:44 +0000 (14:29 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Fri, 28 Jan 2011 14:29:44 +0000 (14:29 +0000)
src/creaImageIOWxGimmickView.cpp
src/creaImageIOWxGimmickView.h

index 9c0d327057be53dbebbde686e7a770226129203e..fc748e0aa2ebd31f5b5bd8599d286ba40ddbb898 100644 (file)
@@ -514,7 +514,7 @@ namespace creaImageIO
        mProgressDialog->Pulse(_T("Updating view..."));
 
        UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
-       delete mProgressDialog;
+       killProgress();
        DisplayAddSummary();    
 
       }
@@ -564,7 +564,7 @@ namespace creaImageIO
                mProgressDialog->Pulse(_T("Updating view..."));
 
                UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
-               delete mProgressDialog;
+               killProgress();
                DisplayAddSummary();
          }
     mViewer->StartPlayer();
@@ -833,7 +833,7 @@ namespace creaImageIO
      mProgressDialog->Pulse(_T("Updating view..."));
 
      UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
-     delete mProgressDialog;
+     killProgress();
      DisplayAddSummary();
   }
 
@@ -978,7 +978,7 @@ namespace creaImageIO
        std::cout <<"after mProgressDialog->Pulse" << std::endl;
                                                UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
        std::cout <<"after UpdateTreeViewLevel" << std::endl;                                           
-                                               delete mProgressDialog;
+                                               killProgress();
        std::cout <<"after delete mProgressDialog" << std::endl;                                                        
                                                DisplayAddSummary();
        std::cout <<"after dDisplayAddSummary" << std::endl;                                            
@@ -1100,7 +1100,7 @@ namespace creaImageIO
                mProgressDialog->Pulse(_T("Updating view..."));
                
                UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
-               delete mProgressDialog;
+               killProgress();
                DisplayAddSummary();
                mViewer->StartPlayer();  
          }
@@ -1172,7 +1172,7 @@ namespace creaImageIO
                mGimmick->AddFiles(storage,i_filenames);
                mProgressDialog->Pulse(_T("Updating view..."));
                UpdateTreeViewLevel(storage,1);
-               delete mProgressDialog;
+               killProgress();
                DisplayAddSummary();    
        }
   }
@@ -1199,10 +1199,13 @@ namespace creaImageIO
     //    std::cout << "OnAddProgress "<<mess<<std::endl;
     wxString s(wxString::From8BitData(mess));
     //  std::cout << "Pulse"<<std::endl;
-    if (!mProgressDialog->Pulse(s)) 
-      {
-       p.SetStop();
-      }
+       if(mProgressDialog != 0)
+       {
+               if (!mProgressDialog->Pulse(s)) 
+                 {
+               p.SetStop();
+                 }
+       }
     //  std::cout << "OnAddProgress ok"<<std::endl;
   }
   //=================================================
@@ -1288,6 +1291,13 @@ namespace creaImageIO
        }
   }
 
+  void WxGimmickView::killProgress()
+  {
+               mProgressDialog->Resume();
+               mProgressDialog->Destroy();
+               mProgressDialog = 0;
+  }
+
    //=================================================
 
    //=================================================
index ad66923cb16cac3a0918e64f731187ae80925161..6f820f96c3aeb4c0af49c0cdc67093b629517f28 100644 (file)
@@ -235,6 +235,9 @@ namespace creaImageIO
     //Pointer holders for images to be shown
        std::vector< boost::shared_ptr<ImagePointerHolder> > pointers;
 
+       //kill Progress DialogBar
+       void killProgress();
+
     wxString mCurrentDirectory;
     
     DECLARE_EVENT_TABLE()