MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / WizPreferenceWindow

Method WizPreferenceWindow

src/WizPreferenceDialog.cpp:24–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23
24WizPreferenceWindow::WizPreferenceWindow(WizExplorerApp& app, QWidget* parent)
25 : QDialog(parent)
26 , ui(new Ui::WizPreferenceWindow)
27 , m_app(app)
28 , m_dbMgr(app.databaseManager())
29 , m_biniting(true)
30{
31 ui->setupUi(this);
32 setWindowIcon(QIcon());
33 setWindowTitle(tr("Preference"));
34
35 connect(ui->btnClose, SIGNAL(clicked()), SLOT(accept()));
36
37 // general tab
38 ::WizGetTranslatedLocales(m_locales);
39 ui->comboLang->blockSignals(true);
40 for (int i = 0; i < m_locales.count(); i++) {
41 ui->comboLang->addItem(::WizGetTranslatedLocaleDisplayName(i));
42 }
43
44 for (int i = 0; i < ui->comboLang->count(); i++) {
45 if (m_locales[i] == userSettings().locale()) {
46 ui->comboLang->setCurrentIndex(i);
47 }
48 }
49 ui->comboLang->blockSignals(false);
50
51 ui->lineEditUIFont->setText(
52 m_app.userSettings().UIFontFamily() + " " +
53 QString::number(m_app.userSettings().UIFontSize())
54 );
55
56 ui->checkBox->blockSignals(true);
57 Qt::CheckState checkState = userSettings().autoCheckUpdate() ? Qt::Checked : Qt::Unchecked;
58 ui->checkBox->setCheckState(checkState);
59 ui->checkBox->blockSignals(false);
60
61 ui->checkBoxTrayIcon->blockSignals(true);
62 checkState = userSettings().showSystemTrayIcon() ? Qt::Checked : Qt::Unchecked;
63 ui->checkBoxTrayIcon->setCheckState(checkState);
64 ui->checkBoxTrayIcon->blockSignals(false);
65
66#ifdef BUILD4APPSTORE
67 // hide language choice and upgrade for appstore
68 ui->comboLang->setEnabled(false);
69 ui->checkBox->setVisible(false);
70#endif
71
72 // reading tab
73 switch (userSettings().noteViewMode())
74 {
75 case viewmodeAlwaysEditing:
76 ui->radioAlwaysEditing->setChecked(true);
77 break;
78 case viewmodeAlwaysReading:
79 ui->radioAlwaysReading->setChecked(true);
80 break;
81 default:

Callers

nothing calls this directly

Calls 15

QIconClass · 0.85
connectFunction · 0.85
WizGetTranslatedLocalesFunction · 0.85
WizFormatString1Function · 0.85
localeMethod · 0.80
setCurrentIndexMethod · 0.80
UIFontFamilyMethod · 0.80
UIFontSizeMethod · 0.80
autoCheckUpdateMethod · 0.80
showSystemTrayIconMethod · 0.80
noteViewModeMethod · 0.80

Tested by

no test coverage detected