mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
clear calls button
tabbar to filter only missed calls
This commit is contained in:
parent
fc430058bf
commit
111223b727
2 changed files with 73 additions and 19 deletions
|
|
@ -42,12 +42,52 @@ Item {
|
||||||
visible: historyModel.count == 0
|
visible: historyModel.count == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaExtras.ScrollArea {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
visible: historyModel.count > 0
|
||||||
|
PlasmaComponents.ToolBar {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
tools: RowLayout {
|
||||||
|
id: toolBarLayout
|
||||||
|
PlasmaComponents.TabBar {
|
||||||
|
tabPosition: Qt.TopEdge
|
||||||
|
PlasmaComponents.TabButton {
|
||||||
|
iconSource: "call-start"
|
||||||
|
text: i18n("All")
|
||||||
|
onCheckedChanged: {
|
||||||
|
if (checked) {
|
||||||
|
filterModel.filterString = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PlasmaComponents.TabButton {
|
||||||
|
iconSource: "list-remove"
|
||||||
|
text: i18n("Missed")
|
||||||
|
onCheckedChanged: {
|
||||||
|
if (checked) {
|
||||||
|
filterModel.filterString = "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
PlasmaComponents.Button {
|
||||||
|
text: i18n("Clear")
|
||||||
|
onClicked: clearHistory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PlasmaExtras.ScrollArea {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
ListView {
|
ListView {
|
||||||
id: view
|
id: view
|
||||||
model: PlasmaCore.SortFilterModel {
|
model: PlasmaCore.SortFilterModel {
|
||||||
|
id: filterModel
|
||||||
sourceModel: historyModel
|
sourceModel: historyModel
|
||||||
|
filterRole: "callType"
|
||||||
sortRole: "time"
|
sortRole: "time"
|
||||||
sortOrder: Qt.DescendingOrder
|
sortOrder: Qt.DescendingOrder
|
||||||
}
|
}
|
||||||
|
|
@ -68,3 +108,4 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
@ -135,6 +135,19 @@ ApplicationWindow {
|
||||||
|
|
||||||
historyModel.remove(index);
|
historyModel.remove(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearHistory() {
|
||||||
|
var db = LocalStorage.openDatabaseSync("PlasmaPhoneDialer", "1.0", "Call history of the Plasma Phone dialer", 1000000);
|
||||||
|
|
||||||
|
db.transaction(
|
||||||
|
function(tx) {
|
||||||
|
tx.executeSql("DELETE from History");
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
historyModel.clear();
|
||||||
|
}
|
||||||
|
|
||||||
//END FUNCTIONS
|
//END FUNCTIONS
|
||||||
|
|
||||||
//BEGIN DATABASE
|
//BEGIN DATABASE
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue