]> Creatis software - clitk.git/commitdiff
Corrected tooltip with absolute file path
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 30 May 2011 08:08:48 +0000 (10:08 +0200)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Mon, 30 May 2011 08:08:48 +0000 (10:08 +0200)
vv/vvMainWindow.cxx
vv/vvSlicerManager.cxx
vv/vvSlicerManager.h

index 43dcff1d3f11acc4ff4f4213ad116c0ae9101e93..8a0bd2472bb4e1c86b1f8b7cc6356e79b7ce9896 100644 (file)
@@ -865,7 +865,7 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::Loa
         item->setData(0,Qt::UserRole,files[i].c_str());
         QFileInfo fileinfo(imageManager->GetFileName().c_str()); //Do not show the path
         item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
-        item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
+        item->setToolTip(COLUMN_IMAGE_NAME, imageManager->GetListOfAbsoluteFilePathInOneString("image").c_str());
         qApp->processEvents();
 
         //Create the buttons for reload and close
@@ -1816,7 +1816,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file)
     item->setData(1,Qt::UserRole,tr("overlay"));
     QFileInfo fileinfo(file); //Do not show the path
     item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
-    item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
+    item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("overlay").c_str());
     qApp->processEvents();
 
     for (int j = 1; j <= 4; j++) {
@@ -1938,7 +1938,7 @@ void vvMainWindow::AddFusionImage(int index, QString file)
       item->setData(1,Qt::UserRole,tr("fusion"));
       QFileInfo fileinfo(filename.c_str()); //Do not show the path
       item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
-      item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
+      item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("fusion").c_str());
       qApp->processEvents();
 
       for (int j = 1; j <= 4; j++) {
@@ -2023,7 +2023,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
   item->setData(1,Qt::UserRole,tr("vector"));
   QFileInfo fileinfo(filename); //Do not show the path
   item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
-  item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
+  item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("vector").c_str());
   qApp->processEvents();
 
   for (int j = 1; j <= 4; j++) {
index 87c4ae3830b73d2bd6cfdff3a9a3b0034500a4f9..7bf8ed655cf457923c09d46307a46ecfe2cf0e76 100644 (file)
@@ -40,6 +40,8 @@
 #include <vtksys/SystemTools.hxx>
 #include <vtkCamera.h>
 
+#include <qfileinfo.h>
+
 //----------------------------------------------------------------------------
 vvSlicerManager::vvSlicerManager(int numberOfSlicers)
 {
@@ -121,6 +123,34 @@ void vvSlicerManager::ToggleContourSuperposition()
 }
 //----------------------------------------------------------------------------
 
+//----------------------------------------------------------------------------
+std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::string &actorType)
+{
+  vvImageReader *reader = NULL;
+
+  if(actorType=="image")
+    reader = mReader;
+  else if(actorType=="overlay")
+    reader = mOverlayReader;
+  else if(actorType=="fusion")
+    reader = mFusionReader;
+  else if(actorType=="vector")
+    reader = mVectorReader;
+
+  if(!reader)
+    return "";
+
+  std::string list;
+  for(unsigned int i=0; i<reader->GetInputFilenames().size(); i++){
+    QFileInfo fileinfo(reader->GetInputFilenames()[i].c_str()); //Do not show the path
+    if(i)
+      list += '\n';
+    list += fileinfo.absoluteFilePath().toStdString();
+  }
+  return list;
+}
+//----------------------------------------------------------------------------
+
 
 //----------------------------------------------------------------------------
 bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageType type, int n, unsigned int slice)
index cb6cb32778ebc422a09d6a2ccbb4e5f9de519b9d..680a59b0769ab2c1b095afb69577eded13cca3f0 100644 (file)
@@ -80,6 +80,7 @@ class vvSlicerManager : public QObject {
   std::string GetVFName()        { return mVFName; }
   std::string GetOverlayName()   { return mOverlayName; }
   std::string GetFusionName()    { return mFusionName; }
+  std::string GetListOfAbsoluteFilePathInOneString(const std::string &actorType);
 
   ///Switch between nearest neighbor and linear interpolation
   void ToggleInterpolation();