From cf1ef45a5e098d573170595b8d3f834693873cb5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 3 Feb 2017 20:10:08 +0000 Subject: [PATCH] Add settings dialog for Qt --- qrenderdoc/Code/PersistantConfig.cpp | 9 +- qrenderdoc/Code/PersistantConfig.h | 11 +- qrenderdoc/Code/qrenderdoc.cpp | 2 +- qrenderdoc/Windows/Dialogs/CaptureDialog.h | 3 +- qrenderdoc/Windows/Dialogs/SettingsDialog.cpp | 336 ++++++ qrenderdoc/Windows/Dialogs/SettingsDialog.h | 98 ++ qrenderdoc/Windows/Dialogs/SettingsDialog.ui | 954 ++++++++++++++++++ qrenderdoc/Windows/MainWindow.cpp | 7 + qrenderdoc/Windows/MainWindow.h | 1 + qrenderdoc/Windows/MainWindow.ui | 20 +- qrenderdoc/qrenderdoc.pro | 9 +- qrenderdoc/qrenderdoc_local.vcxproj | 5 + qrenderdoc/qrenderdoc_local.vcxproj.filters | 15 + 13 files changed, 1455 insertions(+), 15 deletions(-) create mode 100644 qrenderdoc/Windows/Dialogs/SettingsDialog.cpp create mode 100644 qrenderdoc/Windows/Dialogs/SettingsDialog.h create mode 100644 qrenderdoc/Windows/Dialogs/SettingsDialog.ui diff --git a/qrenderdoc/Code/PersistantConfig.cpp b/qrenderdoc/Code/PersistantConfig.cpp index be1bd2cca..56e859675 100644 --- a/qrenderdoc/Code/PersistantConfig.cpp +++ b/qrenderdoc/Code/PersistantConfig.cpp @@ -90,6 +90,8 @@ bool PersistantConfig::Deserialize(QString filename) { QFile f(filename); + m_Filename = filename; + // silently allow missing configs if(!f.exists()) return true; @@ -115,13 +117,16 @@ bool PersistantConfig::Deserialize(QString filename) bool PersistantConfig::Serialize(QString filename) { + if(filename != "") + m_Filename = filename; + QVariantMap values = storeValues(); - QFile f(filename); + QFile f(m_Filename); if(f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) return SaveToJSON(values, f, JSON_ID, JSON_VER); - qWarning() << "Couldn't write to " << filename << " " << f.errorString(); + qWarning() << "Couldn't write to " << m_Filename << " " << f.errorString(); return false; } diff --git a/qrenderdoc/Code/PersistantConfig.h b/qrenderdoc/Code/PersistantConfig.h index 752dd6fc6..899dee240 100644 --- a/qrenderdoc/Code/PersistantConfig.h +++ b/qrenderdoc/Code/PersistantConfig.h @@ -71,6 +71,8 @@ typedef QMap QStringMap; \ CONFIG_SETTING_VAL(public, bool, bool, EventBrowser_HideEmpty, false) \ \ + CONFIG_SETTING_VAL(public, bool, bool, EventBrowser_HideAPICalls, false) \ + \ CONFIG_SETTING_VAL(public, bool, bool, EventBrowser_ApplyColours, true) \ \ CONFIG_SETTING_VAL(public, bool, bool, EventBrowser_ColourEventRow, true) \ @@ -85,6 +87,10 @@ typedef QMap QStringMap; \ CONFIG_SETTING_VAL(public, bool, bool, Font_PreferMonospaced, false) \ \ + CONFIG_SETTING_VAL(public, QString, QString, Android_AdbExecutablePath, "") \ + \ + CONFIG_SETTING_VAL(public, int, int, Android_MaxConnectTimeout, 30) \ + \ CONFIG_SETTING_VAL(public, bool, bool, CheckUpdate_AllowChecks, true) \ \ CONFIG_SETTING_VAL(public, bool, bool, CheckUpdate_UpdateAvailable, false) \ @@ -112,6 +118,7 @@ public: Milliseconds, Microseconds, Nanoseconds, + Count, }; CONFIG_SETTINGS() @@ -119,7 +126,7 @@ public: public: PersistantConfig() {} bool Deserialize(QString filename); - bool Serialize(QString filename); + bool Serialize(QString filename = ""); void SetupFormatting(); @@ -145,4 +152,6 @@ public: private: QVariantMap storeValues() const; void applyValues(const QVariantMap &values); + + QString m_Filename; }; diff --git a/qrenderdoc/Code/qrenderdoc.cpp b/qrenderdoc/Code/qrenderdoc.cpp index 841a733e0..e19115023 100644 --- a/qrenderdoc/Code/qrenderdoc.cpp +++ b/qrenderdoc/Code/qrenderdoc.cpp @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) QCoreApplication::sendPostedEvents(); } - config.Serialize(configFilename); + config.Serialize(); } delete[] argv_mod; diff --git a/qrenderdoc/Windows/Dialogs/CaptureDialog.h b/qrenderdoc/Windows/Dialogs/CaptureDialog.h index 254cd0ed7..f26f03e07 100644 --- a/qrenderdoc/Windows/Dialogs/CaptureDialog.h +++ b/qrenderdoc/Windows/Dialogs/CaptureDialog.h @@ -74,6 +74,8 @@ public: void setExecutableFilename(QString filename); void loadSettings(QString filename); + void updateGlobalHook(); + private slots: // automatic slots void on_exePathBrowse_clicked(); @@ -105,7 +107,6 @@ private: OnCaptureMethod m_CaptureCallback; OnInjectMethod m_InjectCallback; - void updateGlobalHook(); void setEnvironmentModifications(const QList &modifications); void triggerCapture(); diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp new file mode 100644 index 000000000..f0fb349c9 --- /dev/null +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp @@ -0,0 +1,336 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2017 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ + +#include "SettingsDialog.h" +#include "Code/CaptureContext.h" +#include "Code/PersistantConfig.h" +#include "Code/QRDUtils.h" +#include "CaptureDialog.h" +#include "ui_SettingsDialog.h" + +SettingsDialog::SettingsDialog(CaptureContext *ctx, QWidget *parent) + : QDialog(parent), ui(new Ui::SettingsDialog) +{ + m_Ctx = ctx; + + ui->setupUi(this); + + ui->tabWidget->tabBar()->setVisible(false); + + for(int i = 0; i < ui->tabWidget->count(); i++) + ui->pages->addItem(ui->tabWidget->tabText(i)); + + m_Init = true; + + for(int i = 0; i < (int)PersistantConfig::TimeUnit::Count; i++) + { + ui->EventBrowser_TimeUnit->addItem(PersistantConfig::UnitPrefix((PersistantConfig::TimeUnit)i)); + } + + ui->pages->clearSelection(); + ui->pages->setItemSelected(ui->pages->item(0), true); + ui->tabWidget->setCurrentIndex(0); + + ui->saveDirectory->setText(m_Ctx->Config.DefaultCaptureSaveDirectory); + ui->tempDirectory->setText(m_Ctx->Config.TemporaryCaptureDirectory); + + // TODO external disassembler + /* + ui->ExternalDisassemblerEnabled->setChecked(m_Ctx->Config.ExternalDisassemblerEnabled); + ui->externalDisassemblerArgs->setText(m_Ctx->Config.GetDefaultExternalDisassembler().args); + ui->externalDisassemblePath->setText(m_Ctx->Config.GetDefaultExternalDisassembler().executable); + */ + ui->Android_AdbExecutablePath->setText(m_Ctx->Config.Android_AdbExecutablePath); + ui->Android_MaxConnectTimeout->setValue(m_Ctx->Config.Android_MaxConnectTimeout); + + ui->TextureViewer_ResetRange->setChecked(m_Ctx->Config.TextureViewer_ResetRange); + ui->TextureViewer_PerTexSettings->setChecked(m_Ctx->Config.TextureViewer_PerTexSettings); + ui->ShaderViewer_FriendlyNaming->setChecked(m_Ctx->Config.ShaderViewer_FriendlyNaming); + ui->CheckUpdate_AllowChecks->setChecked(m_Ctx->Config.CheckUpdate_AllowChecks); + ui->Font_PreferMonospaced->setChecked(m_Ctx->Config.Font_PreferMonospaced); + + ui->AlwaysReplayLocally->setChecked(m_Ctx->Config.AlwaysReplayLocally); + + ui->AllowGlobalHook->setChecked(m_Ctx->Config.AllowGlobalHook); + + ui->EventBrowser_TimeUnit->setCurrentIndex((int)m_Ctx->Config.EventBrowser_TimeUnit); + ui->EventBrowser_HideEmpty->setChecked(m_Ctx->Config.EventBrowser_HideEmpty); + ui->EventBrowser_HideAPICalls->setChecked(m_Ctx->Config.EventBrowser_HideAPICalls); + ui->EventBrowser_ApplyColours->setChecked(m_Ctx->Config.EventBrowser_ApplyColours); + ui->EventBrowser_ColourEventRow->setChecked(m_Ctx->Config.EventBrowser_ColourEventRow); + + // disable sub-checkbox + ui->EventBrowser_ColourEventRow->setEnabled(ui->EventBrowser_ApplyColours->isChecked()); + + ui->Formatter_MinFigures->setValue(m_Ctx->Config.Formatter_MinFigures); + ui->Formatter_MaxFigures->setValue(m_Ctx->Config.Formatter_MaxFigures); + ui->Formatter_NegExp->setValue(m_Ctx->Config.Formatter_NegExp); + ui->Formatter_PosExp->setValue(m_Ctx->Config.Formatter_PosExp); + + m_Init = false; + + QObject::connect(ui->Formatter_MinFigures, OverloadedSlot::of(&QSpinBox::valueChanged), this, + &SettingsDialog::formatter_valueChanged); + QObject::connect(ui->Formatter_MaxFigures, OverloadedSlot::of(&QSpinBox::valueChanged), this, + &SettingsDialog::formatter_valueChanged); + QObject::connect(ui->Formatter_NegExp, OverloadedSlot::of(&QSpinBox::valueChanged), this, + &SettingsDialog::formatter_valueChanged); + QObject::connect(ui->Formatter_PosExp, OverloadedSlot::of(&QSpinBox::valueChanged), this, + &SettingsDialog::formatter_valueChanged); +} + +SettingsDialog::~SettingsDialog() +{ + delete ui; +} + +void SettingsDialog::on_pages_itemSelectionChanged() +{ + QList sel = ui->pages->selectedItems(); + + if(sel.empty()) + { + ui->pages->setItemSelected(ui->pages->item(ui->tabWidget->currentIndex()), true); + } + else + { + ui->tabWidget->setCurrentIndex(ui->pages->row(sel[0])); + } +} + +void SettingsDialog::on_okButton_accepted() +{ + setResult(1); + accept(); +} + +// general +void SettingsDialog::formatter_valueChanged(int val) +{ + m_Ctx->Config.Formatter_MinFigures = ui->Formatter_MinFigures->value(); + m_Ctx->Config.Formatter_MaxFigures = ui->Formatter_MaxFigures->value(); + m_Ctx->Config.Formatter_NegExp = ui->Formatter_NegExp->value(); + m_Ctx->Config.Formatter_PosExp = ui->Formatter_PosExp->value(); + + m_Ctx->Config.SetupFormatting(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_tempDirectory_textEdited(const QString &dir) +{ + if(QDir(dir).exists()) + m_Ctx->Config.TemporaryCaptureDirectory = dir; + else + m_Ctx->Config.TemporaryCaptureDirectory = ""; + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_saveDirectory_textEdited(const QString &dir) +{ + if(QDir(dir).exists() || dir == "") + m_Ctx->Config.DefaultCaptureSaveDirectory = dir; + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_browseSaveCaptureDirectory_clicked() +{ + QString dir = RDDialog::getExistingDirectory(this, "Choose default directory for saving captures", + m_Ctx->Config.DefaultCaptureSaveDirectory); + + if(dir != "") + m_Ctx->Config.DefaultCaptureSaveDirectory = dir; + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_AllowGlobalHook_toggled(bool checked) +{ + m_Ctx->Config.AllowGlobalHook = ui->AllowGlobalHook->isChecked(); + + m_Ctx->Config.Serialize(); + + if(m_Ctx->hasCaptureDialog()) + m_Ctx->captureDialog()->updateGlobalHook(); +} + +void SettingsDialog::on_CheckUpdate_AllowChecks_toggled(bool checked) +{ + m_Ctx->Config.CheckUpdate_AllowChecks = ui->CheckUpdate_AllowChecks->isChecked(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_Font_PreferMonospaced_toggled(bool checked) +{ + m_Ctx->Config.Font_PreferMonospaced = ui->Font_PreferMonospaced->isChecked(); + + m_Ctx->Config.SetupFormatting(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_AlwaysReplayLocally_toggled(bool checked) +{ + m_Ctx->Config.AlwaysReplayLocally = ui->AlwaysReplayLocally->isChecked(); + + m_Ctx->Config.Serialize(); +} + +// core +void SettingsDialog::on_chooseSearchPaths_clicked() +{ + // TODO ordered list editor +} + +// texture viewer +void SettingsDialog::on_TextureViewer_PerTexSettings_toggled(bool checked) +{ + m_Ctx->Config.TextureViewer_PerTexSettings = ui->TextureViewer_PerTexSettings->isChecked(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_TextureViewer_ResetRange_toggled(bool checked) +{ + m_Ctx->Config.TextureViewer_ResetRange = ui->TextureViewer_ResetRange->isChecked(); + + m_Ctx->Config.Serialize(); +} + +// shader viewer +void SettingsDialog::on_ShaderViewer_FriendlyNaming_toggled(bool checked) +{ + m_Ctx->Config.ShaderViewer_FriendlyNaming = ui->ShaderViewer_FriendlyNaming->isChecked(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_ExternalDisassemblerEnabled_toggled(bool checked) +{ + // TODO external disassembler + // m_Ctx->Config.ExternalDisassemblerEnabled = ui->ExternalDisassemblerEnabled->isChecked(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_browseExtDisasemble_clicked() +{ + // TODO external disassembler +} + +void SettingsDialog::on_externalDisassemblePath_textEdited(const QString &disasm) +{ + // TODO external disassembler + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_externalDisassemblerArgs_textEdited(const QString &args) +{ + // TODO external disassembler + + m_Ctx->Config.Serialize(); +} + +// event browser +void SettingsDialog::on_EventBrowser_TimeUnit_currentIndexChanged(int index) +{ + if(m_Init) + return; + + m_Ctx->Config.EventBrowser_TimeUnit = + (PersistantConfig::TimeUnit)ui->EventBrowser_TimeUnit->currentIndex(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_EventBrowser_HideEmpty_toggled(bool checked) +{ + m_Ctx->Config.EventBrowser_HideEmpty = ui->EventBrowser_HideEmpty->isChecked(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_EventBrowser_HideAPICalls_toggled(bool checked) +{ + m_Ctx->Config.EventBrowser_HideAPICalls = ui->EventBrowser_HideAPICalls->isChecked(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_EventBrowser_ApplyColours_toggled(bool checked) +{ + m_Ctx->Config.EventBrowser_ApplyColours = ui->EventBrowser_ApplyColours->isChecked(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_EventBrowser_ColourEventRow_toggled(bool checked) +{ + m_Ctx->Config.EventBrowser_ColourEventRow = ui->EventBrowser_ColourEventRow->isChecked(); + + m_Ctx->Config.Serialize(); +} + +// android +void SettingsDialog::on_browseTempCaptureDirectory_clicked() +{ + QString dir = RDDialog::getExistingDirectory(this, "Choose directory for temporary captures", + m_Ctx->Config.TemporaryCaptureDirectory); + + if(dir != "") + m_Ctx->Config.TemporaryCaptureDirectory = dir; + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_browseAdbPath_clicked() +{ + QString adb = RDDialog::getExecutableFileName( + this, "Locate adb executable", + QFileInfo(m_Ctx->Config.Android_AdbExecutablePath).absoluteDir().path()); + + if(adb != "") + m_Ctx->Config.Android_AdbExecutablePath = adb; + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_MaxConnectTimeout_valueChanged(double timeout) +{ + m_Ctx->Config.Android_MaxConnectTimeout = ui->Android_MaxConnectTimeout->value(); + + m_Ctx->Config.Serialize(); +} + +void SettingsDialog::on_Android_AdbExecutablePath_textEdited(const QString &adb) +{ + if(QFileInfo::exists(adb)) + m_Ctx->Config.Android_AdbExecutablePath = adb; + + m_Ctx->Config.Serialize(); +} diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.h b/qrenderdoc/Windows/Dialogs/SettingsDialog.h new file mode 100644 index 000000000..f70ba50ec --- /dev/null +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.h @@ -0,0 +1,98 @@ +/****************************************************************************** + * The MIT License (MIT) + * + * Copyright (c) 2017 Baldur Karlsson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + ******************************************************************************/ + +#pragma once + +#include + +namespace Ui +{ +class SettingsDialog; +} + +class QListWidgetItem; + +class CaptureContext; + +class SettingsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SettingsDialog(CaptureContext *ctx, QWidget *parent = 0); + ~SettingsDialog(); + +private slots: + // automatic slots + + // global + void on_pages_itemSelectionChanged(); + void on_okButton_accepted(); + + // general + void on_tempDirectory_textEdited(const QString &temp); + void on_saveDirectory_textEdited(const QString &save); + void on_browseSaveCaptureDirectory_clicked(); + void on_AllowGlobalHook_toggled(bool checked); + void on_CheckUpdate_AllowChecks_toggled(bool checked); + void on_Font_PreferMonospaced_toggled(bool checked); + void on_AlwaysReplayLocally_toggled(bool checked); + + // core + void on_chooseSearchPaths_clicked(); + + // texture viewer + void on_TextureViewer_PerTexSettings_toggled(bool checked); + void on_TextureViewer_ResetRange_toggled(bool checked); + + // shader viewer + void on_ShaderViewer_FriendlyNaming_toggled(bool checked); + + void on_ExternalDisassemblerEnabled_toggled(bool checked); + void on_browseExtDisasemble_clicked(); + void on_externalDisassemblePath_textEdited(const QString &path); + void on_externalDisassemblerArgs_textEdited(const QString &args); + + // event browser + void on_EventBrowser_TimeUnit_currentIndexChanged(int index); + void on_EventBrowser_HideEmpty_toggled(bool checked); + void on_EventBrowser_HideAPICalls_toggled(bool checked); + void on_EventBrowser_ApplyColours_toggled(bool checked); + void on_EventBrowser_ColourEventRow_toggled(bool checked); + + // android + void on_browseTempCaptureDirectory_clicked(); + void on_browseAdbPath_clicked(); + void on_MaxConnectTimeout_valueChanged(double timeout); + void on_Android_AdbExecutablePath_textEdited(const QString &path); + + // manual slots + void formatter_valueChanged(int value); + +private: + Ui::SettingsDialog *ui; + + CaptureContext *m_Ctx; + bool m_Init = false; +}; diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.ui b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui new file mode 100644 index 000000000..a697692a7 --- /dev/null +++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui @@ -0,0 +1,954 @@ + + + SettingsDialog + + + + 0 + 0 + 614 + 470 + + + + Settings + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + QDialogButtonBox::Ok + + + + + + + + 0 + 0 + + + + QFrame::Panel + + + QFrame::Plain + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SelectRows + + + + + + + QTabWidget::West + + + 5 + + + true + + + + General + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + General + + + + 0 + + + + + Any numbers larger than this exponent will be displayed in scientific notation. +e.g. 1000 * 10 = 1e4 + + + Positive exponential cutoff value + + + + + + + Wherever possible a monospaced font will be used instead of the default font + + + Prefer monospaced fonts in UI (restart required) + + + + + + + Decimals will display at least this many digits. +e.g. a value of 2 means 0 will display as 0.00, 0.5 as 0.50 + + + 2 + + + + + + + Changes the default directory for the save dialog when saving capture files. + +Defaults to blank, which follows system default behaviour. + + + Default save directory for captures + + + + + + + Any numbers smaller than this exponent will be displayed in scientific notation. +E.g. a value of 3 means 0.005 / 10 = 5E-4 + + + Negative exponential cutoff value + + + + + + + Decimals will display at least this many digits. +e.g. a value of 2 means 0 will display as 0.00, 0.5 as 0.50 + + + Minimum decimal places on float values + + + + + + + Enables functionality on the capture application window that will insert RenderDoc automatically +into all new processes created - then inject into the target (matching) executable. + +Useful for capturing programs indirectly that can't easily be launched directly by RenderDoc + +Since this is a global system hook it must be used carefully and only when necessary! + + + Allow global process hooking - be careful! + + + + + + + No more significant figures than this will be displayed on floats. +e.g. a value of 5 means 0.123456789 will display as 0.12345 + + + Maximum significant figures on decimals + + + + + + + Allows RenderDoc to phone home to https://renderdoc.org to anonymously check for new versions. + + + Allow periodic anonymous update checks + + + + + + + Changes the directory where capture files are saved after being created, until saved manually or deleted. + +Defaults to %TEMP%. + + + Directory for temporary capture files + + + + + + + Any numbers smaller than this exponent will be displayed in scientific notation. +E.g. a value of 3 means 0.005 / 10 = 5E-4 + + + 5 + + + + + + + Qt::Vertical + + + + 20 + 216 + + + + + + + + Changes the directory where capture files are saved after being created, until saved manually or deleted. + +Defaults to %TEMP%. + + + + + + + Changes the directory where capture files are saved after being created, until saved manually or deleted. + +Defaults to %TEMP%. + + + Browse + + + + + + + Changes the default directory for the save dialog when saving capture files. + +Defaults to blank, which follows system default behaviour. + + + Browse + + + + + + + Enables functionality on the capture application window that will insert RenderDoc automatically +into all new processes created - then inject into the target (matching) executable. + +Useful for capturing programs indirectly that can't easily be launched directly by RenderDoc + +Since this is a global system hook it must be used carefully and only when necessary! + + + + + + + + + + Allows RenderDoc to phone home to https://renderdoc.org to anonymously check for new versions. + + + + + + + + + + Wherever possible a monospaced font will be used instead of the default font + + + + + + + + + + No more significant figures than this will be displayed on floats. +e.g. a value of 5 means 0.123456789 will display as 0.12345 + + + 5 + + + + + + + Changes the default directory for the save dialog when saving capture files. + +Defaults to blank, which follows system default behaviour. + + + + + + + Any numbers larger than this exponent will be displayed in scientific notation. +e.g. 1000 * 10 = 1e4 + + + 7 + + + 10 + + + + + + + If a capture is marked as being created on a significantly different system (different OS or platform) +as is currently running, then by default the UI will prompt to ask if you want to replay on a remote context. + +This option overrides that and will always replay locally if the local context is selected. + + + Always replay logs locally, never prompt about it + + + + + + + If a capture is marked as being created on a significantly different system (different OS or platform) +as is currently running, then by default the UI will prompt to ask if you want to replay on a remote context. + +This option overrides that and will always replay locally if the local context is selected. + + + + + + + + + + + + + + Core + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Core + + + + 0 + + + + + + 0 + 0 + + + + Shader debug search paths + + + + + + + Choose paths + + + + + + + Qt::Vertical + + + + 20 + 387 + + + + + + + + + + + + Texture Viewer + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Texture Viewer + + + + 0 + + + + + + 0 + 0 + + + + Reset visible range when changing event or texture + + + Reset Range on changing selection + + + + + + + + 50 + 0 + + + + Reset visible range when changing event or texture + + + + + + + + + + + 0 + 0 + + + + The visible channels (RGBA) and selected mip/slice are remembered and restored per-texture. + + + Visible channels & mip/slice saved per-texture + + + + + + + + 50 + 0 + + + + The visible channels (RGBA) and selected mip/slice are remembered and restored per-texture. + + + + + + + + + + Qt::Vertical + + + + 20 + 378 + + + + + + + + + + + + Shader Viewer + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Shader Viewer + + + + + + + 0 + 0 + + + + In disassembly view, rename constant registers to their names from shader reflection data + + + Rename disassembly registers + + + + + + + + 50 + 0 + + + + In disassembly view, rename constant registers to their names from shader reflection data + + + + + + + + + + + + + + 0 + 0 + + + + Vulkan Shaders + + + + + + Use an external tool to disassemble SPIR-V instead of RenderDoc's built-in disassembly. + +This is useful if you want to disassemble directly to a high level language like GLSL or HLSL that can be compiled for editing. + + + Use External Disassembler + + + + + + + Use an external tool to disassemble SPIR-V instead of RenderDoc's built-in disassembly. + +This is useful if you want to disassemble directly to a high level language like GLSL or HLSL that can be compiled for editing. + + + + + + + + + + Choose the executable file to invoke every time a shader needs to be disassembled + + + + + + + External Disassembler command line arguments + + + + + + + Choose the executable file to invoke every time a shader needs to be disassembled + + + Browse + + + + + + + External Disassembler executable + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + The command line arguments to the executable. + +The {spv_bin} and {spv_disas} tags indicate the (temporary) path to the SPIR-V binary file, and the expected SPIR-V disassembled file to create. + +If {spv_disas} is not used, the tool is expected to output the disassembly on stdout. + + + + + + + NOTE: Use the {spv_bin} and {spv_disas} tags to indicate to the external disassembler the input SPIR-V binary and the output SPIR-V disassembly respectively. + + + true + + + + + + + + + + + Event Browser + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Event Browser + + + + + + + 0 + 0 + + + + The time unit to use when displaying the duration column in the event browser + + + Time unit used for drawcall durations + + + + + + + Qt::Vertical + + + + 20 + 297 + + + + + + + + The time unit to use when displaying the duration column in the event browser + + + + + + + In the Event Browser and Timeline Bar, marker sections that contain no API calls or drawcalls will be completely removed + + + Hide empty marker sections (requires file reload) + + + + + + + In the Event Browser and Timeline Bar, marker sections that contain no API calls or drawcalls will be completely removed + + + + + + + + + + In the Event Browser and Timeline Bar, marker sections that contain only non-draw API calls - e.g. only queries, or only state setting - will be completely removed + + + + + + + + + + In the Event Browser and Timeline Bar, marker sections that contain only non-draw API calls - e.g. only queries, or only state setting - will be completely removed + + + Hide marker sections with only non-draw API calls (requires file reload) + + + true + + + + + + + In the Event Browser and Timeline Bar, marker sections and marker labels will be coloured with an API-specified colour. + + + + + + + + + + + When colouring marker sections in the Event Browser, the whole row of a marker region will be coloured, not just a bar to the left of its children. + + + + + + + + + + In the Event Browser and Timeline Bar, marker sections and marker labels will be coloured with an API-specified colour. + + + + Apply marker colours (requires file reload) + + + + + + + When colouring marker sections in the Event Browser, the whole row of a marker region will be coloured, not just a bar to the left of its children. + + + - Colourise whole row for marker regions + + + + + + + + + + + Android + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Android + + + + + + The location of adb.exe, used to control Android devices. + + + Android ADB executable path + + + + + + + Qt::Vertical + + + + 20 + 325 + + + + + + + + Maximum time to try connecting to the target app. + + + Max Connection Timeout (seconds) + + + + + + + Maximum time to try connecting to the target app. + + + 2 + + + 100.000000000000000 + + + + + + + The location of adb.exe, used to control Android devices. + + + + + + + The location of adb.exe, used to control Android devices. + + + Browse + + + + + + + + + + + + + + + diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index aeaf4ecb5..f042cc4b5 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -36,6 +36,7 @@ #include "Windows/Dialogs/AboutDialog.h" #include "Windows/Dialogs/CaptureDialog.h" #include "Windows/Dialogs/LiveCapture.h" +#include "Windows/Dialogs/SettingsDialog.h" #include "APIInspector.h" #include "BufferViewer.h" #include "ConstantBufferPreviewer.h" @@ -1121,6 +1122,12 @@ void MainWindow::on_action_Resolve_Symbols_triggered() thread->start(); } +void MainWindow::on_action_Settings_triggered() +{ + SettingsDialog about(m_Ctx, this); + RDDialog::show(&about); +} + void MainWindow::saveLayout_triggered() { LoadSaveLayout(qobject_cast(QObject::sender()), true); diff --git a/qrenderdoc/Windows/MainWindow.h b/qrenderdoc/Windows/MainWindow.h index a7e60820b..98d3756ce 100644 --- a/qrenderdoc/Windows/MainWindow.h +++ b/qrenderdoc/Windows/MainWindow.h @@ -97,6 +97,7 @@ private slots: void on_action_Statistics_Viewer_triggered(); void on_action_Inject_into_Process_triggered(); void on_action_Resolve_Symbols_triggered(); + void on_action_Settings_triggered(); // manual slots void saveLayout_triggered(); diff --git a/qrenderdoc/Windows/MainWindow.ui b/qrenderdoc/Windows/MainWindow.ui index e18c955c3..38ba74f5e 100644 --- a/qrenderdoc/Windows/MainWindow.ui +++ b/qrenderdoc/Windows/MainWindow.ui @@ -50,10 +50,11 @@ &Tools - - - + + + + @@ -329,14 +330,14 @@ &Log Statistics - + - &Options + &Settings - + - &Manage Replay Devices + &Manage Remote Servers @@ -389,6 +390,11 @@ Statisti&cs Viewer + + + Start &Android Remote Server + + diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro index 225978c8f..d5fdbdf1a 100644 --- a/qrenderdoc/qrenderdoc.pro +++ b/qrenderdoc/qrenderdoc.pro @@ -133,7 +133,8 @@ SOURCES += Code/qrenderdoc.cpp \ Windows/BufferViewer.cpp \ Widgets/Extended/RDTableView.cpp \ Windows/DebugMessageView.cpp \ - Windows/StatisticsViewer.cpp + Windows/StatisticsViewer.cpp \ + Windows/Dialogs/SettingsDialog.cpp HEADERS += Code/CaptureContext.h \ Code/qprocessinfo.h \ @@ -171,7 +172,8 @@ HEADERS += Code/CaptureContext.h \ Windows/BufferViewer.h \ Widgets/Extended/RDTableView.h \ Windows/DebugMessageView.h \ - Windows/StatisticsViewer.h + Windows/StatisticsViewer.h \ + Windows/Dialogs/SettingsDialog.h FORMS += Windows/Dialogs/AboutDialog.ui \ Windows/MainWindow.ui \ @@ -193,7 +195,8 @@ FORMS += Windows/Dialogs/AboutDialog.ui \ Windows/BufferViewer.ui \ Windows/ShaderViewer.ui \ Windows/DebugMessageView.ui \ - Windows/StatisticsViewer.ui + Windows/StatisticsViewer.ui \ + Windows/Dialogs/SettingsDialog.ui RESOURCES += resources.qrc diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index edf7ca84a..0f6b898b3 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -519,6 +519,7 @@ + @@ -550,6 +551,7 @@ + @@ -661,6 +663,7 @@ + @@ -688,6 +691,7 @@ + @@ -717,6 +721,7 @@ + diff --git a/qrenderdoc/qrenderdoc_local.vcxproj.filters b/qrenderdoc/qrenderdoc_local.vcxproj.filters index 118bcc967..bf05f31c8 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj.filters +++ b/qrenderdoc/qrenderdoc_local.vcxproj.filters @@ -478,6 +478,12 @@ Generated Files + + Windows\Dialogs + + + Generated Files + @@ -849,6 +855,12 @@ Generated Files + + Windows\Dialogs + + + Generated Files + @@ -1087,6 +1099,9 @@ + + Windows\Dialogs +