Commit c001c91f authored by Tao Zhong's avatar Tao Zhong

Load name of files

parent 3a0a14d4
......@@ -234,7 +234,7 @@
<item>
<widget class="QLineEdit" name="lineEdit_general_08">
<property name="text">
<string>../log.txt</string>
<string>log.txt</string>
</property>
</widget>
</item>
......
#include <QDebug>
#include <QFile>
#include <QFileDialog>
#include <QMessageBox>
#include <QtWidgets>
#include "inifilewidget.h"
#include "ui_inifilewidget.h"
......@@ -49,6 +49,14 @@ InifileWidget::InifileWidget(QWidget *parent, jpsDatamanager *dmanager) :
// ui->tabWidget->removeTab(4);
//signals and slots connection
ui->lineEdit_general_07->setReadOnly(true);
ui->lineEdit_GoalFile->setReadOnly(true);
ui->lineEdit_SourceFile->setReadOnly(true);
ui->lineEdit_TrafficFile->setReadOnly(true);
connect(ui->pushButton_Geometry, SIGNAL(clicked(bool)), this, SLOT(pushButton_GeomeryClicked()));
connect(ui->pushButton_Goal, SIGNAL(clicked(bool)), this, SLOT(pushButton_GoalClicked()));
connect(ui->pushButton_Source, SIGNAL(clicked(bool)), this, SLOT(pushButton_SourceClicked()));
connect(ui->pushButton_Traffic, SIGNAL(clicked(bool)), this, SLOT(pushButton_TrafficClicked()));
}
InifileWidget::~InifileWidget()
......@@ -3420,4 +3428,41 @@ void InifileWidget::on_pushButton_read_clicked()
//route_choice_models
ReadRouteChoiceData(JuPedSim);
}
\ No newline at end of file
}
/*
Since v0.8.8
Get geometry file name
*/
void InifileWidget::pushButton_GeomeryClicked()
{
QString fileName=QFileDialog::getOpenFileName(this,tr("Choose Geometry"),""
,tr("XML-Files (*.xml)"));
ui->lineEdit_general_07->setText(fileName);
}
void InifileWidget::pushButton_GoalClicked()
{
QString fileName=QFileDialog::getOpenFileName(this,tr("Choose Geometry"),""
,tr("XML-Files (*.xml)"));
ui->lineEdit_GoalFile->setText(fileName);
}
void InifileWidget::pushButton_SourceClicked()
{
QString fileName=QFileDialog::getOpenFileName(this,tr("Choose Geometry"),""
,tr("XML-Files (*.xml)"));
ui->lineEdit_SourceFile->setText(fileName);
}
void InifileWidget::pushButton_TrafficClicked()
{
QString fileName=QFileDialog::getOpenFileName(this,tr("Choose Geometry"),""
,tr("XML-Files (*.xml)"));
ui->lineEdit_TrafficFile->setText(fileName);
}
......@@ -17,7 +17,7 @@ public:
explicit InifileWidget(QWidget *parent = nullptr, jpsDatamanager* dmanager = nullptr);
~InifileWidget();
private slots:
public slots:
//Inside Inifilewidget
void on_pushButton_write_clicked();
void on_pushButton_read_clicked();
......@@ -35,6 +35,12 @@ private slots:
void on_spinBox_agents_gradnav_1_valueChanged(int);
void on_spinBox_agents_krausz_1_valueChanged(int);
//External file
void pushButton_GeomeryClicked();
void pushButton_GoalClicked();
void pushButton_SourceClicked();
void pushButton_TrafficClicked();
private:
Ui::InifileWidget *ui;
......
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