qt: Fix status bar icons ignoring update activity setting.
Disabling status bar icons activity was left unimplemented on qt. Prevent refreshing the icons and clear their activity status on setting change.
This commit is contained in:
@@ -366,6 +366,10 @@ hdd_count(int bus)
|
||||
void
|
||||
MachineStatus::refreshIcons()
|
||||
{
|
||||
/* Check if icons should show activity. */
|
||||
if (!update_icons)
|
||||
return;
|
||||
|
||||
for (size_t i = 0; i < FDD_NUM; ++i) {
|
||||
d->fdd[i].setActive(machine_status.fdd[i].active);
|
||||
d->fdd[i].setEmpty(machine_status.fdd[i].empty);
|
||||
@@ -399,6 +403,23 @@ MachineStatus::refreshIcons()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MachineStatus::clearActivity()
|
||||
{
|
||||
for (auto &fdd : d->fdd)
|
||||
fdd.setActive(false);
|
||||
for (auto &cdrom : d->cdrom)
|
||||
cdrom.setActive(false);
|
||||
for (auto &zip : d->zip)
|
||||
zip.setActive(false);
|
||||
for (auto &mo : d->mo)
|
||||
mo.setActive(false);
|
||||
for (auto &hdd : d->hdds)
|
||||
hdd.setActive(false);
|
||||
for (auto &net : d->net)
|
||||
net.setActive(false);
|
||||
}
|
||||
|
||||
void
|
||||
MachineStatus::refresh(QStatusBar *sbar)
|
||||
{
|
||||
|
@@ -70,6 +70,7 @@ public:
|
||||
static void iterateNIC(const std::function<void(int i)> &cb);
|
||||
|
||||
QString getMessage();
|
||||
void clearActivity();
|
||||
public slots:
|
||||
void refresh(QStatusBar *sbar);
|
||||
void message(const QString &msg);
|
||||
|
@@ -2231,6 +2231,9 @@ MainWindow::on_actionUpdate_status_bar_icons_triggered()
|
||||
{
|
||||
update_icons ^= 1;
|
||||
ui->actionUpdate_status_bar_icons->setChecked(update_icons);
|
||||
|
||||
/* Prevent icons staying when disabled during activity. */
|
||||
status->clearActivity();
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user