mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 16:54:46 +00:00
prettier notifications
This commit is contained in:
parent
212f60077f
commit
7050b65686
4 changed files with 12 additions and 5 deletions
|
|
@ -56,7 +56,8 @@ ApplicationWindow {
|
||||||
root.visible = true;
|
root.visible = true;
|
||||||
//Was STATUS_INCOMING now is STATUS_DISCONNECTED: Missed call!
|
//Was STATUS_INCOMING now is STATUS_DISCONNECTED: Missed call!
|
||||||
} else if (status == 7 && previousStatus == 5) {
|
} else if (status == 7 && previousStatus == 5) {
|
||||||
dialerUtils.notifyMissedCall();
|
var prettyDate = Qt.formatTime(voiceCallmanager.activeVoiceCall.startedAt, Qt.locale().timeFormat(Locale.ShortFormat));
|
||||||
|
dialerUtils.notifyMissedCall(voiceCallmanager.activeVoiceCall.lineId, i18n("%1 called at %2", voiceCallmanager.activeVoiceCall.lineId, prettyDate));
|
||||||
root.visible = wasVisible;
|
root.visible = wasVisible;
|
||||||
insertCallInHistory(voiceCallmanager.activeVoiceCall.lineId, 0, 0);
|
insertCallInHistory(voiceCallmanager.activeVoiceCall.lineId, 0, 0);
|
||||||
} else if (status == 7) {
|
} else if (status == 7) {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ DialerUtils::~DialerUtils()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialerUtils::notifyMissedCall()
|
void DialerUtils::notifyMissedCall(const QString &caller, const QString &description)
|
||||||
{
|
{
|
||||||
qWarning() << "Missed Call.";
|
qWarning() << "Missed Call.";
|
||||||
|
|
||||||
|
|
@ -42,7 +42,13 @@ void DialerUtils::notifyMissedCall()
|
||||||
}
|
}
|
||||||
m_callsNotification->setComponentName("plasma_dialer");
|
m_callsNotification->setComponentName("plasma_dialer");
|
||||||
m_callsNotification->setIconName("call-start");
|
m_callsNotification->setIconName("call-start");
|
||||||
m_callsNotification->setTitle(i18np("One call missed", "%1 calls missed", m_missedCalls));
|
if (m_missedCalls == 1) {
|
||||||
|
m_callsNotification->setTitle(i18n("Missed call from %1", caller));
|
||||||
|
m_callsNotification->setText(description);
|
||||||
|
} else {
|
||||||
|
m_callsNotification->setTitle(i18n("%1 calls missed", m_missedCalls));
|
||||||
|
m_callsNotification->setText(i18n("Last call: %1", description));
|
||||||
|
}
|
||||||
|
|
||||||
QStringList actions;
|
QStringList actions;
|
||||||
actions.append(i18n("View"));
|
actions.append(i18n("View"));
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public:
|
||||||
DialerUtils(QObject *parent = 0);
|
DialerUtils(QObject *parent = 0);
|
||||||
virtual ~DialerUtils();
|
virtual ~DialerUtils();
|
||||||
|
|
||||||
Q_INVOKABLE void notifyMissedCall();
|
Q_INVOKABLE void notifyMissedCall(const QString &caller, const QString &description);
|
||||||
Q_INVOKABLE void resetMissedCalls();
|
Q_INVOKABLE void resetMissedCalls();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[Global]
|
[Global]
|
||||||
IconName=call-start
|
IconName=call-start
|
||||||
Comment=Plasma Phone Dialer
|
Comment=Phone
|
||||||
|
|
||||||
[Event/callMissed]
|
[Event/callMissed]
|
||||||
Name=Missed Call
|
Name=Missed Call
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue