~pkunal-parmar/ubuntu-calendar-app/ICalImport

« back to all changes in this revision

Viewing changes to EventActions.qml

  • Committer: Tarmac
  • Author(s): Olivier Tilloy
  • Date: 2013-09-03 15:28:32 UTC
  • mfrom: (98.2.2 fix-ap-test-assumption)
  • Revision ID: tarmac-20130903152832-p8fp3lnggz6w39w3
Do not assume there will always be a label with the given text.

Approved by Ubuntu Phone Apps Jenkins Bot, Kunal Parmar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2014 Canonical Ltd
3
 
 *
4
 
 * This file is part of Ubuntu Calendar App
5
 
 *
6
 
 * Ubuntu Calendar App is free software: you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License version 3 as
8
 
 * published by the Free Software Foundation.
9
 
 *
10
 
 * Ubuntu Calendar App is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 */
18
 
 
19
 
import QtQuick 2.3
20
 
import Ubuntu.Components 1.1
21
 
import Ubuntu.SyncMonitor 0.1
22
 
 
23
 
Item {
24
 
    id: actionPool
25
 
 
26
 
    property alias newEventAction: _newEventAction
27
 
    property alias showCalendarAction: _showCalendarAction
28
 
    property alias syncCalendarAction: _syncCalendarAction
29
 
 
30
 
    Action {
31
 
        id: _syncCalendarAction
32
 
        objectName: "syncbutton"
33
 
        iconName: "reload"
34
 
        // TRANSLATORS: Please translate this string  to 15 characters only.
35
 
        // Currently ,there is no way we can increase width of action menu currently.
36
 
        text: enabled ? i18n.tr("Sync") : i18n.tr("Syncing")
37
 
        onTriggered: syncMonitor.sync(["calendar"])
38
 
        enabled: (syncMonitor.state !== "syncing")
39
 
        visible: syncMonitor.enabledServices ? syncMonitor.serviceIsEnabled("calendar") : false
40
 
    }
41
 
 
42
 
    SyncMonitor {
43
 
        id: syncMonitor
44
 
    }
45
 
 
46
 
    Action {
47
 
        id: _newEventAction
48
 
        objectName: "neweventbutton"
49
 
        iconName: "new-event"
50
 
        text: i18n.tr("New Event")
51
 
        onTriggered: {
52
 
            pageStack.push(Qt.resolvedUrl("NewEvent.qml"),{"date":tabs.currentDay,"model":eventModel});
53
 
        }
54
 
    }
55
 
 
56
 
    Action{
57
 
        id: _showCalendarAction
58
 
        objectName: "calendarsbutton"
59
 
        iconName: "calendar"
60
 
        text: i18n.tr("Calendars")
61
 
        onTriggered: {
62
 
            pageStack.push(Qt.resolvedUrl("CalendarChoicePopup.qml"),{"model":eventModel});
63
 
            pageStack.currentPage.collectionUpdated.connect(eventModel.delayedApplyFilter);
64
 
        }
65
 
    }
66
 
}