plasma: keep the notifications popup shown for as long as there is data comming from the data engine

plus the 3 seconds timeout after which the popup will hide automatically

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-09-17 15:31:02 +03:00
parent 864f0bdbd9
commit b6e3890d01
5 changed files with 15 additions and 12 deletions

View file

@ -134,7 +134,7 @@ void ApplicationsWidget::sourceAdded(const QString &name)
adjustSize();
emit countChanged();
emit newNotification();
emit ping();
locker.unlock();
m_dataengine->connectSource(name, this);
}
@ -227,6 +227,7 @@ void ApplicationsWidget::dataUpdated(const QString &name, const Plasma::DataEngi
configurewidget->setProperty("_k_apprealname", data.value("appRealName"));
}
frame->adjustSize();
emit ping();
break;
}
}

View file

@ -39,7 +39,7 @@ public:
Q_SIGNALS:
int countChanged();
void newNotification();
void ping();
private Q_SLOTS:
void sourceAdded(const QString &name);

View file

@ -143,7 +143,7 @@ void JobsWidget::sourceAdded(const QString &name)
adjustSize();
emit countChanged();
emit newNotification();
emit ping();
locker.unlock();
m_dataengine->connectSource(name, this);
}
@ -232,6 +232,8 @@ void JobsWidget::dataUpdated(const QString &name, const Plasma::DataEngine::Data
openwidget->setVisible(true);
}
}
frame->adjustSize();
emit ping();
break;
}
}

View file

@ -39,7 +39,7 @@ public:
Q_SIGNALS:
int countChanged();
void newNotification();
void ping();
private Q_SLOTS:
void sourceAdded(const QString &name);

View file

@ -58,8 +58,8 @@ public:
private Q_SLOTS:
void slotCountChanged();
void slotNewJobNotification();
void slotNewApplicationNotification();
void slotJobPing();
void slotApplicationPing();
private:
NotificationsApplet* m_notifications;
@ -87,8 +87,8 @@ NotificationsWidget::NotificationsWidget(NotificationsApplet* notifications)
this, SLOT(slotCountChanged())
);
connect(
m_jobswidget, SIGNAL(newNotification()),
this, SLOT(slotNewJobNotification())
m_jobswidget, SIGNAL(ping()),
this, SLOT(slotJobPing())
);
m_jobsscrollwidget->setWidget(m_jobswidget);
addTab(KIcon("services"), i18n("Jobs"), m_jobsscrollwidget);
@ -101,8 +101,8 @@ NotificationsWidget::NotificationsWidget(NotificationsApplet* notifications)
this, SLOT(slotCountChanged())
);
connect(
m_applicationswidget, SIGNAL(newNotification()),
this, SLOT(slotNewApplicationNotification())
m_applicationswidget, SIGNAL(ping()),
this, SLOT(slotApplicationPing())
);
m_applicationsscrollwidget->setWidget(m_applicationswidget);
addTab(KIcon("dialog-information"), i18n("Notifications"), m_applicationsscrollwidget);
@ -126,7 +126,7 @@ void NotificationsWidget::slotCountChanged()
}
}
void NotificationsWidget::slotNewJobNotification()
void NotificationsWidget::slotJobPing()
{
// if the popup was shown before the signal it is probably because it is being interacted with
// so no automatic tab switching in that case
@ -137,7 +137,7 @@ void NotificationsWidget::slotNewJobNotification()
}
}
void NotificationsWidget::slotNewApplicationNotification()
void NotificationsWidget::slotApplicationPing()
{
const bool waspopupshowing = m_notifications->isPopupShowing();
m_notifications->showPopup(s_popuptimeout);