Skip to content
Snippets Groups Projects
Commit 2ff2145d authored by Langella Olivier's avatar Langella Olivier
Browse files

checking MS run file path completed

parent 020e9b46
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,17 @@ MsRun::findMsRunFile() ...@@ -111,7 +111,17 @@ MsRun::findMsRunFile()
// first look at the file path :) // first look at the file path :)
_msrun_reader_sp = getMsRunReaderSp(); _msrun_reader_sp = getMsRunReaderSp();
if(_msrun_reader_sp != nullptr) if(_msrun_reader_sp != nullptr)
return true; {
QFileInfo real_file(this->getFilename());
if(real_file.exists())
{
return true;
}
else
{
_msrun_reader_sp = nullptr;
}
}
QFileInfo file_original(this->getFilename()); QFileInfo file_original(this->getFilename());
QString basename = file_original.baseName(); QString basename = file_original.baseName();
QString onlyfilename = file_original.fileName(); QString onlyfilename = file_original.fileName();
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="3" column="0">
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
...@@ -252,6 +252,13 @@ ...@@ -252,6 +252,13 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<widget class="QLabel" name="msrunFilepathOkLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
...@@ -339,10 +346,27 @@ ...@@ -339,10 +346,27 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>browseMsrunDirectoryButton</sender>
<signal>clicked()</signal>
<receiver>ExportMasschroqDialog</receiver>
<slot>doBrowseMsrunDirectory()</slot>
<hints>
<hint type="sourcelabel">
<x>557</x>
<y>137</y>
</hint>
<hint type="destinationlabel">
<x>787</x>
<y>184</y>
</hint>
</hints>
</connection>
</connections> </connections>
<slots> <slots>
<slot>reject()</slot> <slot>reject()</slot>
<slot>accept()</slot> <slot>accept()</slot>
<slot>doCheckMsrunFilepath()</slot> <slot>doCheckMsrunFilepath()</slot>
<slot>doBrowseMsrunDirectory()</slot>
</slots> </slots>
</ui> </ui>
...@@ -45,6 +45,7 @@ ExportMasschroqDialog::ExportMasschroqDialog(QWidget *parent) ...@@ -45,6 +45,7 @@ ExportMasschroqDialog::ExportMasschroqDialog(QWidget *parent)
this->setModal(true); this->setModal(true);
ui->directorySelectWidget->setHidden(true); ui->directorySelectWidget->setHidden(true);
ui->msrunFilepathOkLabel->setHidden(true);
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
// Qt5 code // Qt5 code
...@@ -173,6 +174,7 @@ void ...@@ -173,6 +174,7 @@ void
ExportMasschroqDialog::doCheckMsrunFilepath() ExportMasschroqDialog::doCheckMsrunFilepath()
{ {
ui->msrunFilepathOkLabel->setHidden(true);
bool is_ok = true; bool is_ok = true;
for(IdentificationDataSourceSp p_ident_data_source : for(IdentificationDataSourceSp p_ident_data_source :
mp_project->getIdentificationDataSourceStore() mp_project->getIdentificationDataSourceStore()
...@@ -187,15 +189,23 @@ ExportMasschroqDialog::doCheckMsrunFilepath() ...@@ -187,15 +189,23 @@ ExportMasschroqDialog::doCheckMsrunFilepath()
else else
{ {
is_ok = false; is_ok = false;
}
if(!is_ok)
{
ui->warningDirectoryLabel->setText( ui->warningDirectoryLabel->setText(
tr("%1 not found : Please choose the directory to look for this MS " tr("%1 not found : Please choose the directory to look for this MS "
"run file.")); "run file.")
.arg(msrun_sp.get()->getFilename()));
ui->directorySelectWidget->setHidden(false); ui->directorySelectWidget->setHidden(false);
break;
} }
} }
if(is_ok) if(is_ok)
{ {
ui->directorySelectWidget->setHidden(true); ui->directorySelectWidget->setHidden(true);
ui->msrunFilepathOkLabel->setText(tr("All MS run files found"));
ui->msrunFilepathOkLabel->setHidden(false);
} }
} }
...@@ -206,11 +216,15 @@ ExportMasschroqDialog::doBrowseMsrunDirectory() ...@@ -206,11 +216,15 @@ ExportMasschroqDialog::doBrowseMsrunDirectory()
QSettings settings; QSettings settings;
QString path = settings.value("path/mzdatadir", "").toString(); QString path = settings.value("path/mzdatadir", "").toString();
QString filename = QFileDialog::getExistingDirectory( QString filename = QFileDialog::getExistingDirectory(
this, tr("Save TSV files"), QString("%1").arg(path)); this, tr("Choose directory to look for MS runs"), QString("%1").arg(path));
QDir parent(filename); if(!filename.isEmpty())
parent.cdUp(); {
settings.setValue("path/mzdatadir", parent.canonicalPath()); QDir parent(filename);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " " // parent.cdUp();
<< parent.absolutePath(); settings.setValue("path/mzdatadir", parent.canonicalPath());
doCheckMsrunFilepath();
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
<< parent.absolutePath();
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment