Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions panels/notification/center/NotifyViewDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ DelegateChooser {
})
}
onRemove: function () {
console.log("remove overlap", model.id)
notifyModel.remove(model.id)
console.log("remove overlap", model.appName)
notifyModel.removeByApp(model.appName)
}
onActionInvoked: function (actionId) {
console.log("action overlap", model.id, actionId)
Expand Down
13 changes: 8 additions & 5 deletions panels/notification/center/OverlapNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ NotifyItem {
contentIcon: root.contentIcon
contentRowCount: root.contentRowCount
enableDismissed: root.enableDismissed

onRemove: function () {
root.removedCallback = function () {
root.remove()
clearButton: AnimationSettingButton {
icon.name: "clean-alone"
text: qsTr("Clean All")
onClicked: function () {
root.removedCallback = function() {
root.remove()
}
root.state = "removing"
}
root.state = "removing"
}
onDismiss: function () {
root.removedCallback = function () {
Expand Down
47 changes: 25 additions & 22 deletions panels/notification/center/notifymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,38 +546,41 @@ void NotifyModel::removeByApp(const QString &appName)
int row = -1;
for (int i = 0; i < m_appNotifies.size(); i++) {
auto item = m_appNotifies[i];
if (item->appName() == appName && item->type() == NotifyType::Group) {
if (item->appName() == appName && (item->type() == NotifyType::Group || item->type() == NotifyType::Overlap)) {
row = i;
break;
}
}

if (row >= 0) {
auto notify = m_appNotifies[row];
beginRemoveRows(QModelIndex(), row, row);
m_appNotifies.removeOne(notify);
endRemoveRows();
notify->deleteLater();
if (row < 0) {
qWarning(notifyLog) << "No notify for the app" << appName;
return;
}
auto notify = m_appNotifies[row];
beginRemoveRows(QModelIndex(), row, row);
m_appNotifies.removeOne(notify);
endRemoveRows();

QList<AppNotifyItem *> notifies;
for (int i = row; i < m_appNotifies.size(); i++) {
auto item = m_appNotifies[i];
if (item->appName() == appName && item->type() == NotifyType::Normal) {
notifies.append(item);
if(notify->type() == NotifyType::Group) {
QList<AppNotifyItem *> notifies;
for (int i = row; i < m_appNotifies.size(); i++) {
auto item = m_appNotifies[i];
if (item->appName() == appName && item->type() == NotifyType::Normal) {
notifies.append(item);
}
}
}

const auto start = row;
beginRemoveRows(QModelIndex(), start, start + notifies.size() - 1);
for (int i = 0; i < notifies.size(); i++) {
auto item = notifies[i];
m_appNotifies.removeOne(item);
item->deleteLater();
}
endRemoveRows();
const auto start = row;
beginRemoveRows(QModelIndex(), start, start + notifies.size() - 1);
for (int i = 0; i < notifies.size(); i++) {
auto item = notifies[i];
m_appNotifies.removeOne(item);
item->deleteLater();
}
endRemoveRows();

}
m_accessor->removeEntityByApp(appName);
notify->deleteLater();
}

void NotifyModel::clear()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OverlapNotify</name>
<message>
<source>Clean All</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>notifycenter::AppNotifyItem</name>
<message>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ar">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ar">
<context>
<name>GroupNotify</name>
<message>
Expand All @@ -7,18 +9,18 @@
</message>
<message>
<source>Fold</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>More</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NotifyCenter</name>
<message>
<source>No recent notifications</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand All @@ -33,11 +35,11 @@
</message>
<message>
<source>Fold</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>More</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand All @@ -55,11 +57,18 @@
<translation>إعداد الإخطارات</translation>
</message>
</context>
<context>
<name>OverlapNotify</name>
<message>
<source>Clean All</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>notifycenter::AppNotifyItem</name>
<message>
<source>Just now</source>
<translation>قبل دقيقة واحدة</translation>
</message>
</context>
</TS>
</TS>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="az">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="az">
<context>
<name>GroupNotify</name>
<message>
Expand All @@ -7,18 +9,18 @@
</message>
<message>
<source>Fold</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>More</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NotifyCenter</name>
<message>
<source>No recent notifications</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand All @@ -33,11 +35,11 @@
</message>
<message>
<source>Fold</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>More</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand All @@ -55,11 +57,18 @@
<translation>إعداد الإشعارات</translation>
</message>
</context>
<context>
<name>OverlapNotify</name>
<message>
<source>Clean All</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>notifycenter::AppNotifyItem</name>
<message>
<source>Just now</source>
<translation>الآن</translation>
</message>
</context>
</TS>
</TS>
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OverlapNotify</name>
<message>
<source>Clean All</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>notifycenter::AppNotifyItem</name>
<message>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="ca">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ca">
<context>
<name>GroupNotify</name>
<message>
Expand Down Expand Up @@ -55,11 +57,18 @@
<translation>Configuració de les notificacions</translation>
</message>
</context>
<context>
<name>OverlapNotify</name>
<message>
<source>Clean All</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>notifycenter::AppNotifyItem</name>
<message>
<source>Just now</source>
<translation>Ara mateix</translation>
</message>
</context>
</TS>
</TS>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="de">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<context>
<name>GroupNotify</name>
<message>
Expand All @@ -7,18 +9,18 @@
</message>
<message>
<source>Fold</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>More</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NotifyCenter</name>
<message>
<source>No recent notifications</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand All @@ -33,11 +35,11 @@
</message>
<message>
<source>Fold</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
<message>
<source>More</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
Expand All @@ -55,11 +57,18 @@
<translation>Benachrichtigungseinstellung</translation>
</message>
</context>
<context>
<name>OverlapNotify</name>
<message>
<source>Clean All</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>notifycenter::AppNotifyItem</name>
<message>
<source>Just now</source>
<translation>Gerade eben</translation>
</message>
</context>
</TS>
</TS>
Loading