| 28 | #include <QHeaderView> |
| 29 | |
| 30 | WatchFolderDialog::WatchFolderDialog(QWidget *parent) : |
| 31 | QDialog(parent) |
| 32 | { |
| 33 | okClicked = false; |
| 34 | QVBoxLayout *mainLayout = new QVBoxLayout(); |
| 35 | setLayout(mainLayout); |
| 36 | |
| 37 | okButton = new QPushButton(this); |
| 38 | okButton->setText(tr("OK")); |
| 39 | connect(okButton, SIGNAL(clicked()), this, SLOT(onClicked())); |
| 40 | |
| 41 | cancelButton = new QPushButton(this); |
| 42 | cancelButton->setText(tr("Cancel")); |
| 43 | connect(cancelButton, SIGNAL(clicked()), this, SLOT(onCancel())); |
| 44 | |
| 45 | QHBoxLayout *horizontalLayout = new QHBoxLayout(); |
| 46 | QHBoxLayout *buttonLayout = new QHBoxLayout(); |
| 47 | buttonLayout->addStretch(1); |
| 48 | buttonLayout->addWidget(okButton); |
| 49 | buttonLayout->addWidget(cancelButton); |
| 50 | setWindowTitle(tr("Auto Import Folders")); |
| 51 | |
| 52 | |
| 53 | QList<qint32> lids; |
| 54 | FileWatcherTable ft(global.db); |
| 55 | ft.getAll(lids); |
| 56 | table = new QTableWidget(lids.size(),4); |
| 57 | connect(table, SIGNAL(itemSelectionChanged()), this, SLOT(tableSelection())); |
| 58 | horizontalLayout->addWidget(table); |
| 59 | |
| 60 | |
| 61 | addButton = new QPushButton(this); |
| 62 | addButton->setText(tr("Add")); |
| 63 | connect(addButton, SIGNAL(clicked()), this, SLOT(addPressed())); |
| 64 | |
| 65 | editButton = new QPushButton(this); |
| 66 | editButton->setText(tr("Edit")); |
| 67 | editButton->setEnabled(false); |
| 68 | connect(editButton, SIGNAL(clicked()), this, SLOT(editPressed())); |
| 69 | |
| 70 | deleteButton = new QPushButton(this); |
| 71 | deleteButton->setText(tr("Delete")); |
| 72 | deleteButton->setEnabled(false); |
| 73 | connect(deleteButton, SIGNAL(clicked()), this, SLOT(deletePressed())); |
| 74 | |
| 75 | QVBoxLayout *editLayout = new QVBoxLayout(); |
| 76 | editLayout->addWidget(addButton); |
| 77 | editLayout->addWidget(editButton); |
| 78 | editLayout->addWidget(deleteButton); |
| 79 | |
| 80 | QHBoxLayout *listLayout = new QHBoxLayout(); |
| 81 | listLayout->addLayout(horizontalLayout); |
| 82 | listLayout->addLayout(editLayout); |
| 83 | |
| 84 | mainLayout->addLayout(listLayout); |
| 85 | mainLayout->addSpacing(1); |
| 86 | mainLayout->addLayout(buttonLayout); |
| 87 |
nothing calls this directly
no test coverage detected