X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fgui%2Fsearchdialog.cpp;h=a56838e970eb6ef1b33797f848ff2d8b8cea2223;hb=cf883c1283eb6b096592ef875a32696fee9dd6ff;hp=17fb2929e0272a5033a6ce32c64221f1c0b38cfe;hpb=89496ceee9788c2908c27ad4e2535f2728310d76;p=jenirok diff --git a/src/gui/searchdialog.cpp b/src/gui/searchdialog.cpp index 17fb292..a56838e 100644 --- a/src/gui/searchdialog.cpp +++ b/src/gui/searchdialog.cpp @@ -27,54 +27,54 @@ SearchDialog::SearchDialog(QWidget* parent): QDialog(parent), numberInput_(0), locationInput_(0), selector_(0) { - setWindowTitle(tr("Search")); + setWindowTitle(tr("Search")); - QHBoxLayout* numberLayout = new QHBoxLayout; - QLabel* numberLabel = new QLabel(tr("Name/number")); - numberInput_ = new QLineEdit; - numberLayout->addWidget(numberLabel); - numberLayout->addWidget(numberInput_); + QHBoxLayout* numberLayout = new QHBoxLayout; + QLabel* numberLabel = new QLabel(tr("Name/number")); + numberInput_ = new QLineEdit; + numberLayout->addWidget(numberLabel); + numberLayout->addWidget(numberInput_); - QHBoxLayout* locationLayout = new QHBoxLayout; - QLabel* locationLabel = new QLabel(tr("Location")); - locationInput_ = new QLineEdit; - locationLayout->addWidget(locationLabel); - locationLayout->addWidget(locationInput_); + QHBoxLayout* locationLayout = new QHBoxLayout; + QLabel* locationLabel = new QLabel(tr("Location")); + locationInput_ = new QLineEdit; + locationLayout->addWidget(locationLabel); + locationLayout->addWidget(locationInput_); - selector_ = new ButtonSelector(tr("Type"), this); - selector_->addItem(tr("Persons")); - selector_->addItem(tr("Yellow pages")); + selector_ = new ButtonSelector(tr("Type"), this); + selector_->addItem(tr("Persons")); + selector_->addItem(tr("Yellow pages")); - QVBoxLayout* leftLayout = new QVBoxLayout; - leftLayout->addLayout(numberLayout); - leftLayout->addLayout(locationLayout); - leftLayout->addWidget(selector_); + QVBoxLayout* leftLayout = new QVBoxLayout; + leftLayout->addLayout(numberLayout); + leftLayout->addLayout(locationLayout); + leftLayout->addWidget(selector_); - QDialogButtonBox* buttons = new QDialogButtonBox; - QPushButton* submitButton = new QPushButton(tr("Search")); - buttons->addButton(submitButton, QDialogButtonBox::AcceptRole); - connect(submitButton, SIGNAL(pressed()), this, SLOT(searchPressed())); + QDialogButtonBox* buttons = new QDialogButtonBox; + QPushButton* submitButton = new QPushButton(tr("Search")); + buttons->addButton(submitButton, QDialogButtonBox::AcceptRole); + connect(submitButton, SIGNAL(pressed()), this, SLOT(searchPressed())); - QHBoxLayout* mainLayout = new QHBoxLayout; - mainLayout->addLayout(leftLayout, Qt::AlignLeft); - mainLayout->addWidget(buttons); + QHBoxLayout* mainLayout = new QHBoxLayout; + mainLayout->addLayout(leftLayout, Qt::AlignLeft); + mainLayout->addWidget(buttons); - setLayout(mainLayout); + setLayout(mainLayout); } void SearchDialog::searchPressed() { - SearchDetails details; - details.name = numberInput_->text(); + SearchDetails details; + details.name = numberInput_->text(); - if(details.name.isEmpty()) - { - numberInput_->setFocus(); - return; - } + if(details.name.isEmpty()) + { + numberInput_->setFocus(); + return; + } - details.location = locationInput_->text(); - details.type = selector_->currentIndex(); - emit search(details); - hide(); + details.location = locationInput_->text(); + details.type = selector_->currentIndex(); + emit search(details); + hide(); }