QFont Settings::GetDebugFont() const { QFont default_font = QFont(QStringLiteral("Monospace")); default_font.setStyleHint(QFont::TypeWriter); return GetQSettings().value(QStringLiteral("debugger/font"), default_font).value<QFont>(); }
void Settings::SetLogConfigVisible(bool visible) { if (IsLogConfigVisible() != visible) { GetQSettings().setValue(QStringLiteral("logging/logconfigvisible"), visible); emit LogConfigVisibilityChanged(visible); } }
void Settings::SetAutoRefreshEnabled(bool enabled) { if (IsAutoRefreshEnabled() == enabled) return; GetQSettings().setValue(QStringLiteral("gamelist/autorefresh"), enabled); emit AutoRefreshToggled(enabled); }
void Settings::SetRegistersVisible(bool enabled) { if (IsRegistersVisible() != enabled) { GetQSettings().setValue(QStringLiteral("debugger/showregisters"), enabled); emit RegistersVisibilityChanged(enabled); } }
void Settings::SetCodeVisible(bool enabled) { if (IsCodeVisible() != enabled) { GetQSettings().setValue(QStringLiteral("debugger/showcode"), enabled); emit CodeVisibilityChanged(enabled); } }
void Settings::SetDebugFont(QFont font) { if (GetDebugFont() != font) { GetQSettings().setValue(QStringLiteral("debugger/font"), font); emit DebugFontChanged(font); } }
void Settings::SetToolBarVisible(bool visible) { if (IsToolBarVisible() == visible) return; GetQSettings().setValue(QStringLiteral("toolbar/visible"), visible); emit ToolBarVisibilityChanged(visible); }
void Settings::SetWidgetsLocked(bool locked) { if (AreWidgetsLocked() == locked) return; GetQSettings().setValue(QStringLiteral("widgets/locked"), locked); emit WidgetLockChanged(locked); }
void Settings::SetWatchVisible(bool enabled) { if (IsWatchVisible() != enabled) { GetQSettings().setValue(QStringLiteral("debugger/showwatch"), enabled); emit WatchVisibilityChanged(enabled); } }
void Settings::SetBreakpointsVisible(bool enabled) { if (IsBreakpointsVisible() != enabled) { GetQSettings().setValue(QStringLiteral("debugger/showbreakpoints"), enabled); emit BreakpointsVisibilityChanged(enabled); } }
void Settings::SetCurrentUserStyle(const QString& stylesheet_path) { QString stylesheet_contents; if (!stylesheet_path.isEmpty() && AreUserStylesEnabled()) { // Load custom user stylesheet QFile stylesheet(stylesheet_path); if (stylesheet.open(QFile::ReadOnly)) stylesheet_contents = QString::fromUtf8(stylesheet.readAll().data()); } qApp->setStyleSheet(stylesheet_contents); GetQSettings().setValue(QStringLiteral("userstyle/path"), stylesheet_path); }
QString Settings::GetCurrentUserStyle() const { return GetQSettings().value(QStringLiteral("userstyle/path"), false).toString(); }
bool Settings::IsBreakpointsVisible() const { return GetQSettings().value(QStringLiteral("debugger/showbreakpoints")).toBool(); }
bool Settings::GetPreferredView() const { return GetQSettings().value(QStringLiteral("PreferredView"), true).toBool(); }
bool Settings::AreWidgetsLocked() const { return GetQSettings().value(QStringLiteral("widgets/locked"), true).toBool(); }
void Settings::SetPreferredView(bool list) { GetQSettings().setValue(QStringLiteral("PreferredView"), list); }
bool Settings::IsToolBarVisible() const { return GetQSettings().value(QStringLiteral("toolbar/visible"), true).toBool(); }
void Settings::SetStateSlot(int slot) { GetQSettings().setValue(QStringLiteral("Emulation/StateSlot"), slot); }
int Settings::GetStateSlot() const { return GetQSettings().value(QStringLiteral("Emulation/StateSlot"), 1).toInt(); }
bool Settings::IsCodeVisible() const { return GetQSettings().value(QStringLiteral("debugger/showcode")).toBool(); }
bool Settings::IsLogConfigVisible() const { return GetQSettings().value(QStringLiteral("logging/logconfigvisible")).toBool(); }
bool Settings::IsRegistersVisible() const { return GetQSettings().value(QStringLiteral("debugger/showregisters")).toBool(); }
bool Settings::AreUserStylesEnabled() const { return GetQSettings().value(QStringLiteral("userstyle/enabled"), false).toBool(); }
bool Settings::IsWatchVisible() const { return GetQSettings().value(QStringLiteral("debugger/showwatch")).toBool(); }
void Settings::SetUserStylesEnabled(bool enabled) { GetQSettings().setValue(QStringLiteral("userstyle/enabled"), enabled); }
bool Settings::IsAutoRefreshEnabled() const { return GetQSettings().value(QStringLiteral("gamelist/autorefresh"), true).toBool(); }