mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 17:01:24 +12:00
Qt/Linux: Properly hide taskbar progress when done
This commit is contained in:
parent
45f5819ef3
commit
8b3a3e4ac8
6 changed files with 22 additions and 31 deletions
|
@ -124,7 +124,7 @@ gs_frame::gs_frame(QScreen* screen, const QRect& geometry, const QIcon& appIcon,
|
||||||
m_tb_progress->setVisible(false);
|
m_tb_progress->setVisible(false);
|
||||||
|
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
UpdateProgress(0);
|
UpdateProgress(0, false);
|
||||||
m_progress_value = 0;
|
m_progress_value = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -801,7 +801,7 @@ void gs_frame::progress_reset(bool reset_limit)
|
||||||
m_tb_progress->reset();
|
m_tb_progress->reset();
|
||||||
}
|
}
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
UpdateProgress(0);
|
UpdateProgress(0, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (reset_limit)
|
if (reset_limit)
|
||||||
|
@ -819,7 +819,7 @@ void gs_frame::progress_set_value(int value)
|
||||||
}
|
}
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
m_progress_value = std::clamp(value, 0, m_gauge_max);
|
m_progress_value = std::clamp(value, 0, m_gauge_max);
|
||||||
UpdateProgress(m_progress_value);
|
UpdateProgress(m_progress_value, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -853,7 +853,7 @@ void gs_frame::progress_set_limit(int limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_QTDBUS
|
#ifdef HAVE_QTDBUS
|
||||||
void gs_frame::UpdateProgress(int progress, bool disable)
|
void gs_frame::UpdateProgress(int progress, bool progress_visible)
|
||||||
{
|
{
|
||||||
QDBusMessage message = QDBusMessage::createSignal
|
QDBusMessage message = QDBusMessage::createSignal
|
||||||
(
|
(
|
||||||
|
@ -862,12 +862,9 @@ void gs_frame::UpdateProgress(int progress, bool disable)
|
||||||
QStringLiteral("Update")
|
QStringLiteral("Update")
|
||||||
);
|
);
|
||||||
QVariantMap properties;
|
QVariantMap properties;
|
||||||
if (disable)
|
// Progress takes a value from 0.0 to 0.1
|
||||||
properties.insert(QStringLiteral("progress-visible"), false);
|
|
||||||
else
|
|
||||||
properties.insert(QStringLiteral("progress-visible"), true);
|
|
||||||
//Progress takes a value from 0.0 to 0.1
|
|
||||||
properties.insert(QStringLiteral("progress"), 1. * progress / m_gauge_max);
|
properties.insert(QStringLiteral("progress"), 1. * progress / m_gauge_max);
|
||||||
|
properties.insert(QStringLiteral("progress-visible"), progress_visible);
|
||||||
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
||||||
QDBusConnection::sessionBus().send(message);
|
QDBusConnection::sessionBus().send(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ private:
|
||||||
QWinTaskbarProgress* m_tb_progress = nullptr;
|
QWinTaskbarProgress* m_tb_progress = nullptr;
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
int m_progress_value = 0;
|
int m_progress_value = 0;
|
||||||
void UpdateProgress(int progress, bool disable = false);
|
void UpdateProgress(int progress, bool progress_visible);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QRect m_initial_geometry;
|
QRect m_initial_geometry;
|
||||||
|
|
|
@ -66,7 +66,7 @@ void msg_dialog_frame::Create(const std::string& msg, const std::string& title)
|
||||||
m_tb_progress->setRange(0, 100);
|
m_tb_progress->setRange(0, 100);
|
||||||
m_tb_progress->setVisible(true);
|
m_tb_progress->setVisible(true);
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
UpdateProgress(0);
|
UpdateProgress(0, true);
|
||||||
m_progress_value = 0;
|
m_progress_value = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ void msg_dialog_frame::ProgressBarReset(u32 index)
|
||||||
m_tb_progress->reset();
|
m_tb_progress->reset();
|
||||||
}
|
}
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
UpdateProgress(0);
|
UpdateProgress(0, false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ void msg_dialog_frame::ProgressBarInc(u32 index, u32 delta)
|
||||||
}
|
}
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
m_progress_value = std::min(m_progress_value + static_cast<int>(delta), m_gauge_max);
|
m_progress_value = std::min(m_progress_value + static_cast<int>(delta), m_gauge_max);
|
||||||
UpdateProgress(m_progress_value);
|
UpdateProgress(m_progress_value, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ void msg_dialog_frame::ProgressBarSetValue(u32 index, u32 value)
|
||||||
}
|
}
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
m_progress_value = std::min(static_cast<int>(value), m_gauge_max);
|
m_progress_value = std::min(static_cast<int>(value), m_gauge_max);
|
||||||
UpdateProgress(m_progress_value);
|
UpdateProgress(m_progress_value, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,19 +370,16 @@ void msg_dialog_frame::ProgressBarSetLimit(u32 index, u32 limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_QTDBUS
|
#ifdef HAVE_QTDBUS
|
||||||
void msg_dialog_frame::UpdateProgress(int progress, bool disable)
|
void msg_dialog_frame::UpdateProgress(int progress, bool progress_visible)
|
||||||
{
|
{
|
||||||
QDBusMessage message = QDBusMessage::createSignal(
|
QDBusMessage message = QDBusMessage::createSignal(
|
||||||
QStringLiteral("/"),
|
QStringLiteral("/"),
|
||||||
QStringLiteral("com.canonical.Unity.LauncherEntry"),
|
QStringLiteral("com.canonical.Unity.LauncherEntry"),
|
||||||
QStringLiteral("Update"));
|
QStringLiteral("Update"));
|
||||||
QVariantMap properties;
|
QVariantMap properties;
|
||||||
if (disable)
|
|
||||||
properties.insert(QStringLiteral("progress-visible"), false);
|
|
||||||
else
|
|
||||||
properties.insert(QStringLiteral("progress-visible"), true);
|
|
||||||
// Progress takes a value from 0.0 to 0.1
|
// Progress takes a value from 0.0 to 0.1
|
||||||
properties.insert(QStringLiteral("progress"), 1.* progress / m_gauge_max);
|
properties.insert(QStringLiteral("progress"), 1. * progress / m_gauge_max);
|
||||||
|
properties.insert(QStringLiteral("progress-visible"), progress_visible);
|
||||||
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
||||||
QDBusConnection::sessionBus().send(message);
|
QDBusConnection::sessionBus().send(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,6 @@ public:
|
||||||
void ProgressBarSetLimit(u32 index, u32 limit) override;
|
void ProgressBarSetLimit(u32 index, u32 limit) override;
|
||||||
#ifdef HAVE_QTDBUS
|
#ifdef HAVE_QTDBUS
|
||||||
private:
|
private:
|
||||||
void UpdateProgress(int progress, bool disable = false);
|
void UpdateProgress(int progress, bool progress_visible);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@ progress_dialog::progress_dialog(const QString& windowTitle, const QString& labe
|
||||||
m_tb_progress->setRange(minimum, maximum);
|
m_tb_progress->setRange(minimum, maximum);
|
||||||
m_tb_progress->show();
|
m_tb_progress->show();
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
UpdateProgress(0);
|
UpdateProgress(0, true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ progress_dialog::~progress_dialog()
|
||||||
QStringLiteral("Update"));
|
QStringLiteral("Update"));
|
||||||
QVariantMap properties;
|
QVariantMap properties;
|
||||||
properties.insert(QStringLiteral("urgent"), false);
|
properties.insert(QStringLiteral("urgent"), false);
|
||||||
properties.insert(QStringLiteral("progress-visible"), false);
|
|
||||||
properties.insert(QStringLiteral("progress"), 0);
|
properties.insert(QStringLiteral("progress"), 0);
|
||||||
|
properties.insert(QStringLiteral("progress-visible"), false);
|
||||||
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
||||||
QDBusConnection::sessionBus().send(message);
|
QDBusConnection::sessionBus().send(message);
|
||||||
#endif
|
#endif
|
||||||
|
@ -83,7 +83,7 @@ void progress_dialog::SetValue(int progress)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
m_tb_progress->setValue(value);
|
m_tb_progress->setValue(value);
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
UpdateProgress(value);
|
UpdateProgress(value, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QProgressDialog::setValue(value);
|
QProgressDialog::setValue(value);
|
||||||
|
@ -108,19 +108,16 @@ void progress_dialog::SignalFailure() const
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_QTDBUS
|
#ifdef HAVE_QTDBUS
|
||||||
void progress_dialog::UpdateProgress(int progress, bool disable)
|
void progress_dialog::UpdateProgress(int progress, bool progress_visible)
|
||||||
{
|
{
|
||||||
QDBusMessage message = QDBusMessage::createSignal(
|
QDBusMessage message = QDBusMessage::createSignal(
|
||||||
QStringLiteral("/"),
|
QStringLiteral("/"),
|
||||||
QStringLiteral("com.canonical.Unity.LauncherEntry"),
|
QStringLiteral("com.canonical.Unity.LauncherEntry"),
|
||||||
QStringLiteral("Update"));
|
QStringLiteral("Update"));
|
||||||
QVariantMap properties;
|
QVariantMap properties;
|
||||||
if (disable)
|
// Progress takes a value from 0.0 to 0.1
|
||||||
properties.insert(QStringLiteral("progress-visible"), false);
|
|
||||||
else
|
|
||||||
properties.insert(QStringLiteral("progress-visible"), true);
|
|
||||||
//Progress takes a value from 0.0 to 0.1
|
|
||||||
properties.insert(QStringLiteral("progress"), 1. * progress / maximum());
|
properties.insert(QStringLiteral("progress"), 1. * progress / maximum());
|
||||||
|
properties.insert(QStringLiteral("progress-visible"), progress_visible);
|
||||||
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
message << QStringLiteral("application://rpcs3.desktop") << properties;
|
||||||
QDBusConnection::sessionBus().send(message);
|
QDBusConnection::sessionBus().send(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,6 @@ private:
|
||||||
std::unique_ptr<QWinTaskbarButton> m_tb_button = nullptr;
|
std::unique_ptr<QWinTaskbarButton> m_tb_button = nullptr;
|
||||||
QWinTaskbarProgress* m_tb_progress = nullptr;
|
QWinTaskbarProgress* m_tb_progress = nullptr;
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
void UpdateProgress(int progress, bool disable = false);
|
void UpdateProgress(int progress, bool progress_visible);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue