Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/vogleditor/vogleditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,9 @@ VoglEditor::Prompt_Result VoglEditor::prompt_generate_trace()
#endif

QString cmdLine = m_pLaunchTracerDialog->get_command_line();
QString workingDir = m_pLaunchTracerDialog->get_application_working_dir();
QProcessEnvironment env = m_pLaunchTracerDialog->get_process_environment();
bool bSuccess = launch_application_to_generate_trace(cmdLine, env);
bool bSuccess = launch_application_to_generate_trace(cmdLine, workingDir, env);
QFileInfo fileInfo(m_pLaunchTracerDialog->get_trace_file_path());
if (bSuccess && fileInfo.exists())
{
Expand All @@ -494,7 +495,7 @@ VoglEditor::Prompt_Result VoglEditor::prompt_generate_trace()
return vogleditor_prompt_success;
}

bool VoglEditor::launch_application_to_generate_trace(const QString &cmdLine, const QProcessEnvironment &environment)
bool VoglEditor::launch_application_to_generate_trace(const QString &cmdLine, const QString &workingDir, const QProcessEnvironment &environment)
{
vogleditor_output_message("Tracing application:");
vogleditor_output_message(cmdLine.toStdString().c_str());
Expand All @@ -505,6 +506,10 @@ bool VoglEditor::launch_application_to_generate_trace(const QString &cmdLine, co
m_pVoglReplayProcess->setProcessEnvironment(environment);

bool bCompleted = false;
if (!workingDir.isEmpty())
{
m_pVoglReplayProcess->setWorkingDirectory(workingDir);
}
m_pVoglReplayProcess->start(cmdLine);
if (m_pVoglReplayProcess->waitForStarted() == false)
{
Expand Down
2 changes: 1 addition & 1 deletion src/vogleditor/vogleditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private
bool displayBuffer(GLuint64 bufferHandle, bool bBringTabToFront);
bool resetApiCallTreeModel();

bool launch_application_to_generate_trace(const QString &cmdLine, const QProcessEnvironment &environment);
bool launch_application_to_generate_trace(const QString &cmdLine, const QString &workingDir, const QProcessEnvironment &environment);

Prompt_Result prompt_load_new_trace(const char *tracefile);

Expand Down
22 changes: 22 additions & 0 deletions src/vogleditor/vogleditor_qlaunchtracerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ QString vogleditor_QLaunchTracerDialog::get_application_to_launch()
return ui->applicationLineEdit->text();
}

QString vogleditor_QLaunchTracerDialog::get_application_working_dir()
{
return ui->workingDirLineEdit->text();
}

void vogleditor_QLaunchTracerDialog::on_applicationLineEdit_textChanged(const QString &text)
{
check_inputs();
Expand All @@ -162,6 +167,11 @@ void vogleditor_QLaunchTracerDialog::on_traceFileLineEdit_textChanged(const QStr
check_inputs();
}

void vogleditor_QLaunchTracerDialog::on_workingDirLineEdit_textChanged(const QString &text)
{
check_inputs();
}

void vogleditor_QLaunchTracerDialog::check_inputs()
{
bool applicationFileEntered = ui->applicationLineEdit->text().size() != 0;
Expand All @@ -182,6 +192,18 @@ void vogleditor_QLaunchTracerDialog::on_findApplicationButton_clicked()
}
}

void vogleditor_QLaunchTracerDialog::on_findWorkingDirButton_clicked()
{
// open file dialog
QString suggestedName = ui->workingDirLineEdit->text();
QString selectedName = QFileDialog::getExistingDirectory(this, tr("Find Application working directory"), suggestedName);

if (!selectedName.isEmpty())
{
ui->workingDirLineEdit->setText(selectedName);
}
}

void vogleditor_QLaunchTracerDialog::on_findTraceFileButton_clicked()
{
// open file dialog
Expand Down
5 changes: 5 additions & 0 deletions src/vogleditor/vogleditor_qlaunchtracerdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class vogleditor_QLaunchTracerDialog : public QDialog
~vogleditor_QLaunchTracerDialog();

QString get_application_to_launch();
QString get_application_working_dir();
QString get_command_line();
QProcessEnvironment get_process_environment();
QString get_trace_file_path();
Expand All @@ -28,8 +29,12 @@ private

void on_traceFileLineEdit_textChanged(const QString &text);

void on_workingDirLineEdit_textChanged(const QString &text);

void on_findApplicationButton_clicked();

void on_findWorkingDirButton_clicked();

void on_findTraceFileButton_clicked();

void on_vogltraceCheckBox_clicked(bool checked);
Expand Down
205 changes: 122 additions & 83 deletions src/vogleditor/vogleditor_qlaunchtracerdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,24 @@
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="2" column="1">
<widget class="QLineEdit" name="traceFileLineEdit">
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string/>
<string>Vogl options:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="findTraceFileButton">
<item row="2" column="2" colspan="2">
<widget class="QLineEdit" name="argumentsLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="0">
Expand All @@ -71,21 +59,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="forceDebugContextCheckBox">
<property name="text">
<string>Force debug context</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="disableProgramBinaryCheckBox">
<property name="text">
<string>Disable glProgramBinary</string>
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="3">
<widget class="QPushButton" name="findApplicationButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
Expand All @@ -104,86 +78,72 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<item row="3" column="3">
<widget class="QPushButton" name="findTraceFileButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Application arguments:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="applicationLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
<string>...</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<item row="3" column="2">
<widget class="QLineEdit" name="traceFileLineEdit">
<property name="text">
<string>&lt;span style=&quot;color: red;&quot;&gt;*&lt;/span&gt;Output trace file:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<item row="4" column="2">
<widget class="QCheckBox" name="vogltraceCheckBox">
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Vogl options:</string>
<string>Use vogl tool</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="gatherCallStacksCheckBox">
<item row="6" column="2">
<widget class="QCheckBox" name="forceDebugContextCheckBox">
<property name="text">
<string>Gather call stacks</string>
<string>Force debug context</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="argumentsLineEdit">
<item row="0" column="2">
<widget class="QLineEdit" name="applicationLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="vogltraceCheckBox">
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Use vogl tool</string>
</property>
<property name="checked">
<bool>false</bool>
<string/>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<item row="9" column="0" colspan="3">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
Expand Down Expand Up @@ -250,6 +210,85 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&lt;span style=&quot;color: red;&quot;&gt;*&lt;/span&gt;Output trace file:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QCheckBox" name="gatherCallStacksCheckBox">
<property name="text">
<string>Gather call stacks</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Application arguments:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QCheckBox" name="disableProgramBinaryCheckBox">
<property name="text">
<string>Disable glProgramBinary</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Application working dir:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="workingDirLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="findWorkingDirButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
Expand Down