summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2012-02-28 17:12:24 +0000
committerJosé Fonseca <jose.r.fonseca@gmail.com>2012-02-28 17:12:24 +0000
commit2cdc9403293a2478c1d8bc10ca0ffc618f0516bf (patch)
tree1bee9bfe3406a6018107ef7e0c2e8311c3b99a1f
parentb491d2958e2a8331f0f144de89626c284ae96121 (diff)
Allow to specify the API from trace dialog.
-rw-r--r--gui/mainwindow.cpp1
-rw-r--r--gui/tracedialog.cpp15
-rw-r--r--gui/tracedialog.h1
-rw-r--r--gui/traceprocess.cpp7
-rw-r--r--gui/traceprocess.h2
-rw-r--r--gui/ui/tracedialog.ui14
6 files changed, 40 insertions, 0 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index d37162ba..672ad643 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -61,6 +61,7 @@ void MainWindow::createTrace()
if (dialog.exec() == QDialog::Accepted) {
qDebug()<< "App : " <<dialog.applicationPath();
qDebug()<< " Arguments: "<<dialog.arguments();
+ m_traceProcess->setApi(dialog.api());
m_traceProcess->setExecutablePath(dialog.applicationPath());
m_traceProcess->setArguments(dialog.arguments());
m_traceProcess->start();
diff --git a/gui/tracedialog.cpp b/gui/tracedialog.cpp
index bed51736..15067077 100644
--- a/gui/tracedialog.cpp
+++ b/gui/tracedialog.cpp
@@ -9,10 +9,25 @@ TraceDialog::TraceDialog(QWidget *parent)
{
setupUi(this);
+ apiComboBox->addItem("GL");
+#ifdef Q_OS_WIN
+ apiComboBox->addItem("D3D7");
+ apiComboBox->addItem("D3D8");
+ apiComboBox->addItem("D3D9");
+ apiComboBox->addItem("D3D10");
+#else
+ apiComboBox->addItem("EGL");
+#endif
+
connect(browseButton, SIGNAL(clicked()),
this, SLOT(browse()));
}
+QString TraceDialog::api() const
+{
+ return apiComboBox->currentText().toLower();
+}
+
QString TraceDialog::applicationPath() const
{
return applicationEdit->text();
diff --git a/gui/tracedialog.h b/gui/tracedialog.h
index d5e502dd..0ebe13ad 100644
--- a/gui/tracedialog.h
+++ b/gui/tracedialog.h
@@ -12,6 +12,7 @@ public:
void accept();
+ QString api() const;
QString applicationPath() const;
QStringList arguments() const;
diff --git a/gui/traceprocess.cpp b/gui/traceprocess.cpp
index 5961444c..6f4d0b93 100644
--- a/gui/traceprocess.cpp
+++ b/gui/traceprocess.cpp
@@ -31,6 +31,11 @@ TraceProcess::~TraceProcess()
{
}
+void TraceProcess::setApi(const QString &str)
+{
+ m_api = str;
+}
+
void TraceProcess::setExecutablePath(const QString &str)
{
m_execPath = str;
@@ -93,6 +98,8 @@ void TraceProcess::start()
QStringList arguments;
arguments << QLatin1String("trace");
+ arguments << QLatin1String("--api");
+ arguments << m_api;
arguments << QLatin1String("--output");
arguments << m_tracePath;
arguments << QLatin1String("--");
diff --git a/gui/traceprocess.h b/gui/traceprocess.h
index b65f41c5..343bac96 100644
--- a/gui/traceprocess.h
+++ b/gui/traceprocess.h
@@ -13,6 +13,7 @@ public:
bool canTrace() const;
+ void setApi(const QString &str);
void setExecutablePath(const QString &str);
QString executablePath() const;
@@ -31,6 +32,7 @@ private slots:
void traceError(QProcess::ProcessError err);
private:
+ QString m_api;
QString m_execPath;
QStringList m_args;
QString m_tracePath;
diff --git a/gui/ui/tracedialog.ui b/gui/ui/tracedialog.ui
index 149881f7..a3e5240a 100644
--- a/gui/ui/tracedialog.ui
+++ b/gui/ui/tracedialog.ui
@@ -15,6 +15,20 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>API:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="apiComboBox"/>
+ </item>
+ </layout>
+ </item>
+ <item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">