mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -04:00
Introduced showInfoBox()
This commit is contained in:
parent
ebf444690b
commit
188d5eabe9
@ -128,11 +128,7 @@ void ContentManager::onCustomContextMenu(const QPoint &point)
|
|||||||
if (!dirOpen) {
|
if (!dirOpen) {
|
||||||
QString failedText = gt("couldnt-open-location-text");
|
QString failedText = gt("couldnt-open-location-text");
|
||||||
failedText = failedText.replace("{{FOLDER}}", "<b>" + bookDir.absolutePath() + "</b>");
|
failedText = failedText.replace("{{FOLDER}}", "<b>" + bookDir.absolutePath() + "</b>");
|
||||||
KiwixConfirmBox *dialog = new KiwixConfirmBox(gt("couldnt-open-location"), failedText, true, mp_view);
|
showInfoBox(gt("couldnt-open-location"), failedText, mp_view);
|
||||||
dialog->show();
|
|
||||||
connect(dialog, &KiwixConfirmBox::okClicked, [=]() {
|
|
||||||
dialog->deleteLater();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
@ -428,11 +424,7 @@ QString ContentManager::downloadBook(const QString &id, QModelIndex index)
|
|||||||
emit managerModel->startDownload(index);
|
emit managerModel->startDownload(index);
|
||||||
return downloadStatus;
|
return downloadStatus;
|
||||||
}
|
}
|
||||||
KiwixConfirmBox *dialog = new KiwixConfirmBox(dialogHeader, dialogText, true, mp_view);
|
showInfoBox(dialogHeader, dialogText, mp_view);
|
||||||
dialog->show();
|
|
||||||
connect(dialog, &KiwixConfirmBox::okClicked, [=]() {
|
|
||||||
dialog->deleteLater();
|
|
||||||
});
|
|
||||||
return downloadStatus;
|
return downloadStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,3 +36,12 @@ KiwixConfirmBox::~KiwixConfirmBox()
|
|||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showInfoBox(QString title, QString text, QWidget *parent)
|
||||||
|
{
|
||||||
|
KiwixConfirmBox *dialog = new KiwixConfirmBox(title, text, true, parent);
|
||||||
|
dialog->show();
|
||||||
|
QObject::connect(dialog, &KiwixConfirmBox::okClicked, [=]() {
|
||||||
|
dialog->deleteLater();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -12,7 +12,7 @@ class KiwixConfirmBox : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KiwixConfirmBox(QString confirmTitle, QString confirmText, bool okDialog, QWidget *parent = nullptr);
|
KiwixConfirmBox(QString confirmTitle, QString confirmText, bool okDialog, QWidget *parent = nullptr);
|
||||||
~KiwixConfirmBox();
|
~KiwixConfirmBox();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@ -26,4 +26,7 @@ private:
|
|||||||
Ui::kiwixconfirmbox *ui;
|
Ui::kiwixconfirmbox *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void showInfoBox(QString title, QString text, QWidget *parent = nullptr);
|
||||||
|
|
||||||
#endif // KIWIXCONFIRMBOX_H
|
#endif // KIWIXCONFIRMBOX_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user