Commit 5304d077 authored by Jean-Loup Haberbusch's avatar Jean-Loup Haberbusch

CHANGE The to open data directory in CamiTK has changed

Depending on how many directory Extension are available the menu is created consequently.
parent e628ff81
......@@ -423,8 +423,8 @@ void ImpMainWindow::resetWindows() {
}
// ------------- openDataDirectory -----------------
void ImpMainWindow::openDicomDirectory() {
QString pluginName = QString("DICOM");
void ImpMainWindow::openDicomDirectory(QString plugin) {
QString pluginName = plugin;
statusBar()->showMessage(tr(QString("Opening " + pluginName + " directory...").toStdString().c_str()));
......@@ -598,7 +598,7 @@ void ImpMainWindow::saveHistoryAsSCXML() {
// ------------------------- openDataDirectoryMenuBuilder ---------------------------
void ImpMainWindow::openDataDirectoryMenuBuilder(QMenu * fm) {
// QStringList dirExt = { "Arial", "Helvetica", "Times" };
QStringList dirExt = ExtensionManager::getDataDirectoryExtNames();
QString dirExtName;
......@@ -611,6 +611,7 @@ void ImpMainWindow::openDataDirectoryMenuBuilder(QMenu * fm) {
QAction* openDirectory = new QAction(dirExtName, this);
openDirectory->setStatusTip(tr(QString("Opens data directory for " + dirExtName).toStdString().c_str()));
openDirectory->setWhatsThis(tr(QString("Opens data directory for " + dirExtName).toStdString().c_str()));
connect(openDirectory, &QAction::triggered, this, [=]() {this->openDicomDirectory(dirExtName);});
fileOpenDataDirectoryMenu->addAction(openDirectory);
......@@ -621,7 +622,7 @@ void ImpMainWindow::openDataDirectoryMenuBuilder(QMenu * fm) {
openDirectoryAct->setStatusTip(tr(QString("Opens data directory for " + dirExtName).toStdString().c_str()));
openDirectoryAct->setWhatsThis(tr(QString("Opens data directory for " + dirExtName).toStdString().c_str()));
connect(openDirectoryAct, &QAction::triggered, this, &ImpMainWindow::openDicomDirectory);
connect(openDirectoryAct, &QAction::triggered, this, [=]() {this->openDicomDirectory(dirExtName);});
fm->addAction(openDirectoryAct);
openDirectoryAct->setIcon(QPixmap(":/fileOpen"));
......
......@@ -80,7 +80,7 @@ public slots:
/// @name file menu slot
///@{
/// open a data directory, "called" from the fileOpenDataDirectoryMenu
void openDicomDirectory();
void openDicomDirectory(QString plugin);
///@}
/// @name file menu slot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment