ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #07798
[Merge] lp:~renatofilho/ubuntu-calendar-app/bottom-edge into lp:ubuntu-calendar-app
Renato Araujo Oliveira Filho has proposed merging lp:~renatofilho/ubuntu-calendar-app/bottom-edge into lp:ubuntu-calendar-app with lp:~renatofilho/ubuntu-calendar-app/optimize-page-load as a prerequisite.
Requested reviews:
Ubuntu Calendar Developers (ubuntu-calendar-dev)
For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-calendar-app/bottom-edge/+merge/284622
--
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~renatofilho/ubuntu-calendar-app/bottom-edge into lp:ubuntu-calendar-app.
=== modified file 'AgendaView.qml'
--- AgendaView.qml 2016-02-01 15:09:12 +0000
+++ AgendaView.qml 2016-02-01 15:09:12 +0000
@@ -22,16 +22,12 @@
import Ubuntu.Components.ListItems 1.0 as ListItem
import "dateExt.js" as DateExt
-Page{
+PageWithBottomEdge {
id: root
objectName: "AgendaView"
- property var currentDay: new Date()
-
signal dateSelected(var date);
- Keys.forwardTo: [eventList]
-
function goToBeginning() {
eventList.positionViewAtBeginning();
}
@@ -44,13 +40,16 @@
return !!enabled_calendars.length;
}
+ currentDate: new Date()
+ Keys.forwardTo: [eventList]
+
Action {
id: calendarTodayAction
objectName:"todaybutton"
iconName: "calendar-today"
text: i18n.tr("Today")
onTriggered: {
- currentDay = new Date()
+ currentDate = new Date()
goToBeginning()
}
}
@@ -71,7 +70,6 @@
leadingActionBar.actions: tabs.tabsAction
trailingActionBar.actions: [
calendarTodayAction,
- commonHeaderActions.newEventAction,
commonHeaderActions.showCalendarAction,
commonHeaderActions.reloadAction,
commonHeaderActions.syncCalendarAction,
@@ -83,9 +81,9 @@
EventListModel {
id: eventListModel
- startPeriod: currentDay.midnight();
- endPeriod: currentDay.addDays(7).endOfDay()
- filter: eventModel.filter
+ startPeriod: currentDate.midnight();
+ endPeriod: currentDate.addDays(7).endOfDay()
+ filter: model.filter
sortOrders: [
SortOrder{
@@ -115,7 +113,7 @@
return default_title;
}
- visible: (eventListModel.count === 0) && !eventListModel.isLoading
+ visible: (eventList.count === 0) && !eventListModel.isLoading
anchors.centerIn: parent
}
@@ -128,12 +126,12 @@
color: UbuntuColors.orange
onClicked: {
- pageStack.push(Qt.resolvedUrl("CalendarChoicePopup.qml"),{"model":eventModel});
- pageStack.currentPage.collectionUpdated.connect(eventModel.delayedApplyFilter);
+ pageStack.push(Qt.resolvedUrl("CalendarChoicePopup.qml"),{"model": model});
+ pageStack.currentPage.collectionUpdated.connect(model.delayedApplyFilter);
}
}
- ListView{
+ ListView {
id: eventList
objectName: "eventList"
model: eventListModel
=== modified file 'DayView.qml'
--- DayView.qml 2016-02-01 15:09:12 +0000
+++ DayView.qml 2016-02-01 15:09:12 +0000
@@ -26,17 +26,16 @@
import "dateExt.js" as DateExt
import "ViewType.js" as ViewType
-Page{
+PageWithBottomEdge {
id: dayViewPage
objectName: "dayViewPage"
- property var currentDay: new Date()
property bool isCurrentPage: false
signal dateSelected(var date);
+ currentDate: new Date()
Keys.forwardTo: [dayViewPath]
- flickable: null
Action {
id: calendarTodayAction
@@ -44,13 +43,14 @@
iconName: "calendar-today"
text: i18n.tr("Today")
onTriggered: {
- currentDay = new Date()
+ currentDate = new Date()
}
}
header: PageHeader {
id: pageHeader
+ flickable: null
leadingActionBar.actions: tabs.tabsAction
trailingActionBar.actions: [
calendarTodayAction,
@@ -72,18 +72,17 @@
// TRANSLATORS: this is a time formatting string,
// see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
// It's used in the header of the month and week views
- var monthName = currentDay.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
+ var monthName = currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
return monthName[0].toUpperCase() + monthName.substr(1, monthName.length - 1)
>>>>>>> MERGE-SOURCE
}
-
}
PathViewBase{
id: dayViewPath
objectName: "dayViewPath"
- property var startDay: currentDay
+ property var startDay: currentDate
//This is used to scroll all view together when currentItem scrolls
property var childContentY;
@@ -94,12 +93,12 @@
onNextItemHighlighted: {
//next day
- currentDay = currentDay.addDays(1);
+ currentDate = currentDate.addDays(1);
}
onPreviousItemHighlighted: {
//previous day
- currentDay = currentDay.addDays(-1);
+ currentDate = currentDate.addDays(-1);
}
delegate: Loader {
=== modified file 'EventActions.qml'
--- EventActions.qml 2016-02-01 15:09:12 +0000
+++ EventActions.qml 2016-02-01 15:09:12 +0000
@@ -28,9 +28,12 @@
Item {
id: actionPool
+<<<<<<< TREE
//removing till following bug is resolved
//https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1493178
//property alias newEventAction: _newEventAction
+=======
+>>>>>>> MERGE-SOURCE
property alias showCalendarAction: _showCalendarAction
property alias syncCalendarAction: _syncCalendarAction
property alias settingsAction: _settingsAction
@@ -51,16 +54,6 @@
id: syncMonitor
}
- Action {
- id: _newEventAction
- objectName: "neweventbutton"
- iconName: "new-event"
- text: i18n.tr("New Event")
- onTriggered: {
- pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"date":tabs.currentDay,"model":eventModel});
- }
- }
-
Action{
id: _showCalendarAction
objectName: "calendarsbutton"
=== modified file 'MonthView.qml'
--- MonthView.qml 2016-02-01 15:09:12 +0000
+++ MonthView.qml 2016-02-01 15:09:12 +0000
@@ -25,11 +25,10 @@
import "dateExt.js" as DateExt
import "colorUtils.js" as Color
-Page {
+PageWithBottomEdge {
id: monthViewPage
objectName: "monthViewPage"
- property var currentMonth: DateExt.today();
property var selectedDay;
signal dateSelected(var date);
@@ -43,10 +42,11 @@
iconName: "calendar-today"
text: i18n.tr("Today")
onTriggered: {
- currentMonth = new Date().midnight()
+ currentDate = new Date().midnight()
}
}
+ currentDate: DateExt.today();
header: PageHeader {
id: pageHeader
@@ -69,7 +69,7 @@
// TRANSLATORS: this is a time formatting string,
// see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
// It's used in the header of the month and week views
- var monthName = currentMonth.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
+ var monthName = currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
return monthName[0].toUpperCase() + monthName.substr(1, monthName.length - 1)
}
@@ -80,7 +80,7 @@
id: monthViewPath
objectName: "monthViewPath"
- property var startMonth: currentMonth;
+ property var startMonth: currentDate;
anchors {
fill: parent
@@ -96,11 +96,11 @@
}
function nextMonth() {
- currentMonth = addMonth(currentMonth, 1);
+ currentDate = addMonth(currentDate, 1);
}
function previousMonth() {
- currentMonth = addMonth(currentMonth, -1);
+ currentDate = addMonth(currentDate, -1);
}
function addMonth(date,month) {
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-02-01 15:09:12 +0000
+++ NewEvent.qml 2016-02-01 15:09:12 +0000
@@ -42,49 +42,9 @@
property alias scrollY: flickable.contentY
property bool isEdit: false
- flickable: null
-
signal eventAdded(var event);
signal eventDeleted(var event);
- onStartDateChanged: {
- startDateTimeInput.dateTime = startDate;
-
- // set time forward to one hour
- var time_forward = 3600000;
-
- if (isEdit && event !== null) {
- time_forward = event.endDateTime - event.startDateTime;
- }
- adjustEndDateToStartDate(time_forward);
- }
-
- onEndDateChanged: {
- endDateTimeInput.dateTime = endDate;
- }
-
- head.actions: [
- Action {
- text: i18n.tr("Delete");
- objectName: "delete"
- iconName: "delete"
- visible : isEdit
- onTriggered: {
- var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event});
- dialog.deleteEvent.connect( function(eventId){
- model.removeItem(eventId);
- pageStack.pop();
- root.eventDeleted(eventId);
- });
- }
- },
- Action {
- iconName: "ok"
- objectName: "save"
- text: i18n.tr("Save")
- enabled: !!titleEdit.text.trim()
- onTriggered: saveToQtPim();
- }]
Component.onCompleted: {
//If current date is setted by an argument we don't have to change it.
if(typeof(date) === 'undefined'){
@@ -322,12 +282,56 @@
scrollAnimation.start()
}
- title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")
-
Keys.onEscapePressed: {
pageStack.pop();
}
+ onStartDateChanged: {
+ startDateTimeInput.dateTime = startDate;
+
+ // set time forward to one hour
+ var time_forward = 3600000;
+
+ if (isEdit && event !== null) {
+ time_forward = event.endDateTime - event.startDateTime;
+ }
+ adjustEndDateToStartDate(time_forward);
+ }
+
+ onEndDateChanged: {
+ endDateTimeInput.dateTime = endDate;
+ }
+
+ header: PageHeader {
+ id: pageHeader
+
+ flickable: null
+ title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")
+ trailingActionBar.actions: [
+ Action {
+ text: i18n.tr("Delete");
+ objectName: "delete"
+ iconName: "delete"
+ visible : isEdit
+ onTriggered: {
+ var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event});
+ dialog.deleteEvent.connect( function(eventId){
+ model.removeItem(eventId);
+ pageStack.pop();
+ root.eventDeleted(eventId);
+ });
+ }
+ },
+ Action {
+ iconName: "ok"
+ objectName: "save"
+ text: i18n.tr("Save")
+ enabled: !!titleEdit.text.trim()
+ onTriggered: saveToQtPim();
+ }
+ ]
+ }
+
Component{
id: errorDlgComponent
Dialog {
@@ -376,7 +380,10 @@
flickable.returnToBounds()
}
- anchors.fill: parent
+ anchors {
+ fill: parent
+ topMargin: header.height
+ }
contentWidth: width
contentHeight: column.height + units.gu(10)
=== added file 'NewEventBottomEdge.qml'
--- NewEventBottomEdge.qml 1970-01-01 00:00:00 +0000
+++ NewEventBottomEdge.qml 2016-02-01 15:09:12 +0000
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2013-2016 Canonical Ltd
+ *
+ * This file is part of Ubuntu Calendar App
+ *
+ * Ubuntu Calendar App is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Ubuntu Calendar App is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.4
+import Ubuntu.Components 1.3
+
+BottomEdge {
+ id: bottomEdge
+ objectName: "bottomEdge"
+
+ property var pageStack: null
+ property var eventModel: null
+ property var date: null
+
+ hint {
+ action: Action {
+ iconName: "event-new"
+ shortcut: "ctrl+n"
+ enabled: bottomEdge.enabled
+
+ onTriggered: bottomEdge.commit()
+ }
+ }
+
+ contentComponent: NewEvent {
+ implicitWidth: bottomEdge.width
+ implicitHeight: bottomEdge.height
+ model: bottomEdge.eventModel
+ date: bottomEdge.date
+ enabled: bottomEdge.status === BottomEdge.Committed
+ active: bottomEdge.status === BottomEdge.Committed
+ visible: bottomEdge.status !== BottomEdge.Hidden
+ }
+}
=== added file 'PageWithBottomEdge.qml'
--- PageWithBottomEdge.qml 1970-01-01 00:00:00 +0000
+++ PageWithBottomEdge.qml 2016-02-01 15:09:12 +0000
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2013-2016 Canonical Ltd
+ *
+ * This file is part of Ubuntu Calendar App
+ *
+ * Ubuntu Calendar App is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Ubuntu Calendar App is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+import QtQuick 2.4
+import Ubuntu.Components 1.3
+
+Page {
+ id: root
+
+ property alias model: bottomEdge.eventModel
+ property alias currentDate: bottomEdge.date
+
+ NewEventBottomEdge {
+ id: bottomEdge
+
+ pageStack: tabs
+ }
+}
=== modified file 'WeekView.qml'
--- WeekView.qml 2016-02-01 15:09:12 +0000
+++ WeekView.qml 2016-02-01 15:09:12 +0000
@@ -26,7 +26,7 @@
import "dateExt.js" as DateExt
import "ViewType.js" as ViewType
-Page{
+PageWithBottomEdge {
id: weekViewPage
objectName: "weekViewPage"
@@ -39,8 +39,8 @@
signal dateHighlighted(var date);
Keys.forwardTo: [weekViewPath]
-
- flickable: null
+ // used by new event bottom edge
+ currentDate: dayStart
Action {
id: calendarTodayAction
=== modified file 'YearView.qml'
--- YearView.qml 2016-02-01 15:09:12 +0000
+++ YearView.qml 2016-02-01 15:09:12 +0000
@@ -25,21 +25,23 @@
>>>>>>> MERGE-SOURCE
import "dateExt.js" as DateExt
-Page {
+
+PageWithBottomEdge {
id: yearViewPage
objectName: "yearViewPage"
property int currentYear: DateExt.today().getFullYear();
signal monthSelected(var date);
- Keys.forwardTo: [yearPathView]
-
function refreshCurrentYear(year) {
currentYear = year;
var yearViewDelegate = yearPathView.currentItem.item;
yearViewDelegate.refresh();
}
+ currentDate: new Date(currentYear, 0, 1, 0, 0, 0)
+ Keys.forwardTo: [yearPathView]
+
Action {
id: calendarTodayAction
objectName:"todaybutton"
=== modified file 'calendar.qml'
--- calendar.qml 2016-02-01 15:09:12 +0000
+++ calendar.qml 2016-02-01 15:09:12 +0000
@@ -94,7 +94,7 @@
width: units.gu(100)
height: units.gu(80)
focus: true
- Keys.forwardTo: [pageStack.currentPage]
+ Keys.forwardTo: [tabs.currentPage]
headerColor: "#E8E8E8"
backgroundColor: "#f5f5f5"
@@ -368,6 +368,11 @@
}
reloadTabActions()
tabs.isReady = true
+ // WORKAROUND: Due the missing feature on SDK, they can not detect if
+ // there is a mouse attached to device or not. And this will cause the
+ // bootom edge component to not work correct on desktop.
+ // We will consider that a mouse is always attached until it get implement on SDK.
+ QuickUtils.mouseAttached = true
} // End of Component.onCompleted:
@@ -504,6 +509,7 @@
id: yearViewComp
YearView {
+ model: eventModel
onMonthSelected: {
var now = DateExt.today();
if ((date.getMonth() === now.getMonth()) &&
@@ -526,13 +532,14 @@
id: monthViewComp
MonthView {
+ model: eventModel
onDateSelected: {
tabs.currentDay = date;
tabs.selectedTabIndex = dayTab.index
}
onActiveChanged: {
if (active)
- currentMonth = tabs.currentDay.midnight()
+ currentDate = tabs.currentDay.midnight()
}
}
}
@@ -541,6 +548,7 @@
id: weekViewComp
WeekView {
+ model: eventModel
onDayStartChanged: {
tabs.currentDay = dayStart
}
@@ -559,8 +567,10 @@
id: dayViewComp
DayView {
- onCurrentDayChanged: {
- tabs.currentDay = currentDay;
+ model: eventModel
+
+ onCurrentDateChanged: {
+ tabs.currentDay = currentDate
}
onDateSelected: {
@@ -569,7 +579,7 @@
onActiveChanged: {
if (active)
- currentDay = tabs.currentDay;
+ currentDate = tabs.currentDay
}
}
}
@@ -578,6 +588,8 @@
id: agendaViewComp
AgendaView {
+ model: eventModel
+
onDateSelected: {
tabs.currentDay = date;
tabs.selectedTabIndex = dayTab.index
Follow ups