Support width and height when looking for posts

The UI needs to be improved, though.
This commit is contained in:
Luca Beltrame 2016-05-01 14:49:57 +02:00
parent 76330d4416
commit 23d33dd5c8
Signed by: einar
GPG key ID: 40C8281493B01C16
6 changed files with 124 additions and 20 deletions

View file

@ -31,6 +31,12 @@ DanbooruSearchWidget::DanbooruSearchWidget(QWidget *parent): QWidget(parent)
tagLineEdit->setPlaceholderText(i18n("Type search tags."));
tagLineEdit->setToolTip(i18n("Type search tags. An empty string searches all posts."));
widthSpinBox->setSuffix(ki18np(" pixel", " pixels"));
heightSpinBox->setSuffix(ki18np(" pixel", " pixels"));
widthSpinBox->setValue(0);
heightSpinBox->setValue(0);
connect(searchButton, &QPushButton::clicked, this, &DanbooruSearchWidget::accept);
connect(tagLineEdit, &QLineEdit::returnPressed, this, &DanbooruSearchWidget::accept);
@ -49,11 +55,24 @@ QStringList DanbooruSearchWidget::selectedTags() const
return m_tags;
}
unsigned int DanbooruSearchWidget::selectedWidth() const
{
return m_width;
}
unsigned int DanbooruSearchWidget::selectedHeight() const
{
return m_height;
}
void DanbooruSearchWidget::accept()
{
m_tags = tagLineEdit->text().split(QStringLiteral(","));
m_width = widthSpinBox->value();
m_height = heightSpinBox->value();
Q_EMIT(accepted());
}
} // namespace Danbooru
} // namespace Danbooru