tychoGUI  1.0
 All Data Structures Namespaces Files Functions Variables
configure_path.cpp
Go to the documentation of this file.
1 #include "configure_path.h"
2 #include "ui_configure_path.h"
3 #include <QFileDialog>
4 #include <stdio.h>
5 
6 
8  QDialog(parent),
9  ui(new Ui::configure_path)
10 {
11  ui->setupUi(this);
12 
13  connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(tycho_exectuable_config_ini()));
14  connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(close()));
15 
16 
17 }
18 
20 {
21  delete ui;
22 }
23 
24 
26 
27  QString tycho_exe_config;
28 
29  tycho_exe_config = QFileDialog::getOpenFileName(this, tr("The TYCHO Executable"), QString::null);
30 
31  //write the new path of the TYCHO executable in the confif_tycho_gui.ini File.
32  FILE *fd;
33 
34  fd = fopen("config_tycho_gui.ini", "w");
35  fprintf(fd,"#THIS IS A TYCHO GUI CONFIG FILE\n#WHICH STORES THE FULL PATH OF THE\n#TYCHO SIMULATION EXECUTABLE\n""");
36  fprintf(fd,"%s", tycho_exe_config.toStdString().c_str());
37 
38  fclose(fd);
39 
40  ui->lineEdit->setText(tycho_exe_config);
41 
42 
43 }