~ubuntu-branches/ubuntu/vivid/muon/vivid-proposed

« back to all changes in this revision

Viewing changes to discover/qml/AddonsView.qml

Tags: upstream-1.3.65
ImportĀ upstreamĀ versionĀ 1.3.65

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 1.1
 
2
import org.kde.plasma.components 0.1
 
3
import org.kde.muon 1.0
 
4
 
 
5
ListView
 
6
{
 
7
    id: addonsView
 
8
    property alias application: addonsModel.application
 
9
    property alias addonsHaveChanged: addonsModel.hasChanges
 
10
    property bool isInstalling: false
 
11
    property alias isEmpty: addonsModel.isEmpty
 
12
    
 
13
    ApplicationAddonsModel { id: addonsModel }
 
14
    
 
15
    model: addonsModel
 
16
    
 
17
    clip: true
 
18
    delegate: Row {
 
19
        height: 50
 
20
        width: 50
 
21
        spacing: 10
 
22
        CheckBox {
 
23
            enabled: !isInstalling
 
24
            anchors.verticalCenter: parent.verticalCenter
 
25
            checked: model.checked
 
26
            onClicked: addonsModel.changeState(display, checked)
 
27
        }
 
28
        Image {
 
29
            source: "image://icon/applications-other"
 
30
            height: parent.height; width: height
 
31
            smooth: true
 
32
            opacity: isInstalling ? 0.3 : 1
 
33
        }
 
34
        Label {
 
35
            enabled: !isInstalling
 
36
            anchors.verticalCenter: parent.verticalCenter
 
37
            text: i18n("<qt>%1<br/><em>%2</em></qt>", display, toolTip)
 
38
        }
 
39
    }
 
40
    
 
41
    ScrollBar {
 
42
        id: scroll
 
43
        orientation: Qt.Vertical
 
44
        flickableItem: parent
 
45
        anchors {
 
46
            top: parent.top
 
47
            right: parent.right
 
48
            bottom: parent.bottom
 
49
        }
 
50
    }
 
51
    
 
52
    Row {
 
53
        visible: addonsModel.hasChanges && !isInstalling
 
54
        layoutDirection: Qt.RightToLeft
 
55
        anchors {
 
56
            top: parent.top
 
57
            right: parent.right
 
58
        }
 
59
        spacing: 5
 
60
        
 
61
        Button {
 
62
            iconSource: "dialog-ok"
 
63
            text: i18n("Apply")
 
64
            onClicked: addonsModel.applyChanges()
 
65
        }
 
66
        Button {
 
67
            iconSource: "document-revert"
 
68
            text: i18n("Discard")
 
69
            onClicked: addonsModel.discardChanges()
 
70
        }
 
71
    }
 
72
}
 
 
b'\\ No newline at end of file'