1
0
Fork 0

Add an option to disable the menu icons

This commit is contained in:
Duncan Ogilvie 2023-07-16 13:23:55 +02:00
parent fe82859b6f
commit 2f181ed2e6
8 changed files with 127 additions and 121 deletions

View File

@ -84,7 +84,7 @@ bool bUndecorateSymbolNames = true;
bool bEnableSourceDebugging = false; bool bEnableSourceDebugging = false;
bool bSkipInt3Stepping = false; bool bSkipInt3Stepping = false;
bool bIgnoreInconsistentBreakpoints = false; bool bIgnoreInconsistentBreakpoints = false;
bool bNoForegroundWindow = false; bool bNoForegroundWindow = true;
bool bVerboseExceptionLogging = true; bool bVerboseExceptionLogging = true;
bool bNoWow64SingleStepWorkaround = false; bool bNoWow64SingleStepWorkaround = false;
bool bTraceBrowserNeedsUpdate = false; bool bTraceBrowserNeedsUpdate = false;

View File

@ -45,7 +45,7 @@ CPUMultiDump::CPUMultiDump(CPUDisassembly* disas, int nbCpuDumpTabs, QWidget* pa
this->addTabEx(mLocalVars, DIcon("localvars"), tr("Locals"), "Locals"); this->addTabEx(mLocalVars, DIcon("localvars"), tr("Locals"), "Locals");
mStructWidget = new StructWidget(this); mStructWidget = new StructWidget(this);
this->addTabEx(mStructWidget, mStructWidget->windowIcon(), mStructWidget->windowTitle(), "Struct"); this->addTabEx(mStructWidget, DIcon("struct"), mStructWidget->windowTitle(), "Struct");
connect(this, SIGNAL(currentChanged(int)), this, SLOT(updateCurrentTabSlot(int))); connect(this, SIGNAL(currentChanged(int)), this, SLOT(updateCurrentTabSlot(int)));
connect(tabBar(), SIGNAL(OnDoubleClickTabIndex(int)), this, SLOT(openChangeTabTitleDialogSlot(int))); connect(tabBar(), SIGNAL(OnDoubleClickTabIndex(int)), this, SLOT(openChangeTabTitleDialogSlot(int)));

View File

@ -415,6 +415,28 @@ MainWindow::MainWindow(QWidget* parent)
QTimer::singleShot(0, this, SLOT(loadWindowSettings())); QTimer::singleShot(0, this, SLOT(loadWindowSettings()));
updateDarkTitleBar(this); updateDarkTitleBar(this);
// Hide the menu icons if the setting is enabled
duint noIcons = 0;
BridgeSettingGetUint("Gui", "NoIcons", &noIcons);
if(noIcons)
{
QList<QList<QAction*>> stack;
stack.push_back(ui->menuBar->actions());
while(!stack.isEmpty())
{
auto actions = stack.back();
stack.pop_back();
for(auto action : actions)
{
action->setIconVisibleInMenu(false);
if(action->menu())
{
stack.push_back(action->menu()->actions());
}
}
}
}
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()

View File

@ -52,46 +52,7 @@ void SettingsDialog::LoadSettings()
Config()->save(); Config()->save();
//Defaults //Defaults
memset(&settings, 0, sizeof(SettingsStruct));
settings.eventSystemBreakpoint = true;
settings.eventTlsCallbacks = true;
settings.eventEntryBreakpoint = true;
settings.eventExitBreakpoint = false;
settings.engineType = DebugEngineTitanEngine;
settings.engineCalcType = calc_unsigned;
settings.engineBreakpointType = break_int3short;
settings.engineUndecorateSymbolNames = true;
settings.engineEnableDebugPrivilege = true;
settings.engineEnableSourceDebugging = false;
settings.engineNoScriptTimeout = false;
settings.engineIgnoreInconsistentBreakpoints = false;
settings.engineNoWow64SingleStepWorkaround = false;
settings.engineDisableAslr = false;
settings.engineMaxTraceCount = 50000;
settings.engineAnimateInterval = 50;
settings.engineHardcoreThreadSwitchWarning = false;
settings.engineVerboseExceptionLogging = true;
settings.exceptionFilters = &realExceptionFilters; settings.exceptionFilters = &realExceptionFilters;
settings.disasmArgumentSpaces = false;
settings.disasmHidePointerSizes = false;
settings.disasmHideNormalSegments = false;
settings.disasmMemorySpaces = false;
settings.disasmUppercase = false;
settings.disasmOnlyCipAutoComments = false;
settings.disasmTabBetweenMnemonicAndArguments = false;
settings.disasmNoCurrentModuleText = false;
settings.disasm0xPrefixValues = false;
settings.disasmNoBranchDisasmPreview = false;
settings.disasmNoSourceLineAutoComments = false;
settings.disasmAssembleOnDoubleClick = false;
settings.disasmMaxModuleSize = -1;
settings.guiNoForegroundWindow = true;
settings.guiLoadSaveTabOrder = true;
settings.guiDisableAutoComplete = false;
settings.guiAutoFollowInStack = false;
settings.guiHideSeasonalIcons = false;
settings.guiEnableQtHighDpiScaling = true;
settings.guiEnableWindowLongPath = false;
//Events tab //Events tab
GetSettingBool("Events", "SystemBreakpoint", &settings.eventSystemBreakpoint); GetSettingBool("Events", "SystemBreakpoint", &settings.eventSystemBreakpoint);
@ -312,6 +273,7 @@ void SettingsDialog::LoadSettings()
GetSettingBool("Gui", "NoSeasons", &settings.guiHideSeasonalIcons); GetSettingBool("Gui", "NoSeasons", &settings.guiHideSeasonalIcons);
GetSettingBool("Gui", "EnableQtHighDpiScaling", &settings.guiEnableQtHighDpiScaling); GetSettingBool("Gui", "EnableQtHighDpiScaling", &settings.guiEnableQtHighDpiScaling);
GetSettingBool("Gui", "WindowLongPath", &settings.guiEnableWindowLongPath); GetSettingBool("Gui", "WindowLongPath", &settings.guiEnableWindowLongPath);
GetSettingBool("Gui", "NoIcons", &settings.guiNoIcons);
ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian); ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian);
ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder); ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder);
ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog); ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog);
@ -328,6 +290,7 @@ void SettingsDialog::LoadSettings()
ui->chkHideSeasonalIcons->setVisible(isSeasonal()); ui->chkHideSeasonalIcons->setVisible(isSeasonal());
ui->chkQtHighDpiScaling->setChecked(settings.guiEnableQtHighDpiScaling); ui->chkQtHighDpiScaling->setChecked(settings.guiEnableQtHighDpiScaling);
ui->chkWindowLongPath->setChecked(settings.guiEnableWindowLongPath); ui->chkWindowLongPath->setChecked(settings.guiEnableWindowLongPath);
ui->chkNoIcons->setChecked(settings.guiNoIcons);
//Misc tab //Misc tab
if(DbgFunctions()->GetJit) if(DbgFunctions()->GetJit)
@ -479,6 +442,7 @@ void SettingsDialog::SaveSettings()
BridgeSettingSetUint("Gui", "NoSeasons", settings.guiHideSeasonalIcons); BridgeSettingSetUint("Gui", "NoSeasons", settings.guiHideSeasonalIcons);
BridgeSettingSetUint("Gui", "EnableQtHighDpiScaling", settings.guiEnableQtHighDpiScaling); BridgeSettingSetUint("Gui", "EnableQtHighDpiScaling", settings.guiEnableQtHighDpiScaling);
BridgeSettingSetUint("Gui", "WindowLongPath", settings.guiEnableWindowLongPath); BridgeSettingSetUint("Gui", "WindowLongPath", settings.guiEnableWindowLongPath);
BridgeSettingSetUint("Gui", "NoIcons", settings.guiNoIcons);
//Misc tab //Misc tab
if(DbgFunctions()->GetJit) if(DbgFunctions()->GetJit)
@ -1194,3 +1158,9 @@ void SettingsDialog::on_chkWindowLongPath_toggled(bool checked)
{ {
settings.guiEnableWindowLongPath = checked; settings.guiEnableWindowLongPath = checked;
} }
void SettingsDialog::on_chkNoIcons_toggled(bool checked)
{
settings.guiNoIcons = checked;
}

