]> Creatis software - clitk.git/commitdiff
Merge branch 'master' of /home/dsarrut/clitk3.server
authormpech <maxime.pech@insa-lyon.fr>
Wed, 18 May 2011 09:08:49 +0000 (11:08 +0200)
committermpech <maxime.pech@insa-lyon.fr>
Wed, 18 May 2011 09:08:49 +0000 (11:08 +0200)
1  2 
vv/vvMainWindow.cxx

diff --combined vv/vvMainWindow.cxx
index 21074a8ea71f4c58a6980411349f9ca1e4f78e13,bb23b79a31a4fe1515b943efbba306942e2b7f52..303efebbaf8aafe2e41f76201f5eab18972c50cb
@@@ -252,7 -252,6 +252,7 @@@ vvMainWindow::vvMainWindow():vvMainWind
    connect(actionAdd_VF_to_current_Image,SIGNAL(triggered()),this,SLOT(OpenField()));
    connect(actionNavigation_Help,SIGNAL(triggered()),this,SLOT(ShowHelpDialog()));
    connect(actionDocumentation,SIGNAL(triggered()),this,SLOT(ShowDocumentation()));
 +  connect(actionRegister_vv,SIGNAL(triggered()),this,SLOT(PopupRegisterForm()));
  
    ///////////////////////////////////////////////
    connect(actionSegmentation,SIGNAL(triggered()),this,SLOT(SegmentationOnCurrentImage()));
  
  void vvMainWindow::show(){
    vvMainWindowBase::show();
 -  vvRegisterForm* registerForm = new vvRegisterForm(QUrl("http://www.creatis.insa-lyon.fr/~dsarrut/vvregister/write.php"), getVVSettingsPath(), getSettingsOptionFormat());
 -  if(registerForm->canPush()){
 -    registerForm->show();
 -    registerForm->acquitPushed();//too bad if there is not internet connection anymore.
 -  }
 +  PopupRegisterForm(true);
  }
  //------------------------------------------------------------------------------
  void vvMainWindow::UpdateMemoryUsage()
@@@ -1214,23 -1217,6 +1214,23 @@@ void vvMainWindow::ShowDocumentation(
  {
    documentation->show();
  }
 +//------------------------------------------------------------------------------
 +
 +//------------------------------------------------------------------------------
 +void vvMainWindow::PopupRegisterForm(bool checkCanPush)
 +{
 +  vvRegisterForm* registerForm = new vvRegisterForm(QUrl("http://www.creatis.insa-lyon.fr/~dsarrut/vvregister/write.php"), getVVSettingsPath(), getSettingsOptionFormat());
 +  if(!checkCanPush){
 +    registerForm->show();
 +  }else{
 +    if(registerForm->canPush()){
 +      registerForm->show();
 +      registerForm->acquitPushed();//too bad if there is not internet connection anymore.
 +    }
 +  }
 +}
 +//------------------------------------------------------------------------------
 +
  //------------------------------------------------------------------------------
  void vvMainWindow::ShowHelpDialog()
  {
  //------------------------------------------------------------------------------
  void vvMainWindow::ChangeViewMode()
  {
-   QListIterator<int> it0(splitter_3->sizes());
-   QListIterator<int> it1(splitter_3->sizes());
-   int max0 = 0;
-   int max1 = 1;
-   while (it0.hasNext()) {
-     max0 += it0.next();
-   }
-   while (it1.hasNext()) {
-     max1 += it1.next();
+   QListIterator<int> it(splitter_3->sizes());
+   int max_size = 0;
+   while (it.hasNext()) {
+     max_size += it.next();
    }
    QList<int> size0;
    QList<int> size1;
    if (viewMode == 1) {
      viewMode = 0;
-     size0.push_back(max0);
+     size0.push_back(max_size);
      size0.push_back(0);
-     size1.push_back(max1);
+     size1.push_back(max_size + 1);
      size1.push_back(0);
      splitter_3->setSizes(size0);
      OSplitter->setSizes(size1);
      DataTree->setColumnHidden(4,1);
    } else {
      viewMode = 1;
-     size0.push_back(int(max0/2));
-     size0.push_back(int(max0/2));
-     size1.push_back(int(max1/2));
-     size1.push_back(int(max1/2));
+     size0.push_back(max_size / 2);
+     size0.push_back(max_size / 2);
+     size1.push_back((max_size + 1) / 2);
+     size1.push_back((max_size + 1) / 2);
      splitter_3->setSizes(size0);
      OSplitter->setSizes(size1);
      DataTree->setColumnHidden(2,0);