refactor: move msg_box out of engine qtutils into the dialog layer

The engine-side QtUtils no longer references QMessageBox; the two
dialog call sites use the identical olive::msg_box() inline helper.
This commit is contained in:
2026-07-20 01:01:18 +08:00
parent 03d4087124
commit 69cd8d3a75
5 changed files with 71 additions and 36 deletions
-22
View File
@@ -50,28 +50,6 @@ QFrame *QtUtils::create_vertical_line()
return l;
}
int QtUtils::msg_box(QWidget *parent, QMessageBox::Icon icon,
const QString &title, const QString &message,
QMessageBox::StandardButtons buttons)
{
QMessageBox b(parent);
b.setIcon(icon);
b.setWindowModality(Qt::WindowModal);
b.setWindowTitle(title);
b.setText(message);
uint mask = QMessageBox::FirstButton;
while (mask <= QMessageBox::LastButton) {
uint sb = buttons & mask;
if (sb) {
b.addButton(static_cast<QMessageBox::StandardButton>(sb));
}
mask <<= 1;
}
return b.exec();
}
QDateTime QtUtils::get_creation_date(const QFileInfo &info)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
-5
View File
@@ -28,7 +28,6 @@
#include <QFileInfo>
#include <QFontMetrics>
#include <QFrame>
#include <QMessageBox>
namespace olive
{
@@ -48,10 +47,6 @@ public:
static QFrame *create_vertical_line();
static int msg_box(QWidget *parent, QMessageBox::Icon icon,
const QString &title, const QString &message,
QMessageBox::StandardButtons buttons = QMessageBox::Ok);
static QDateTime get_creation_date(const QFileInfo &info);
static QString get_formatted_date_time(const QDateTime &dt);