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

checking tandem.exe installation

parent d51b2b8c
No related branches found
No related tags found
No related merge requests found
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. * along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
* *
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/ ******************************************************************************/
#include "tandembatchprocess.h" #include "tandembatchprocess.h"
...@@ -132,6 +129,28 @@ TandemBatchProcess::run() ...@@ -132,6 +129,28 @@ TandemBatchProcess::run()
{ {
qDebug() << "TandemBatchProcess::run begin " qDebug() << "TandemBatchProcess::run begin "
<< _tandem_run_batch._preset_file; << _tandem_run_batch._preset_file;
// check tandem path
QFileInfo tandem_exe(_tandem_run_batch._tandem_bin_path);
if(!tandem_exe.exists())
{
// dir.path() returns the unique directory path
throw pappso::PappsoException(
QObject::tr(
"X!Tandem software not found at %1.\nPlease check the X!Tandem "
"installation on your computer and set tandem.exe path.")
.arg(tandem_exe.absoluteFilePath()));
}
if(!tandem_exe.isReadable())
{
// dir.path() returns the unique directory path
throw pappso::PappsoException(
QObject::tr("Please check permissions on !Tandem software found at %1.")
.arg(tandem_exe.absoluteFilePath()));
}
QTemporaryDir tmp_dir; QTemporaryDir tmp_dir;
if(!tmp_dir.isValid()) if(!tmp_dir.isValid())
{ {
...@@ -262,6 +281,8 @@ TandemBatchProcess::writeXmlInputFile(QXmlStreamWriter *p_out, ...@@ -262,6 +281,8 @@ TandemBatchProcess::writeXmlInputFile(QXmlStreamWriter *p_out,
void void
TandemBatchProcess::runOne(const QString &mz_file) TandemBatchProcess::runOne(const QString &mz_file)
{ {
QTemporaryFile xml_input_file; QTemporaryFile xml_input_file;
xml_input_file.setAutoRemove(true); xml_input_file.setAutoRemove(true);
if(xml_input_file.open()) if(xml_input_file.open())
......
...@@ -23,13 +23,9 @@ ...@@ -23,13 +23,9 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. * along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
* *
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/ ******************************************************************************/
#ifndef TANDEMBATCHPROCESS_H #pragma once
#define TANDEMBATCHPROCESS_H
#include "tandemrunbatch.h" #include "tandemrunbatch.h"
#include "../../utils/workmonitor.h" #include "../../utils/workmonitor.h"
#include <QTemporaryFile> #include <QTemporaryFile>
...@@ -65,5 +61,3 @@ class TandemBatchProcess ...@@ -65,5 +61,3 @@ class TandemBatchProcess
QTemporaryFile _tmp_database_file; QTemporaryFile _tmp_database_file;
MainWindow *_p_main_window = nullptr; MainWindow *_p_main_window = nullptr;
}; };
#endif // TANDEMBATCHPROCESS_H
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