MCPcopy Create free account
hub / github.com/YACReader/yacreader / OptionsDialog

Method OptionsDialog

YACReader/options_dialog.cpp:26–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include <QVBoxLayout>
25
26OptionsDialog::OptionsDialog(QWidget *parent)
27 : YACReaderOptionsDialog(parent)
28{
29 auto tabWidget = new QTabWidget();
30
31 auto layout = new QVBoxLayout(this);
32
33 // GENERAL -------------------------------------------
34
35 QWidget *pageGeneral = new QWidget();
36 auto layoutGeneral = new QVBoxLayout();
37
38 QGroupBox *pathBox = new QGroupBox(tr("My comics path"));
39
40 auto path = new QHBoxLayout();
41 path->addWidget(pathEdit = new QLineEdit());
42 path->addWidget(pathFindButton = new QPushButton(""));
43 pathBox->setLayout(path);
44
45 auto *languageBox = new QGroupBox(tr("Language"));
46 auto *languageLayout = new QHBoxLayout();
47 languageLayout->addWidget(new QLabel(tr("Application language")));
48 languageCombo = new QComboBox(this);
49 languageCombo->addItem(tr("System default"), QString());
50 const auto availableLanguages = YACReader::UiLanguage::availableLanguages("yacreader");
51 for (const auto &language : availableLanguages) {
52 languageCombo->addItem(
53 QString("%1 (%2)").arg(language.displayName, language.code), language.code);
54 }
55 languageLayout->addWidget(languageCombo);
56 languageBox->setLayout(languageLayout);
57
58 QGroupBox *displayBox = new QGroupBox(tr("Display"));
59 auto displayLayout = new QHBoxLayout();
60 showTimeInInformationLabel = new QCheckBox(tr("Show time in current page information label"));
61 displayLayout->addWidget(showTimeInInformationLabel);
62 displayBox->setLayout(displayLayout);
63
64 connect(pathFindButton, &QAbstractButton::clicked, this, &OptionsDialog::findFolder);
65
66 QGroupBox *slideSizeBox = new QGroupBox(tr("\"Go to flow\" size"));
67 // slideSizeLabel = new QLabel(,this);
68 slideSize = new QSlider(this);
69 slideSize->setMinimum(125);
70 slideSize->setMaximum(350);
71 slideSize->setPageStep(5);
72 slideSize->setOrientation(Qt::Horizontal);
73 auto slideLayout = new QHBoxLayout();
74 slideLayout->addWidget(slideSize);
75 slideSizeBox->setLayout(slideLayout);
76
77 auto colorSelection = new QHBoxLayout;
78 backgroundColor = new QLabel();
79 QPalette pal = backgroundColor->palette();
80 pal.setColor(backgroundColor->backgroundRole(), Qt::black);
81 backgroundColor->setPalette(pal);
82 backgroundColor->setAutoFillBackground(true);
83

Callers

nothing calls this directly

Calls 14

availableLanguagesFunction · 0.85
addItemMethod · 0.80
hideMethod · 0.80
setRangeMethod · 0.80
setTrackingMethod · 0.80
setEnlargeImagesMethod · 0.80
setValueMethod · 0.80
setScalingMethodMethod · 0.80
getRepositoryMethod · 0.80
setThemeMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected