| 12 | } |
| 13 | |
| 14 | void AddLibraryDialog::setupUI() |
| 15 | { |
| 16 | textLabel = new QLabel(tr("Comics folder : ")); |
| 17 | path = new QLineEdit; |
| 18 | textLabel->setBuddy(path); |
| 19 | connect(path, &QLineEdit::textChanged, this, &AddLibraryDialog::pathSetted); |
| 20 | |
| 21 | nameLabel = new QLabel(tr("Library name : ")); |
| 22 | nameEdit = new QLineEdit; |
| 23 | nameLabel->setBuddy(nameEdit); |
| 24 | connect(nameEdit, &QLineEdit::textChanged, this, &AddLibraryDialog::nameSetted); |
| 25 | |
| 26 | accept = new QPushButton(tr("Add")); |
| 27 | accept->setDisabled(true); |
| 28 | connect(accept, &QAbstractButton::clicked, this, &AddLibraryDialog::add); |
| 29 | |
| 30 | cancel = new QPushButton(tr("Cancel")); |
| 31 | connect(cancel, &QPushButton::clicked, this, &AddLibraryDialog::close); |
| 32 | |
| 33 | find = new QPushButton(""); |
| 34 | connect(find, &QAbstractButton::clicked, this, &AddLibraryDialog::findPath); |
| 35 | |
| 36 | auto content = new QGridLayout; |
| 37 | |
| 38 | content->addWidget(nameLabel, 0, 0); |
| 39 | content->addWidget(nameEdit, 0, 1); |
| 40 | |
| 41 | content->addWidget(textLabel, 1, 0); |
| 42 | content->addWidget(path, 1, 1); |
| 43 | content->addWidget(find, 1, 2); |
| 44 | content->setColumnStretch(2, 0); |
| 45 | |
| 46 | auto bottomLayout = new QHBoxLayout; |
| 47 | bottomLayout->addStretch(); |
| 48 | bottomLayout->addWidget(accept); |
| 49 | bottomLayout->addWidget(cancel); |
| 50 | |
| 51 | auto mainLayout = new QVBoxLayout; |
| 52 | mainLayout->addLayout(content); |
| 53 | mainLayout->addStretch(); |
| 54 | mainLayout->addLayout(bottomLayout); |
| 55 | |
| 56 | auto imgMainLayout = new QHBoxLayout; |
| 57 | imgLabel = new QLabel(this); |
| 58 | imgMainLayout->addWidget(imgLabel); |
| 59 | imgMainLayout->addLayout(mainLayout); |
| 60 | |
| 61 | setLayout(imgMainLayout); |
| 62 | |
| 63 | setModal(true); |
| 64 | setWindowTitle(tr("Add an existing library")); |
| 65 | |
| 66 | initTheme(this); |
| 67 | } |
| 68 | |
| 69 | void AddLibraryDialog::applyTheme(const Theme &theme) |
| 70 | { |
nothing calls this directly
no test coverage detected