Merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1476501 into lp:ubuntu-calendar-app

Proposed by Arthur Mello
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 792
Merged at revision: 792
Proposed branch: lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1476501
Merge into: lp:ubuntu-calendar-app
Diff against target: 38 lines (+22/-1)
1 file modified
CalendarChoicePopup.qml (+22/-1)
To merge this branch: bzr merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1476501
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
Review via email: mp+289785@code.launchpad.net

Commit message

Add dialog popup warning user that one writable calendar must be always selected

Description of the change

Add dialog popup warning user that one writable calendar must be always selected

To post a comment you must log in.
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CalendarChoicePopup.qml'
--- CalendarChoicePopup.qml 2016-03-02 19:55:52 +0000
+++ CalendarChoicePopup.qml 2016-03-22 12:31:26 +0000
@@ -106,6 +106,15 @@
106 checked: modelData.extendedMetaData("collection-selected")106 checked: modelData.extendedMetaData("collection-selected")
107 enabled: !calendarChoicePage.isInEditMode107 enabled: !calendarChoicePage.isInEditMode
108 onCheckedChanged: {108 onCheckedChanged: {
109 if (!checkBox.checked && modelData.extendedMetaData("collection-readonly") === false) {
110 var collections = calendarChoicePage.model.getWritableAndSelectedCollections();
111 if (collections.length == 1) {
112 PopupUtils.open(singleWritableDialogComponent);
113 checkBox.checked = true;
114 return;
115 }
116 }
117
109 modelData.setExtendedMetaData("collection-selected",checkBox.checked)118 modelData.setExtendedMetaData("collection-selected",checkBox.checked)
110 var collection = calendarChoicePage.model.collection(modelData.collectionId);119 var collection = calendarChoicePage.model.collection(modelData.collectionId);
111 calendarChoicePage.model.saveCollection(collection);120 calendarChoicePage.model.saveCollection(collection);
@@ -149,5 +158,17 @@
149 asynchronous: true158 asynchronous: true
150 source: sourceFile159 source: sourceFile
151 }160 }
161
162 Component {
163 id: singleWritableDialogComponent
164 Dialog {
165 id: singleWritableDialog
166 title: i18n.tr("Unable to deselect")
167 text: i18n.tr("In order to create new events you must have at least one writable calendar selected")
168 Button {
169 text: i18n.tr("Ok")
170 onClicked: PopupUtils.close(singleWritableDialog)
171 }
172 }
173 }
152}174}
153

Subscribers

People subscribed via source and target branches

to status/vote changes: