Commit 8d6f077a authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fix the barrage of breakages caused by commit b06d5126



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent a5ede7b0
Pipeline #237179 passed with stage
in 2 minutes and 32 seconds
......@@ -9,6 +9,7 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.14 as Kirigami
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.contact 1.0
import org.kde.akonadi 1.0 as Akonadi
import './private'
TapHandler {
......@@ -16,6 +17,7 @@ TapHandler {
property var collection
property var collectionDetails
property Akonadi.AgentConfiguration agentConfiguration
acceptedButtons: Kirigami.Settings.isMobile ? Qt.LeftButton | Qt.RightButton : Qt.RightButton
......@@ -42,8 +44,10 @@ TapHandler {
property Component addressBookActions: Component {
AddressBookMenu {
parent: handler.parent
collection: handler.collection
collectionDetails: handler.collectionDetails
agentConfiguration: calendarTapHandler.agentConfiguration
}
}
}
......@@ -9,6 +9,7 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.14 as Kirigami
import org.kde.kalendar 1.0 as Kalendar
import org.kde.kalendar.contact 1.0
import org.kde.akonadi 1.0 as Akonadi
QQC2.Menu {
id: actionsPopup
......@@ -16,6 +17,7 @@ QQC2.Menu {
required property var collection
required property var collectionDetails
required property Akonadi.AgentConfiguraion agentConfiguration
QQC2.MenuItem {
icon.name: "edit-entry"
......@@ -50,19 +52,19 @@ QQC2.Menu {
QQC2.MenuItem {
icon.name: "settings-configure"
text: i18nc("@action:inmenu", "Address book source settings…")
onClicked: Kalendar.AgentConfiguration.editIdentifier(collectionDetails.resource)
onClicked: actionsPopup.agentConfiguration.editIdentifier(collectionDetails.resource)
visible: collectionDetails.isResource
}
QQC2.MenuItem {
icon.name: "view-refresh"
text: i18nc("@action:inmenu", "Update address book source")
onClicked: Kalendar.AgentConfiguration.restartIdentifier(collectionDetails.resource)
onClicked: actionsPopup.agentConfiguration.restartIdentifier(collectionDetails.resource)
visible: collectionDetails.isResource
}
QQC2.MenuItem {
icon.name: "edit-delete"
text: i18nc("@action:inmenu", "Delete address source")
onClicked: Kalendar.AgentConfiguration.removeIdentifier(collectionDetails.resource)
onClicked: actionsPopup.agentConfiguration.removeIdentifier(collectionDetails.resource)
visible: collectionDetails.isResource
}
}
......@@ -7,6 +7,7 @@ import QtQuick.Dialogs 1.0
import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.14 as Kirigami
import org.kde.kalendar 1.0 as Kalendar
import org.kde.akonadi 1.0 as Akonadi
TapHandler {
id: calendarTapHandler
......@@ -15,6 +16,7 @@ TapHandler {
property var collectionId
property var collectionDetails
property Akonadi.AgentConfiguration agentConfiguration
acceptedButtons: Kirigami.Settings.isMobile ? Qt.LeftButton | Qt.RightButton : Qt.RightButton
......@@ -44,8 +46,12 @@ TapHandler {
property Component calendarActions: Component {
CalendarItemMenu {
parent: calendarTapHandler.parent
collectionId: calendarTapHandler.collectionId
collectionDetails: calendarTapHandler.collectionDetails
agentConfiguration: calendarTapHandler.agentConfiguration
onDeleteCalendar: calendarTapHandler.deleteCalendar(collectionId, collectionDetails)
Component.onCompleted: if(calendarTapHandler.collectionId && !calendarTapHandler.collectionDetails) {
calendarTapHandler.collectionDetails = Kalendar.CalendarManager.getCollectionDetails(calendarTapHandler.collectionId)
......
......@@ -10,6 +10,7 @@ import org.kde.kirigami 2.16 as Kirigami
import org.kde.kalendar 1.0
import org.kde.kalendar.contact 1.0
import org.kde.kalendar.mail 1.0
import org.kde.akonadi 1.0
import Qt.labs.qmlmodels 1.0
import org.kde.kitemmodels 1.0
import QtGraphicalEffects 1.12
......@@ -334,15 +335,18 @@ Kirigami.OverlayDrawer {
Layout.fillWidth: true
Layout.fillHeight: true
active: true
sourceComponent: mode === KalendarApplication.Mail ? mailView : calendarContactView
sourceComponent: mode === KalendarApplication.Mail ? mailView : calendarAddressBookComponent
}
Component {
id: calendarContactView
id: calendarAddressBookComponent
QQC2.ScrollView {
id: calendarView
id: calendarAddressBookView
readonly property AgentConfiguration agentConfiguration: AgentConfiguration {}
implicitWidth: Kirigami.Units.gridUnit * 16
QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff
contentWidth: availableWidth
clip: true
z: -2
......@@ -355,6 +359,8 @@ Kirigami.OverlayDrawer {
}
}
QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff
ColumnLayout {
anchors.fill: parent
spacing: 0
......@@ -510,7 +516,7 @@ Kirigami.OverlayDrawer {
leadingPadding: Kirigami.Settings.isMobile ? Kirigami.Units.largeSpacing * 2 : Kirigami.Units.largeSpacing
Connections {
target: AgentConfiguration
target: calendarAddressBookView.agentConfiguration
property var collectionDetails: CalendarManager.getCollectionDetails(collectionId)
function onAgentProgressChanged(agentData) {
......@@ -560,6 +566,7 @@ Kirigami.OverlayDrawer {
CalendarItemTapHandler {
collectionId: model.collectionId
collectionDetails: CalendarManager.getCollectionDetails(collectionId)
agentConfiguration: calendarAddressBookView.agentConfiguration
enabled: mode !== KalendarApplication.Contact
}
......@@ -625,6 +632,7 @@ Kirigami.OverlayDrawer {
CalendarItemTapHandler {
collectionId: model.collectionId
collectionDetails: CalendarManager.getCollectionDetails(collectionId)
agentConfiguration: calendarAddressBookView.agentConfiguration
enabled: mode !== KalendarApplication.Contact
onDeleteCalendar: mainDrawer.deleteCalendar(collectionId, collectionDetails)
}
......
......@@ -7,13 +7,17 @@ import QtQuick.Dialogs 1.0
import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.14 as Kirigami
import org.kde.kalendar 1.0 as Kalendar
import org.kde.akonadi 1.0 as Akonadi
QQC2.Menu {
id: actionsPopup
z: 1000
signal deleteCalendar(int collectionId, var collectionDetails)
property var collectionId
property var collectionDetails
property Akonadi.AgentConfiguration agentConfiguration
QQC2.MenuItem {
icon.name: "edit-entry"
......@@ -48,19 +52,19 @@ QQC2.Menu {
QQC2.MenuItem {
icon.name: "settings-configure"
text: i18nc("@action:inmenu", "Calendar source settings…")
onClicked: Kalendar.AgentConfiguration.editIdentifier(collectionDetails.resource)
onClicked: actionsPopup.agentConfiguration.editIdentifier(collectionDetails.resource)
visible: collectionDetails.isResource
}
QQC2.MenuItem {
icon.name: "view-refresh"
text: i18nc("@action:inmenu", "Update calendar source")
onClicked: Kalendar.AgentConfiguration.restartIdentifier(collectionDetails.resource)
onClicked: actionsPopup.agentConfiguration.restartIdentifier(collectionDetails.resource)
visible: collectionDetails.isResource
}
QQC2.MenuItem {
icon.name: "edit-delete"
text: i18nc("@action:inmenu", "Delete calendar source")
onClicked: Kalendar.AgentConfiguration.removeIdentifier(collectionDetails.resource)
onClicked: actionsPopup.agentConfiguration.removeIdentifier(collectionDetails.resource)
visible: collectionDetails.isResource
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment