Better message when there is no stickers

Fix infinite waiting cursor
This commit is contained in:
hunbernd 2019-10-05 20:11:38 +02:00
parent 8ff71150c5
commit 5e0dcdc080

View File

@ -309,17 +309,19 @@ void Emoticons::refreshStickerTabs(QVector<QString>& stickerTabs, QString folder
void Emoticons::showStickerWidget(QWidget *parent, QWidget *button, const char *slotAddMethod, bool above) void Emoticons::showStickerWidget(QWidget *parent, QWidget *button, const char *slotAddMethod, bool above)
{ {
QApplication::setOverrideCursor(Qt::WaitCursor);
QVector<QString> stickerTabs; QVector<QString> stickerTabs;
refreshStickerTabs(stickerTabs); refreshStickerTabs(stickerTabs);
if(stickerTabs.count() == 0) {
QString message = "No stickers installed.\nYou can install them by putting images into one of these folders:\n" + stickerFolders.join('\n');
QMessageBox::warning(parent, "Stickers", message);
return;
}
QApplication::setOverrideCursor(Qt::WaitCursor);
QWidget *smWidget = new QWidget(parent, Qt::Popup) ; QWidget *smWidget = new QWidget(parent, Qt::Popup) ;
smWidget->setAttribute(Qt::WA_DeleteOnClose) ; smWidget->setAttribute(Qt::WA_DeleteOnClose) ;
smWidget->setWindowTitle("Stickers") ; smWidget->setWindowTitle("Stickers") ;
if(stickerTabs.count() == 0) {
QMessageBox::warning(parent, "Stickers", "No stickers installed");
return;
}
bool bOnlyOneGroup = (stickerTabs.count() == 1); bool bOnlyOneGroup = (stickerTabs.count() == 1);
QTabWidget *smTab = nullptr; QTabWidget *smTab = nullptr;