summaryrefslogtreecommitdiffstats
path: root/indexerdialog.cpp
blob: c9e6ca30768ec5e41cab8fe881648c71c184da40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QApplication>

#include "indexerdialog.h"
#include "indexerwidget.h"

IndexerDialog::IndexerDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){
    //indexer
    mIndexer = new IndexerWidget;

    //buttons
    QPushButton *startB = new QPushButton(tr("Start"));
    connect(startB, &QPushButton::clicked, mIndexer, &IndexerWidget::startIndexing);
    QPushButton *stopB = new QPushButton(tr("Stop"));
    connect(stopB, &QPushButton::clicked, mIndexer, &IndexerWidget::stopIndexing);
    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->addStretch();
    buttonLayout->addWidget(startB);
    buttonLayout->addWidget(stopB);
    buttonLayout->addStretch();

    //mainlayout
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(mIndexer);
    mainLayout->addLayout(buttonLayout);
    setLayout(mainLayout);
    setWindowTitle(QString(tr("%1 - Indexer")).arg(qApp->applicationName()));
    setMinimumWidth(768);
}