Merge branch 'master' into multiple_apis
This commit is contained in:
commit
e764ba2c9d
4 changed files with 31 additions and 6 deletions
|
@ -1,9 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Name=Danbooru Client
|
||||
Exec=danbooru-client
|
||||
Exec=danbooru_client
|
||||
Icon=danbooru_client
|
||||
Type=Application
|
||||
X-DocPath=danbooru-client/index.html
|
||||
GenericName=A KF5-based client for Danbooru-style image boards
|
||||
Terminal=false
|
||||
Categories=Graphics;Viewer
|
||||
Categories=Graphics;Viewer
|
||||
|
|
|
@ -29,6 +29,9 @@ DanbooruSearchWidget::DanbooruSearchWidget(QWidget *parent): QWidget(parent)
|
|||
{
|
||||
setupUi(this);
|
||||
|
||||
tagLineEdit->setPlaceholderText(i18n("Type search tags."));
|
||||
tagLineEdit->setToolTip(i18n("Type search tags. An empty string searches all posts."));
|
||||
|
||||
connect(searchButton, &QPushButton::clicked, this, &DanbooruSearchWidget::accept);
|
||||
connect(tagLineEdit, &QLineEdit::returnPressed, this, &DanbooruSearchWidget::accept);
|
||||
connect(closeButton, &QPushButton::clicked, [this]() {
|
||||
|
@ -49,10 +52,6 @@ QStringList DanbooruSearchWidget::selectedTags() const
|
|||
void DanbooruSearchWidget::accept()
|
||||
{
|
||||
|
||||
if (tagLineEdit->text().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_tags = tagLineEdit->text().split(",");
|
||||
Q_EMIT(accepted());
|
||||
}
|
||||
|
|
|
@ -428,6 +428,12 @@ void DanbooruService::processPostList(KJob *job)
|
|||
|
||||
// How many posts do we have to fetch?
|
||||
|
||||
if (postList.isEmpty()) {
|
||||
qCDebug(LIBDANBOORU) << "No posts found";
|
||||
Q_EMIT(postDownloadFinished());
|
||||
return;
|
||||
}
|
||||
|
||||
m_postsToFetch = postList.length();
|
||||
|
||||
for (auto element : postList) {
|
||||
|
|
|
@ -49,11 +49,17 @@ Rectangle {
|
|||
}
|
||||
|
||||
onDownloadFinished: {
|
||||
|
||||
grid.opacity = 1
|
||||
runningIndicator.running = false
|
||||
|
||||
if (danbooruModel.rowCount() == 0) {
|
||||
warnLabel.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
onDownloadStarted: {
|
||||
warnLabel.visible = false
|
||||
grid.opacity = 0.5
|
||||
runningIndicator.running = true
|
||||
}
|
||||
|
@ -68,6 +74,20 @@ Rectangle {
|
|||
running: false
|
||||
}
|
||||
|
||||
Label {
|
||||
id: warnLabel
|
||||
z: 1
|
||||
width: grid.cellWidth / 2
|
||||
height: grid.cellHeight / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: false
|
||||
text: "No posts found."
|
||||
color: black
|
||||
|
||||
|
||||
}
|
||||
|
||||
Component {
|
||||
id: highlight
|
||||
Rectangle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue