~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to mobile/calendar/EventListComponent.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2010 Volker Krause <vkrause@kde.org>
 
3
    Copyright (c) 2010 Bertjan Broeksema <broeksema@kde.org>
 
4
 
 
5
    This library is free software; you can redistribute it and/or modify it
 
6
    under the terms of the GNU Library General Public License as published by
 
7
    the Free Software Foundation; either version 2 of the License, or (at your
 
8
    option) any later version.
 
9
 
 
10
    This library is distributed in the hope that it will be useful, but WITHOUT
 
11
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
12
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
 
13
    License for more details.
 
14
 
 
15
    You should have received a copy of the GNU Library General Public License
 
16
    along with this library; see the file COPYING.LIB.  If not, write to the
 
17
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
18
    02110-1301, USA.
 
19
*/
 
20
 
 
21
import Qt 4.7 as QML
 
22
import org.kde 4.5
 
23
import org.kde.akonadi 4.5 as Akonadi
 
24
import org.kde.pim.mobileui 4.5 as KPIM
 
25
 
 
26
QML.Rectangle {
 
27
  id: eventListView
 
28
  visible: guiStateManager.inViewEventListState
 
29
  anchors.fill: parent
 
30
  color: "#D2D1D0" // TODO: make palette work correctly. palette.window
 
31
 
 
32
  QML.Rectangle {
 
33
    height: 48
 
34
    width: 48
 
35
    z: 5
 
36
    color: "#00000000"
 
37
    anchors.right : parent.right
 
38
    anchors.rightMargin : 70
 
39
    anchors.bottom : parent.bottom
 
40
    anchors.bottomMargin : 70
 
41
    QML.Image {
 
42
      source : KDE.locate( "data", "mobileui/back-to-list-button.png" );
 
43
      QML.MouseArea {
 
44
        anchors.fill : parent;
 
45
        onClicked : {
 
46
          _itemActionModel.select(-1, 1)
 
47
          _itemNavigationModel.select(-1, 1)
 
48
          guiStateManager.popState();
 
49
        }
 
50
      }
 
51
    }
 
52
  }
 
53
 
 
54
  EventListView {
 
55
    showCheckBox : false
 
56
    id: eventList
 
57
    model: itemModel
 
58
    checkModel : _itemActionModel
 
59
    anchors.left : parent.left
 
60
    anchors.top : parent.top
 
61
    anchors.bottom : filterLineEdit.top
 
62
    anchors.right : parent.right
 
63
    anchors.topMargin: 30
 
64
    anchors.leftMargin: 40
 
65
 
 
66
    navigationModel : _itemNavigationModel
 
67
  }
 
68
 
 
69
  Akonadi.FilterLineEdit {
 
70
    id: filterLineEdit
 
71
    anchors.left : parent.left
 
72
    anchors.bottom : parent.bottom
 
73
    anchors.right : parent.right
 
74
    anchors.leftMargin: 40
 
75
    visible : false
 
76
    height : 0
 
77
    y : height == 0 ? parent.height : parent.height - height
 
78
  }
 
79
 
 
80
  QML.Connections {
 
81
    target : _itemNavigationModel
 
82
    onCurrentRowChanged : {
 
83
      application.setCurrentEventItemId(_itemNavigationModel.currentItemIdHack);
 
84
      guiStateManager.pushUniqueState( KPIM.GuiStateManager.ViewSingleItemState )
 
85
      _itemActionModel.select( _itemNavigationModel.currentRow, 3 );
 
86
      eventView.itemId = _itemNavigationModel.currentItemIdHack;
 
87
    }
 
88
  }
 
89
}