View File

@ -107,6 +107,9 @@ private slots:
void on_chkDisableAutoComplete_toggled(bool checked); void on_chkDisableAutoComplete_toggled(bool checked);
void on_chkAutoFollowInStack_toggled(bool checked); void on_chkAutoFollowInStack_toggled(bool checked);
void on_chkHideSeasonalIcons_toggled(bool checked); void on_chkHideSeasonalIcons_toggled(bool checked);
void on_chkQtHighDpiScaling_toggled(bool checked);
void on_chkWindowLongPath_toggled(bool checked);
void on_chkNoIcons_toggled(bool checked);
//Misc tab //Misc tab
void on_chkSetJIT_stateChanged(int arg1); void on_chkSetJIT_stateChanged(int arg1);
void on_editSymbolStore_textEdited(const QString & arg1); void on_editSymbolStore_textEdited(const QString & arg1);
@ -119,9 +122,6 @@ private slots:
void on_chkQueryWorkingSet_toggled(bool checked); void on_chkQueryWorkingSet_toggled(bool checked);
void on_chkTransparentExceptionStepping_toggled(bool checked); void on_chkTransparentExceptionStepping_toggled(bool checked);
void on_chkQtHighDpiScaling_toggled(bool checked);
void on_chkWindowLongPath_toggled(bool checked);
private: private:
//enums //enums
enum CalcType enum CalcType
@ -173,86 +173,90 @@ private:
} }
}; };
// Unfortunately there are multiple sources of truth for the defaults.
// Some are in Configuration::Configuration and some in _exports.cpp
// case DBG_SETTINGS_UPDATED
struct SettingsStruct struct SettingsStruct
{ {
//Event Tab //Event Tab
bool eventSystemBreakpoint; bool eventSystemBreakpoint = true;
bool eventExitBreakpoint; bool eventExitBreakpoint = false;
bool eventTlsCallbacks; bool eventTlsCallbacks = true;
bool eventTlsCallbacksSystem; bool eventTlsCallbacksSystem = true;
bool eventEntryBreakpoint; bool eventEntryBreakpoint = true;
bool eventDllEntry; bool eventDllEntry = false;
bool eventDllEntrySystem; bool eventDllEntrySystem = false;
bool eventThreadEntry; bool eventThreadEntry = false;
bool eventDllLoad; bool eventDllLoad = false;
bool eventDllUnload; bool eventDllUnload = false;
bool eventDllLoadSystem; bool eventDllLoadSystem = false;
bool eventDllUnloadSystem; bool eventDllUnloadSystem = false;
bool eventThreadStart; bool eventThreadStart = false;
bool eventThreadEnd; bool eventThreadEnd = false;
bool eventThreadNameSet; bool eventThreadNameSet = false;
bool eventDebugStrings; bool eventDebugStrings = false;
//Engine Tab //Engine Tab
CalcType engineCalcType; CalcType engineCalcType = calc_unsigned;
DEBUG_ENGINE engineType; DEBUG_ENGINE engineType = DebugEngineTitanEngine;
BreakpointType engineBreakpointType; BreakpointType engineBreakpointType = break_int3short;
bool engineUndecorateSymbolNames; bool engineUndecorateSymbolNames = true;
bool engineEnableDebugPrivilege; bool engineEnableDebugPrivilege = true;
bool engineEnableSourceDebugging; bool engineEnableSourceDebugging = false;
bool engineSaveDatabaseInProgramDirectory; bool engineSaveDatabaseInProgramDirectory = false;
bool engineDisableDatabaseCompression; bool engineDisableDatabaseCompression = false;
bool engineSkipInt3Stepping; bool engineSkipInt3Stepping = false;
bool engineNoScriptTimeout; bool engineNoScriptTimeout = false;
bool engineIgnoreInconsistentBreakpoints; bool engineIgnoreInconsistentBreakpoints = false;
bool engineHardcoreThreadSwitchWarning; bool engineHardcoreThreadSwitchWarning = false;
bool engineVerboseExceptionLogging; bool engineVerboseExceptionLogging = true;
bool engineNoWow64SingleStepWorkaround; bool engineNoWow64SingleStepWorkaround = false;
bool engineDisableAslr; bool engineDisableAslr = false;
int engineMaxTraceCount; int engineMaxTraceCount = 50000;
int engineAnimateInterval; int engineAnimateInterval = 50;
//Exception Tab //Exception Tab
QList<ExceptionFilter>* exceptionFilters; QList<ExceptionFilter>* exceptionFilters = nullptr;
//Disasm Tab //Disasm Tab
bool disasmArgumentSpaces; bool disasmArgumentSpaces = false;
bool disasmMemorySpaces; bool disasmMemorySpaces = false;
bool disasmHidePointerSizes; bool disasmHidePointerSizes = false;
bool disasmHideNormalSegments; bool disasmHideNormalSegments = false;
bool disasmUppercase; bool disasmUppercase = false;
bool disasmOnlyCipAutoComments; bool disasmOnlyCipAutoComments = false;
bool disasmTabBetweenMnemonicAndArguments; bool disasmTabBetweenMnemonicAndArguments = false;
bool disasmNoHighlightOperands; bool disasmNoHighlightOperands;
bool disasmNoCurrentModuleText; bool disasmNoCurrentModuleText = false;
bool disasmPermanentHighlightingMode; bool disasmPermanentHighlightingMode;
bool disasm0xPrefixValues; bool disasm0xPrefixValues = false;
bool disasmNoBranchDisasmPreview; bool disasmNoBranchDisasmPreview = false;
bool disasmNoSourceLineAutoComments; bool disasmNoSourceLineAutoComments = false;
bool disasmAssembleOnDoubleClick; bool disasmAssembleOnDoubleClick = false;
int disasmMaxModuleSize; int disasmMaxModuleSize = -1;
//Gui Tab //Gui Tab
bool guiFpuRegistersLittleEndian; bool guiFpuRegistersLittleEndian = false;
bool guiSaveColumnOrder; bool guiSaveColumnOrder = false;
bool guiNoCloseDialog; bool guiNoCloseDialog = false;
bool guiPidTidInHex; bool guiPidTidInHex = false;
bool guiSidebarWatchLabels; bool guiSidebarWatchLabels = false;
bool guiNoForegroundWindow; bool guiNoForegroundWindow = true;
bool guiLoadSaveTabOrder; bool guiLoadSaveTabOrder = true;
bool guiShowGraphRva; bool guiShowGraphRva = false;
bool guiGraphZoomMode; bool guiGraphZoomMode = true;
bool guiShowExitConfirmation; bool guiShowExitConfirmation = true;
bool guiDisableAutoComplete; bool guiDisableAutoComplete = false;
bool guiAutoFollowInStack; bool guiAutoFollowInStack = false;
bool guiHideSeasonalIcons; bool guiHideSeasonalIcons = false;
bool guiEnableQtHighDpiScaling; bool guiEnableQtHighDpiScaling = true;
bool guiEnableWindowLongPath; bool guiEnableWindowLongPath = false;
bool guiNoIcons = false;
//Misc Tab //Misc Tab
bool miscSetJIT; bool miscSetJIT = false;
bool miscSymbolStore; bool miscSymbolStore = false;
bool miscSymbolCache; bool miscSymbolCache = false;
bool miscUtf16LogRedirect; bool miscUtf16LogRedirect = false;
bool miscUseLocalHelpFile; bool miscUseLocalHelpFile = false;
bool miscQueryProcessCookie; bool miscQueryProcessCookie = false;
bool miscQueryWorkingSet; bool miscQueryWorkingSet = false;
bool miscTransparentExceptionStepping; bool miscTransparentExceptionStepping = true;
}; };
//variables //variables

