X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolInputSelectorWidget.cxx;h=35de7bfb33c9f01f42393b1156c468c5860347d8;hb=6ba3ae42db97a5367507312b4d086e006081d8ed;hp=1542c4bbc82111998988e5c5b378e690937a4bfa;hpb=34490f432219fe05c7ae19c4cf012b5529d784dc;p=clitk.git
diff --git a/vv/vvToolInputSelectorWidget.cxx b/vv/vvToolInputSelectorWidget.cxx
index 1542c4b..35de7bf 100644
--- a/vv/vvToolInputSelectorWidget.cxx
+++ b/vv/vvToolInputSelectorWidget.cxx
@@ -1,65 +1,57 @@
/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Program: vv
- Module: $RCSfile: vvToolInputSelectorWidget.cxx,v $
- Language: C++
- Date: $Date: 2010/03/24 10:48:18 $
- Version: $Revision: 1.5 $
- Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
- Copyright (C) 2010
- Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
- CREATIS http://www.creatis.insa-lyon.fr
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 3 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- =========================================================================*/
+ It is distributed under dual licence
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+======================================================================-====*/
#ifndef VVTOOLINPUTSELECTORWIDGET_CXX
#define VVTOOLINPUTSELECTORWIDGET_CXX
-
#include "vvToolSimpleInputSelectorWidget.h"
#include "vvToolInputSelectorWidget.h"
#include "vvSlicerManager.h"
//------------------------------------------------------------------------------
vvToolInputSelectorWidget::vvToolInputSelectorWidget(QWidget * parent, Qt::WindowFlags f):
- QWidget(parent, f) {
- setupUi(this);
+ QWidget(parent, f)
+{
+ setupUi(this);
setEnabled(true);
mNumberOfAcceptedInputs = 0;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-int vvToolInputSelectorWidget::GetNumberOfInput() {
+int vvToolInputSelectorWidget::GetNumberOfInput()
+{
return mListOfSimpleInputWidget.size();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::AddInputSelector(QString & s,
- const std::vector & l,
- int index,
- bool allowSkip) {
+void vvToolInputSelectorWidget::AddInputSelector(QString & s,
+ const std::vector & l,
+ int index,
+ bool allowSkip)
+{
// DD("ICICICICICICICIC AddInputSelector ADD layout");
// DD(index);
//DD(l.size());
vvToolSimpleInputSelectorWidget * input = new vvToolSimpleInputSelectorWidget;
mListOfSimpleInputWidget.push_back(input);
mSkipInput.push_back(false);
-
+
input->SetText(s);
input->EnableAllowSkip(allowSkip);
@@ -70,7 +62,7 @@ void vvToolInputSelectorWidget::AddInputSelector(QString & s,
// add
input->SetInputList(*ll, index);
- input->setObjectName(QString::fromUtf8("TOTO"));
+ // input->setObjectName(QString::fromUtf8("TOTO"));
mVerticalLayout->addWidget(input);
// Enable or disable
@@ -78,16 +70,18 @@ void vvToolInputSelectorWidget::AddInputSelector(QString & s,
else input->setEnabled(false);
//DD(GetNumberOfInput());
- // Connect signals & slots
+ // Connect signals & slots
connect(input, SIGNAL(accepted()), this, SLOT(accept()));
- connect(input, SIGNAL(rejected()), this, SLOT(reject()));
- connect(input, SIGNAL(sigskip()), this, SLOT(skip()));
+ connect(input, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(input, SIGNAL(sigskip()), this, SLOT(skip()));
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::Initialize() {
+void vvToolInputSelectorWidget::Initialize()
+{
+ // setWindowModality(Qt::WindowModal);
for(unsigned int i=0; iInitialize();
}
@@ -95,15 +89,16 @@ void vvToolInputSelectorWidget::Initialize() {
//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::accept() {
+void vvToolInputSelectorWidget::accept()
+{
+ // setWindowModality(Qt::NonModal);
// DD("vvToolInputSelectorWidget::accept");
//DD(mNumberOfAcceptedInputs);
mNumberOfAcceptedInputs++;
if (mNumberOfAcceptedInputs == GetNumberOfInput()) {
setEnabled(false);
emit accepted();
- }
- else {
+ } else {
//DD("accepted");
// for(unsigned int i=mNumberOfAcceptedInputs; iInitialize();
@@ -115,7 +110,8 @@ void vvToolInputSelectorWidget::accept() {
//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::reject() {
+void vvToolInputSelectorWidget::reject()
+{
// DD("vvToolInputSelectorWidget::reject");
if (mNumberOfAcceptedInputs != 0) {
// for(unsigned int i=mNumberOfAcceptedInputs; isetEnabled(true);
mNumberOfAcceptedInputs--;
//}
- }
- else {
+ } else {
emit rejected();
}
}
@@ -134,8 +129,9 @@ void vvToolInputSelectorWidget::reject() {
//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::skip() {
- DD("SKIP");
+void vvToolInputSelectorWidget::skip()
+{
+ // DD("SKIP");
mSkipInput[mNumberOfAcceptedInputs] = true;
accept();//mNumberOfAcceptedInputs++;
}
@@ -143,7 +139,8 @@ void vvToolInputSelectorWidget::skip() {
//------------------------------------------------------------------------------
-std::vector & vvToolInputSelectorWidget::GetSelectedInputs() {
+std::vector & vvToolInputSelectorWidget::GetSelectedInputs()
+{
std::vector * l = new std::vector;
for(unsigned int i=0; i & vvToolInputSelectorWidget::GetSelectedInputs() {
//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::AnImageIsBeingClosed(vvSlicerManager * m) {
+void vvToolInputSelectorWidget::AnImageIsBeingClosed(vvSlicerManager * m)
+{
// DD("TODO : verify that the image still exist !!");
// for(int i=0; i<
}