]> git.cworth.org Git - apitrace/commitdiff
Allow setting options on the retrace processs.
authorZack Rusin <zack@kde.org>
Fri, 8 Apr 2011 00:32:46 +0000 (20:32 -0400)
committerZack Rusin <zack@kde.org>
Fri, 8 Apr 2011 00:32:46 +0000 (20:32 -0400)
gui/CMakeLists.txt
gui/mainwindow.cpp
gui/ui/retracerdialog.ui [new file with mode: 0644]

index ea35867d934ec418da7b2469ca895ed6502b895f..7c54e26a060cac33d0f654dc9149e7e3616193ec 100644 (file)
@@ -21,6 +21,7 @@ qt4_add_resources(qapitrace_SRCS qapitrace.qrc)
 
 set(qapitrace_UIS
    ui/mainwindow.ui
+   ui/retracerdialog.ui
    ui/settings.ui)
 
 QT4_WRAP_UI(qapitrace_UIS_H ${qapitrace_UIS})
index f3aed9f5e15bf841d5969d6e592b7d385c78ea56..0065309eca7c4170d240959b123bd8e0a059c4b9 100644 (file)
@@ -7,6 +7,7 @@
 #include "apitracefilter.h"
 #include "retracer.h"
 #include "settingsdialog.h"
+#include "ui_retracerdialog.h"
 #include "vertexdatainterpreter.h"
 
 #include <qjson/parser.h>
@@ -199,7 +200,22 @@ void MainWindow::filterTrace()
 
 void MainWindow::replayStart()
 {
-    replayTrace(false);
+    QDialog dlg;
+    Ui_RetracerDialog dlgUi;
+    dlgUi.setupUi(&dlg);
+
+    dlgUi.doubleBufferingCB->setChecked(
+        m_retracer->isDoubleBuffered());
+    dlgUi.benchmarkCB->setChecked(
+        m_retracer->isBenchmarking());
+
+    if (dlg.exec() == QDialog::Accepted) {
+        m_retracer->setDoubleBuffered(
+            dlgUi.doubleBufferingCB->isChecked());
+        m_retracer->setBenchmarking(
+            dlgUi.benchmarkCB->isChecked());
+        replayTrace(false);
+    }
 }
 
 void MainWindow::replayStop()
diff --git a/gui/ui/retracerdialog.ui b/gui/ui/retracerdialog.ui
new file mode 100644 (file)
index 0000000..31fef7f
--- /dev/null
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RetracerDialog</class>
+ <widget class="QDialog" name="RetracerDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>286</width>
+    <height>94</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Retracer Configuration</string>
+  </property>
+  <property name="whatsThis">
+   <string>Allows setting options on the retracing process.</string>
+  </property>
+  <property name="modal">
+   <bool>true</bool>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="doubleBufferingCB">
+       <property name="text">
+        <string>Use double buffering</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_4">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>48</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>68</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QCheckBox" name="benchmarkCB">
+       <property name="text">
+        <string>Benchmark</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_3">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>78</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>RetracerDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>RetracerDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>