]> Creatis software - clitk.git/blobdiff - vv/vvQPacsConnection.cxx
Debug RTStruct conversion with empty struc
[clitk.git] / vv / vvQPacsConnection.cxx
index 8f40ae6405b839e39cf5ea5d8c26a99cae94e35f..4ae0d33b9981bdddc7a31e98e2f2aa0b55c16b7f 100644 (file)
@@ -16,7 +16,7 @@ vvQPacsConnection::vvQPacsConnection(QWidget *i_parent)
        :QDialog(i_parent)
 {
        ui.setupUi(this);
-       setWindowTitle(QString::fromUtf8("PACS CONNECTIONHHHH"));
+       setWindowTitle(QString::fromUtf8("PACS CONNECTION"));
        createTreeView();
        ui.tabFilter->setTabText(0,QString(tr("Modality")));
        ui.tabFilter->setTabText(1,QString(tr("Date")));
@@ -31,10 +31,18 @@ vvQPacsConnection::vvQPacsConnection(QWidget *i_parent)
        connect(ui.networkCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(chooseServer(int)));
        connect(ui.removeNetworkButton,SIGNAL(clicked()),this,SLOT(removeServer()));
        connect(ui.NetworkButton,SIGNAL(clicked()),this,SLOT(modifyServer()));
+       connect(ui.exitButton,SIGNAL(clicked()),this,SLOT(close()));
        
        update();
 }
 
+// Exit window
+bool vvQPacsConnection::close()
+{
+    QApplication::restoreOverrideCursor();
+    return QWidget::close();
+}
+
 // remote a Dicom Server in VV settings
 void vvQPacsConnection::removeServer()
 {
@@ -47,8 +55,13 @@ void vvQPacsConnection::removeServer()
 // modify a Dicom Server in VV settings
 void vvQPacsConnection::modifyServer()
 {
+       int indexCombo = ui.networkCombo->currentIndex();
+       removeDicomServer(m_nickname);
        AddDicomServer(ui.NameEdit->text().toStdString(),ui.AETitleEdit->text().toStdString(),ui.AdressEdit->text().toStdString(),ui.PortEdit->text().toStdString());
-       removeServer();
+       ui.networkCombo->clear();
+       ui.networkCombo->addItem(QString());
+       ui.networkCombo->addItems(getDicomServers());
+       ui.networkCombo->setCurrentIndex(indexCombo);
 }
 
 // refresh the list of Dicom Servers available from VV settings
@@ -306,7 +319,7 @@ std::vector< std::pair<gdcm::Tag, std::string> > vvQPacsConnection::getKeys()
        //gdcm::Tag tagsdc(8,1030);
        //keys.push_back(std::make_pair(tagsdc, ""));
 
-       //// Accession n°
+       //// Accession
        //gdcm::Tag tagacc(8,50);
        //keys.push_back(std::make_pair(tagacc, ""));
 
@@ -383,7 +396,7 @@ void vvQPacsConnection::on_importButton_clicked()
                        dirpath.mkdir(path);
                }
                bool didItWork =  gdcm::CompositeNetworkFunctions::CMove(m_adress.c_str(),atoi(m_port.c_str()),
-                       gdcm::CompositeNetworkFunctions::ConstructQuery(mQFactory.getMoveQuery().theRoot, mQFactory.getMoveQuery().theLevel ,mQFactory.getMoveQuery().keys,true),
+                       gdcm::CompositeNetworkFunctions::ConstructQuery(mQFactory.getMoveQuery().theRoot, mQFactory.getMoveQuery().theLevel ,mQFactory.getMoveQuery().keys, gdcm::eMove),
                        getDicomClientPort(),  getDicomClientAETitle().c_str(), m_aetitle.c_str(), path.toStdString().c_str() );
                gdcm::Directory theDir;
                theDir.Load(path.toStdString().c_str());
@@ -393,7 +406,7 @@ void vvQPacsConnection::on_importButton_clicked()
      NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
      nameGenerator->SetUseSeriesDetails(true);
 
-     //ds gérer recursive moi-meme pour progress ...
+     //ds gerer recursive moi-meme pour progress ...
      nameGenerator->SetInputDirectory(path.toStdString());
 
      // insert in table