Qt/Linux: Implement SignalFailure with dbus

This commit is contained in:
Megamouse 2021-09-26 00:58:27 +02:00
parent 3f55067414
commit 45f5819ef3
2 changed files with 21 additions and 6 deletions

View File

@ -372,12 +372,10 @@ void msg_dialog_frame::ProgressBarSetLimit(u32 index, u32 limit)
#ifdef HAVE_QTDBUS
void msg_dialog_frame::UpdateProgress(int progress, bool disable)
{
QDBusMessage message = QDBusMessage::createSignal
(
QDBusMessage message = QDBusMessage::createSignal(
QStringLiteral("/"),
QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update")
);
QStringLiteral("Update"));
QVariantMap properties;
if (disable)
properties.insert(QStringLiteral("progress-visible"), false);

View File

@ -54,7 +54,16 @@ progress_dialog::~progress_dialog()
m_tb_progress->hide();
}
#elif HAVE_QTDBUS
UpdateProgress(0);
QDBusMessage message = QDBusMessage::createSignal(
QStringLiteral("/"),
QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"));
QVariantMap properties;
properties.insert(QStringLiteral("urgent"), false);
properties.insert(QStringLiteral("progress-visible"), false);
properties.insert(QStringLiteral("progress"), 0);
message << QStringLiteral("application://rpcs3.desktop") << properties;
QDBusConnection::sessionBus().send(message);
#endif
}
@ -84,8 +93,16 @@ void progress_dialog::SignalFailure() const
{
#ifdef _WIN32
m_tb_progress->stop();
#elif HAVE_QTDBUS
QDBusMessage message = QDBusMessage::createSignal(
QStringLiteral("/"),
QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"));
QVariantMap properties;
properties.insert(QStringLiteral("urgent"), true);
message << QStringLiteral("application://rpcs3.desktop") << properties;
QDBusConnection::sessionBus().send(message);
#endif
// TODO: Implement an equivalent for Linux, if possible
QApplication::beep();
}