View File

@ -948,6 +948,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="chkNoIcons">
<property name="text">
<string>Disable icons*</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacerGUI"> <spacer name="verticalSpacerGUI">
<property name="orientation"> <property name="orientation">

View File

@ -16,10 +16,6 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Struct</string> <string>Struct</string>
</property> </property>
<property name="windowIcon">
<iconset theme="struct" resource="../../resource.qrc">
<normaloff>:/Default/icons/struct.png</normaloff>:/Default/icons/struct.png</iconset>
</property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
@ -77,8 +73,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources> <resources/>
<include location="../../resource.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -296,6 +296,12 @@ bool ExportCSV(dsint rows, dsint columns, std::vector<QString> headers, std::fun
return false; return false;
} }
static bool allowIcons()
{
duint setting = 0;
return !BridgeSettingGetUint("Gui", "NoIcons", &setting) || !setting;
}
static bool allowSeasons() static bool allowSeasons()
{ {
srand(GetTickCount()); srand(GetTickCount());
@ -337,6 +343,9 @@ QIcon DIconHelper(QString name)
{ {
if(name.endsWith(".png")) if(name.endsWith(".png"))
name = name.left(name.length() - 4); name = name.left(name.length() - 4);
static bool icons = allowIcons();
if(!icons)
return QIcon();
static bool seasons = allowSeasons(); static bool seasons = allowSeasons();
static bool christmas = isChristmas(); static bool christmas = isChristmas();
static bool easter = isEaster(); static bool easter = isEaster();