Warning, /pim/kube/views/calendar/main.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright (C) 2018 Christian Mollekopf, <mollekopf@kolabsys.com>
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  *
0009  * This program is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0012  * GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License along
0015  * with this program; if not, write to the Free Software Foundation, Inc.,
0016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017  */
0018 
0019 import QtQuick 2.7
0020 import QtQuick.Controls 2.0
0021 import QtQuick.Window 2.0
0022 
0023 import org.kube.framework 1.0 as Kube
0024 import org.kube.test 1.0
0025 import "qml"
0026 
0027 ApplicationWindow {
0028     id: app
0029     height: Screen.desktopAvailableHeight * 0.8
0030     width: Screen.desktopAvailableWidth * 0.8
0031 
0032     Component.onCompleted: {
0033         var initialState = {
0034             accounts: [
0035                 {
0036                     id: "account1",
0037                     name: "Test Account"
0038                 },
0039                 {
0040                     id: "account2",
0041                     name: "Test Account2 With A Very Long Name"
0042                 },
0043             ],
0044             identities: [{
0045                 account: "account1",
0046                 name: "Test Identity",
0047                 address: "identity@example.org"
0048             }],
0049             resources: [
0050                 {
0051                     id: "caldavresource",
0052                     account: "account1",
0053                     type: "caldav",
0054                 },
0055                 {
0056                     id: "caldavresource2",
0057                     account: "account2",
0058                     type: "caldav",
0059                 }
0060             ],
0061             calendars: [{
0062                 id: "calendar1",
0063                 resource: "caldavresource",
0064                 name: "Test Calendar",
0065                 color: "#af1a6a",
0066                 enabled: true,
0067                 events: [
0068                     {
0069                         resource: "caldavresource",
0070                         summary: "Short event1!",
0071                         starts: "2018-04-09T14:03:00",
0072                         organizer: "organizer@example.org",
0073                         location: "This is a rather long location description and Fantasyroad 209 in Somewhere.",
0074                         attendees: [
0075                             {email: "attendee1@example.org"},
0076                             {email: "attendee2@example.org"},
0077                             {email: "attendee3@example.org"},
0078                             {email: "attendee4@example.org"},
0079                             {email: "attendee5@example.org"},
0080                             {email: "attendee6@example.org"},
0081                             {email: "attendee7@example.org"},
0082                             {email: "attendee8@example.org"},
0083                             {email: "attendee9@example.org"},
0084                             {email: "verylongattendee-withanotherlongname@vereeeeerylong.org"},
0085                             {email: "identity@example.org"}
0086                         ]
0087                     },
0088                     {
0089                         resource: "caldavresource",
0090                         summary: "Short event2!",
0091                         starts: "2018-04-09T14:03:00",
0092                         organizer: "organizer@example.org",
0093                         attendees: [{email: "attendee1@example.org"}, {email: "identity@example.org"}]
0094                     },
0095                     {
0096                         resource: "caldavresource",
0097                         summary: "Short event3!",
0098                         starts: "2018-04-09T14:03:00",
0099                     },
0100                     {
0101                         resource: "caldavresource",
0102                         summary: "Short event4!",
0103                         starts: "2018-04-09T15:03:00",
0104                     },
0105                     {
0106                         resource: "caldavresource",
0107                         summary: "Short event5!",
0108                         starts: "2018-04-09T16:03:00",
0109                     },
0110                     {
0111                         resource: "caldavresource",
0112                         summary: "Short event6!",
0113                         starts: "2018-05-08T12:03:00",
0114                     },
0115                     {
0116                         resource: "caldavresource",
0117                         summary: "Short event7!",
0118                         starts: "2018-05-08T12:03:00",
0119                     },
0120                     {
0121                         resource: "caldavresource",
0122                         summary: "Short event8!",
0123                         starts: "2018-05-08T12:03:00",
0124                     },
0125                     {
0126                         resource: "caldavresource",
0127                         summary: "Short event9!",
0128                         starts: "2018-05-08T12:03:00",
0129                     },
0130                     {
0131                         resource: "caldavresource",
0132                         summary: "Short event10!",
0133                         starts: "2018-05-08T12:03:00",
0134                     },
0135                     {
0136                         resource: "caldavresource",
0137                         summary: "Test Event1 with a waaaaaaaay to long summary. Why don't you just use the description you fool!",
0138                         description: "This is test event #1",
0139                         starts: "2018-04-10T14:03:00",
0140                         ends:   "2018-04-10T16:03:00",
0141                     },
0142                     {
0143                         resource: "caldavresource",
0144                         summary: "Test Event2",
0145                         description: "This is test event #2",
0146                         starts: "2018-04-11T09:03:00",
0147                         ends:   "2018-04-11T14:03:00",
0148                     },
0149                     {
0150                         resource: "caldavresource",
0151                         summary: "Test Event3",
0152                         description: "This is test event #3",
0153                         starts: "2018-04-11T10:00:00",
0154                         ends:   "2018-04-11T15:00:00",
0155                     },
0156                     {
0157                         resource: "caldavresource",
0158                         summary: "Test Event4",
0159                         description: "This is test event #4",
0160                         starts: "2018-04-12T03:00:00",
0161                         ends:   "2018-04-14T22:00:00",
0162                     },
0163                     {
0164                         resource: "caldavresource",
0165                         summary: "!!! Test Event5",
0166                         description: "!!! This is test event #5",
0167                         starts: "2018-04-22T22:00:00",
0168                         ends:   "2018-04-25T03:00:00",
0169                     },
0170 
0171                     // Day-long events
0172                     {
0173                         resource: "caldavresource",
0174                         summary: "Test day-long event1",
0175                         description: "This is test day-long event #1",
0176                         starts: "2018-04-10T00:00:00",
0177                         ends:   "2018-04-14T00:00:00",
0178                         allDay: true,
0179                     },
0180                     {
0181                         resource: "caldavresource",
0182                         summary: "Test day-long event2",
0183                         description: "This is test day-long event #2",
0184                         starts: "2018-04-11",
0185                         allDay: true,
0186                     },
0187                     {
0188                         resource: "caldavresource",
0189                         summary: "Test day-long event3",
0190                         description: "This is test day-long event #3",
0191                         starts: "2018-04-01T00:00:00",
0192                         ends:   "2018-04-13T00:00:00",
0193                         allDay: true,
0194                     },
0195                     {
0196                         resource: "caldavresource",
0197                         summary: "Test day-long event4",
0198                         description: "This is test day-long event #4",
0199                         starts: "2018-04-01T00:00:00",
0200                         ends:   "2018-04-25T00:00:00",
0201                         allDay: true,
0202                     },
0203                     {
0204                         resource: "caldavresource",
0205                         summary: "!!! Test day-long event5",
0206                         description: "!!! This is test day-long event #5",
0207                         starts: "2018-04-01T00:00:00",
0208                         ends:   "2018-04-05T00:00:00",
0209                         allDay: true,
0210                     },
0211                     {
0212                         resource: "caldavresource",
0213                         summary: "!!! Test day-long event6",
0214                         description: "!!! This is test day-long event #6",
0215                         starts: "2018-04-23T00:00:00",
0216                         ends:   "2018-04-25T00:00:00",
0217                         allDay: true,
0218                     },
0219                     {
0220                         resource: "caldavresource",
0221                         summary: "Test day-long event7",
0222                         description: "This is test day-long event #7",
0223                         starts: "2018-04-12",
0224                         allDay: true,
0225                     },
0226                 ],
0227             },
0228             {
0229                 id: "calendar2",
0230                 resource: "caldavresource",
0231                 name: "Test Calendar2",
0232                 enabled: true,
0233                 color: "#00cc4b"
0234             },
0235             {
0236                 id: "calendar3",
0237                 resource: "caldavresource",
0238                 name: "Test Calendar3 Loooooooooooooooooooooooooooooong Name",
0239                 enabled: true,
0240                 color: "#00cc4b"
0241             },
0242             {
0243                 id: "calendar4",
0244                 resource: "caldavresource",
0245                 name: "Test Calendar4",
0246                 enabled: true,
0247                 color: "#cc0000"
0248             },
0249             {
0250                 id: "calendar5",
0251                 resource: "caldavresource",
0252                 name: "Test Calendar5",
0253                 enabled: true,
0254                 color: "#cc0000"
0255             },
0256             {
0257                 id: "calendar6",
0258                 resource: "caldavresource",
0259                 name: "Test Calendar6",
0260                 enabled: true,
0261                 color: "#f67400"
0262             },
0263             {
0264                 id: "calendar7",
0265                 resource: "caldavresource",
0266                 name: "Test Calendar7",
0267                 enabled: true,
0268                 color: "#f67400"
0269             },
0270             {
0271                 id: "calendar8",
0272                 resource: "caldavresource",
0273                 name: "Test Calendar8",
0274                 enabled: true,
0275                 color: "#f67400"
0276             },
0277             {
0278                 id: "calendar9",
0279                 resource: "caldavresource",
0280                 name: "Test Calendar9",
0281                 enabled: true,
0282                 color: "#f67400"
0283             },
0284             {
0285                 id: "calendar10",
0286                 resource: "caldavresource",
0287                 name: "Test Calendar 10",
0288                 enabled: true,
0289                 color: "#f67400"
0290             },
0291             {
0292                 id: "calendar11",
0293                 resource: "caldavresource",
0294                 name: "Test Calendar11",
0295                 enabled: true,
0296                 color: "#f67400"
0297             },
0298             {
0299                 id: "calendar12",
0300                 resource: "caldavresource",
0301                 name: "Test Calendar12",
0302                 enabled: true,
0303                 color: "#f67400"
0304             },
0305             {
0306                 id: "calendar13",
0307                 resource: "caldavresource",
0308                 name: "Test Calendar13",
0309                 enabled: true,
0310                 color: "#f67400"
0311             },
0312             {
0313                 id: "calendar14",
0314                 resource: "caldavresource",
0315                 name: "Test Calendar14",
0316                 enabled: true,
0317                 color: "#f67400"
0318             },
0319             {
0320                 id: "calendar15",
0321                 resource: "caldavresource",
0322                 name: "Test Calendar15",
0323                 enabled: true,
0324                 color: "#f67400"
0325             },
0326             {
0327                 id: "calendar16",
0328                 resource: "caldavresource",
0329                 name: "Test Calendar16",
0330                 enabled: true,
0331                 color: "#f67400"
0332             },
0333             {
0334                 id: "account2calendar",
0335                 resource: "caldavresource2",
0336                 name: "Account2Calendar",
0337                 enabled: false,
0338                 color: "#f67400"
0339             }],
0340         }
0341         TestStore.setup(initialState)
0342         Kube.Context.autoUpdateDate = false
0343         Kube.Context.currentDate = "2018-04-11T13:04:03"
0344     }
0345 
0346     View {
0347         anchors.fill: parent
0348     }
0349 }