| 1 | #cxx . . $ `<file>/src/PreferencesDialog.cpp`/include "PreferencesDialog.h"cxx . . $ `<file>/src/PreferencesDialog.h`/ |
| 2 | #include "Settings.h"cxx . . $ `<file>/src/Settings.h`/ |
| 3 | #include <QListWidgetItem> |
| 4 | #include <QFontDialog> |
| 5 | #include <QColorDialog> |
| 6 | |
| 7 | PreferencesDialogcxx . . $ PreferencesDialog#::PreferencesDialogcxx . . $ PreferencesDialog#PreferencesDialog(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent) |
| 8 | : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent) |
| 9 | { |
| 10 | setupUicxx . . $ Ui_PreferencesDialog#setupUi(d194de0c0f68c28b).(this); |
| 11 | |
| 12 | connectcxx . . $ QObject#connect(835f87066c895669).(listFontscxx . . $ Ui_PreferencesDialog#listFonts., &QListWidgetcxx . . $ QListWidget#::currentRowChangedcxx . . $ QListWidget#currentRowChanged(d4f767463ce0a6b3)., |
| 13 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::fontSelectionChangecxx . . $ PreferencesDialog#fontSelectionChange(d4f767463ce0a6b3).); |
| 14 | connectcxx . . $ QObject#connect(835f87066c895669).(rbUseAppFontcxx . . $ Ui_PreferencesDialog#rbUseAppFont., &QRadioButtoncxx . . $ QRadioButton#::toggledcxx . . $ QAbstractButton#toggled(b45ddcbc8423892c)., |
| 15 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::fontTypeChangedcxx . . $ PreferencesDialog#fontTypeChanged(b45ddcbc8423892c).); |
| 16 | connectcxx . . $ QObject#connect(835f87066c895669).(rbUseFixedFontcxx . . $ Ui_PreferencesDialog#rbUseFixedFont., &QRadioButtoncxx . . $ QRadioButton#::toggledcxx . . $ QAbstractButton#toggled(b45ddcbc8423892c)., |
| 17 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::fontTypeChangedcxx . . $ PreferencesDialog#fontTypeChanged(b45ddcbc8423892c).); |
| 18 | connectcxx . . $ QObject#connect(835f87066c895669).(rbUseCustomFontcxx . . $ Ui_PreferencesDialog#rbUseCustomFont., &QRadioButtoncxx . . $ QRadioButton#::toggledcxx . . $ QAbstractButton#toggled(b45ddcbc8423892c)., |
| 19 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::fontTypeChangedcxx . . $ PreferencesDialog#fontTypeChanged(b45ddcbc8423892c).); |
| 20 | connectcxx . . $ QObject#connect(835f87066c895669).(btnSelectFontcxx . . $ Ui_PreferencesDialog#btnSelectFont., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., |
| 21 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::fontSelectCustomcxx . . $ PreferencesDialog#fontSelectCustom(49f6e7a06ebc5aa8).); |
| 22 | connectcxx . . $ QObject#connect(835f87066c895669).(btnFontColorcxx . . $ Ui_PreferencesDialog#btnFontColor., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., |
| 23 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::fontSelectColorcxx . . $ PreferencesDialog#fontSelectColor(49f6e7a06ebc5aa8).); |
| 24 | |
| 25 | initConfigcxx . . $ PreferencesDialog#initConfig(49f6e7a06ebc5aa8).(); |
| 26 | initFontListcxx . . $ PreferencesDialog#initFontList(49f6e7a06ebc5aa8).(); |
| 27 | listFontscxx . . $ Ui_PreferencesDialog#listFonts.->setCurrentRowcxx . . $ QListWidget#setCurrentRow(d4f767463ce0a6b3).(0); |
| 28 | } |
| 29 | |
| 30 | /* |
| 31 | * Config settings |
| 32 | */ |
| 33 | void PreferencesDialogcxx . . $ PreferencesDialog#::initConfigcxx . . $ PreferencesDialog#initConfig(49f6e7a06ebc5aa8).() |
| 34 | { |
| 35 | Settingscxx . . $ Settings#& s = Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).(); |
| 36 | int status1 = s.autoReloadSymbolscxx . . $ Settings#autoReloadSymbols(50ce9a9e25b4a850).() ? Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked. : Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked.; |
| 37 | cbAutoReloadSymbolscxx . . $ Ui_PreferencesDialog#cbAutoReloadSymbols.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(status1); |
| 38 | connectcxx . . $ QObject#connect(835f87066c895669).(cbAutoReloadSymbolscxx . . $ Ui_PreferencesDialog#cbAutoReloadSymbols., &QCheckBoxcxx . . $ QCheckBox#::stateChangedcxx . . $ QCheckBox#stateChanged(d4f767463ce0a6b3)., |
| 39 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::autoReloadSymbolscxx . . $ PreferencesDialog#autoReloadSymbols(d4f767463ce0a6b3).); |
| 40 | |
| 41 | int status2 = s.preserveLostSymbolscxx . . $ Settings#preserveLostSymbols(50ce9a9e25b4a850).() ? Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked. : Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked.; |
| 42 | cbPreserveLostSymbolscxx . . $ Ui_PreferencesDialog#cbPreserveLostSymbols.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(status2); |
| 43 | connectcxx . . $ QObject#connect(835f87066c895669).(cbPreserveLostSymbolscxx . . $ Ui_PreferencesDialog#cbPreserveLostSymbols., &QCheckBoxcxx . . $ QCheckBox#::stateChangedcxx . . $ QCheckBox#stateChanged(d4f767463ce0a6b3)., |
| 44 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::preserveLostSymbolscxx . . $ PreferencesDialog#preserveLostSymbols(d4f767463ce0a6b3).); |
| 45 | |
| 46 | int status3 = s.preserveBreakpointSymbolcxx . . $ Settings#preserveBreakpointSymbol(50ce9a9e25b4a850).() ? Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked. : Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked.; |
| 47 | cbPreserveBreakpointSymbolcxx . . $ Ui_PreferencesDialog#cbPreserveBreakpointSymbol.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(status3); |
| 48 | connectcxx . . $ QObject#connect(835f87066c895669).(cbPreserveBreakpointSymbolcxx . . $ Ui_PreferencesDialog#cbPreserveBreakpointSymbol., &QCheckBoxcxx . . $ QCheckBox#::stateChangedcxx . . $ QCheckBox#stateChanged(d4f767463ce0a6b3)., |
| 49 | this, &PreferencesDialogcxx . . $ PreferencesDialog#::preserveBreakpointSymbolcxx . . $ PreferencesDialog#preserveBreakpointSymbol(d4f767463ce0a6b3).); |
| 50 | } |
| 51 | /* |
| 52 | * Font settings |
| 53 | */ |
| 54 | void PreferencesDialogcxx . . $ PreferencesDialog#::initFontListcxx . . $ PreferencesDialog#initFontList(49f6e7a06ebc5aa8).() |
| 55 | { |
| 56 | Settingscxx . . $ Settings#& s = Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).(); |
| 57 | listFontscxx . . $ Ui_PreferencesDialog#listFonts.->clearcxx . . $ QListWidget#clear(49f6e7a06ebc5aa8).(); |
| 58 | for (int f = Settingscxx . . $ Settings#::APP_FONTcxx . . $ Settings#APP_FONT.; f < Settingscxx . . $ Settings#::FONT_ENDcxx . . $ Settings#FONT_END.; ++f) { |
| 59 | new QListWidgetItemcxx . . $ QListWidgetItem#(s.fontNamecxx . . $ Settings#fontName(c839769550b535c3).((Settingscxx . . $ Settings#::DebuggerFontcxx . . $ Settings#DebuggerFont#)f), listFontscxx . . $ Ui_PreferencesDialog#listFonts.); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | void PreferencesDialogcxx . . $ PreferencesDialog#::fontSelectionChangecxx . . $ PreferencesDialog#fontSelectionChange(d4f767463ce0a6b3).(int row) |
| 64 | { |
| 65 | updatingcxx . . $ PreferencesDialog#updating. = true; |
| 66 | if (row == 0) { |
| 67 | rbUseAppFontcxx . . $ Ui_PreferencesDialog#rbUseAppFont.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(trcxx . . $ PreferencesDialog#tr(75d9f1c324b4579d).("Use system font")); |
| 68 | } else { |
| 69 | rbUseAppFontcxx . . $ Ui_PreferencesDialog#rbUseAppFont.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(trcxx . . $ PreferencesDialog#tr(75d9f1c324b4579d).("Use application font")); |
| 70 | } |
| 71 | |
| 72 | rbUseAppFontcxx . . $ Ui_PreferencesDialog#rbUseAppFont.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(row >= 0); |
| 73 | rbUseFixedFontcxx . . $ Ui_PreferencesDialog#rbUseFixedFont.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(row > 1); |
| 74 | rbUseCustomFontcxx . . $ Ui_PreferencesDialog#rbUseCustomFont.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(row >= 0); |
| 75 | |
| 76 | switch (Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().fontTypecxx . . $ Settings#fontType(e419002d613dea44).((Settingscxx . . $ Settings#::DebuggerFontcxx . . $ Settings#DebuggerFont#)row)) { |
| 77 | case Settingscxx . . $ Settings#::APPLICATION_DEFAULTcxx . . $ Settings#APPLICATION_DEFAULT.: |
| 78 | rbUseAppFontcxx . . $ Ui_PreferencesDialog#rbUseAppFont.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true); |
| 79 | break; |
| 80 | case Settingscxx . . $ Settings#::FIXED_DEFAULTcxx . . $ Settings#FIXED_DEFAULT.: |
| 81 | rbUseFixedFontcxx . . $ Ui_PreferencesDialog#rbUseFixedFont.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true); |
| 82 | break; |
| 83 | case Settingscxx . . $ Settings#::CUSTOMcxx . . $ Settings#CUSTOM.: |
| 84 | rbUseCustomFontcxx . . $ Ui_PreferencesDialog#rbUseCustomFont.->setCheckedcxx . . $ QAbstractButton#setChecked(b45ddcbc8423892c).(true); |
| 85 | break; |
| 86 | } |
| 87 | |
| 88 | lblPreviewcxx . . $ Ui_PreferencesDialog#lblPreview.->setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().fontcxx . . $ Settings#font(feb6b15adc4fed84). ((Settingscxx . . $ Settings#::DebuggerFontcxx . . $ Settings#DebuggerFont#)row)); |
| 89 | setFontPreviewColorcxx . . $ PreferencesDialog#setFontPreviewColor(129a55e114526ad3).(Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().fontColorcxx . . $ Settings#fontColor(28f2b0e220c74f2e).((Settingscxx . . $ Settings#::DebuggerFontcxx . . $ Settings#DebuggerFont#)row)); |
| 90 | btnSelectFontcxx . . $ Ui_PreferencesDialog#btnSelectFont.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(rbUseCustomFontcxx . . $ Ui_PreferencesDialog#rbUseCustomFont.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).()); |
| 91 | btnFontColorcxx . . $ Ui_PreferencesDialog#btnFontColor.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(row > 1); |
| 92 | updatingcxx . . $ PreferencesDialog#updating. = false; |
| 93 | } |
| 94 | |
| 95 | void PreferencesDialogcxx . . $ PreferencesDialog#::fontTypeChangedcxx . . $ PreferencesDialog#fontTypeChanged(b45ddcbc8423892c).(bool state) |
| 96 | { |
| 97 | if (!state || updatingcxx . . $ PreferencesDialog#updating.) return; |
| 98 | |
| 99 | auto f = (Settingscxx . . $ Settings#::DebuggerFontcxx . . $ Settings#DebuggerFont#)(listFontscxx . . $ Ui_PreferencesDialog#listFonts.->currentRowcxx . . $ QListWidget#currentRow(455f465bc33b4cdf).()); |
| 100 | Settingscxx . . $ Settings#& s = Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).(); |
| 101 | |
| 102 | if (rbUseAppFontcxx . . $ Ui_PreferencesDialog#rbUseAppFont.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).()) { |
| 103 | s.setFontTypecxx . . $ Settings#setFontType(ef3c08724a0eed8b).(f, Settingscxx . . $ Settings#::APPLICATION_DEFAULTcxx . . $ Settings#APPLICATION_DEFAULT.); |
| 104 | } else if (rbUseFixedFontcxx . . $ Ui_PreferencesDialog#rbUseFixedFont.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).()) { |
| 105 | s.setFontTypecxx . . $ Settings#setFontType(ef3c08724a0eed8b).(f, Settingscxx . . $ Settings#::FIXED_DEFAULTcxx . . $ Settings#FIXED_DEFAULT.); |
| 106 | } else { |
| 107 | s.setFontTypecxx . . $ Settings#setFontType(ef3c08724a0eed8b).(f, Settingscxx . . $ Settings#::CUSTOMcxx . . $ Settings#CUSTOM.); |
| 108 | } |
| 109 | lblPreviewcxx . . $ Ui_PreferencesDialog#lblPreview.->setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(s.fontcxx . . $ Settings#font(feb6b15adc4fed84).(f)); |
| 110 | btnSelectFontcxx . . $ Ui_PreferencesDialog#btnSelectFont.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(rbUseCustomFontcxx . . $ Ui_PreferencesDialog#rbUseCustomFont.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).()); |
| 111 | } |
| 112 | |
| 113 | void PreferencesDialogcxx . . $ PreferencesDialog#::fontSelectCustomcxx . . $ PreferencesDialog#fontSelectCustom(49f6e7a06ebc5aa8).() |
| 114 | { |
| 115 | bool ok; |
| 116 | auto f = (Settingscxx . . $ Settings#::DebuggerFontcxx . . $ Settings#DebuggerFont#)(listFontscxx . . $ Ui_PreferencesDialog#listFonts.->currentRowcxx . . $ QListWidget#currentRow(455f465bc33b4cdf).()); |
| 117 | QFontcxx . . $ QFont# newFont = QFontDialogcxx . . $ QFontDialog#::getFontcxx . . $ QFontDialog#getFont(44300c95903bfe7b).(&ok, Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().fontcxx . . $ Settings#font(feb6b15adc4fed84).(f)); |
| 118 | if (ok) { |
| 119 | lblPreviewcxx . . $ Ui_PreferencesDialog#lblPreview.->setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(newFont); |
| 120 | Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().setFontcxx . . $ Settings#setFont(1376392a373fe4c).(f, newFont); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | void PreferencesDialogcxx . . $ PreferencesDialog#::fontSelectColorcxx . . $ PreferencesDialog#fontSelectColor(49f6e7a06ebc5aa8).() |
| 125 | { |
| 126 | auto f = (Settingscxx . . $ Settings#::DebuggerFontcxx . . $ Settings#DebuggerFont#)(listFontscxx . . $ Ui_PreferencesDialog#listFonts.->currentRowcxx . . $ QListWidget#currentRow(455f465bc33b4cdf).()); |
| 127 | QColorcxx . . $ QColor# newColor = QColorDialogcxx . . $ QColorDialog#::getColorcxx . . $ QColorDialog#getColor(c67741e1a73445a5).(Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().fontColorcxx . . $ Settings#fontColor(28f2b0e220c74f2e).(f), this); |
| 128 | if (newColor.isValidcxx . . $ QColor#isValid(3482b152b9333168).()) { |
| 129 | Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().setFontColorcxx . . $ Settings#setFontColor(a30a5a348e2ae82f).(f, newColor); |
| 130 | setFontPreviewColorcxx . . $ PreferencesDialog#setFontPreviewColor(129a55e114526ad3).(newColor); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void PreferencesDialogcxx . . $ PreferencesDialog#::autoReloadSymbolscxx . . $ PreferencesDialog#autoReloadSymbols(d4f767463ce0a6b3).(int state) |
| 135 | { |
| 136 | Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().setAutoReloadSymbolscxx . . $ Settings#setAutoReloadSymbols(b45ddcbc8423892c).(state == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.); |
| 137 | } |
| 138 | |
| 139 | void PreferencesDialogcxx . . $ PreferencesDialog#::preserveLostSymbolscxx . . $ PreferencesDialog#preserveLostSymbols(d4f767463ce0a6b3).(int state) |
| 140 | { |
| 141 | Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().setPreserveLostSymbolscxx . . $ Settings#setPreserveLostSymbols(b45ddcbc8423892c).(state == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.); |
| 142 | } |
| 143 | |
| 144 | void PreferencesDialogcxx . . $ PreferencesDialog#::preserveBreakpointSymbolcxx . . $ PreferencesDialog#preserveBreakpointSymbol(d4f767463ce0a6b3).(int state) |
| 145 | { |
| 146 | Settingscxx . . $ Settings#::getcxx . . $ Settings#get(493e506a9691bc24).().setPreserveBreakpointSymbolcxx . . $ Settings#setPreserveBreakpointSymbol(b45ddcbc8423892c).(state == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.); |
| 147 | } |
| 148 | |
| 149 | void PreferencesDialogcxx . . $ PreferencesDialog#::setFontPreviewColorcxx . . $ PreferencesDialog#setFontPreviewColor(129a55e114526ad3).(const QColorcxx . . $ QColor#& c) |
| 150 | { |
| 151 | if (listFontscxx . . $ Ui_PreferencesDialog#listFonts.->currentRowcxx . . $ QListWidget#currentRow(455f465bc33b4cdf).() > 1) { |
| 152 | QPalettecxx . . $ QPalette# pal = lblPreviewcxx . . $ QPalette#QPalette(f826ed73d5553cd5).->palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).(); |
| 153 | pal.setColorcxx . . $ QPalette#setColor(4fd5272df43acd68).(QPalettecxx . . $ QPalette#::WindowTextcxx . . $ QPalette#WindowText., c); |
| 154 | lblPreviewcxx . . $ Ui_PreferencesDialog#lblPreview.->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(pal); |
| 155 | } else { |
| 156 | lblPreviewcxx . . $ Ui_PreferencesDialog#lblPreview.->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(QPalettecxx . . $ QPalette#QPalette(49f6e7a06ebc5aa8).()); |
| 157 | } |
| 158 | } |