~bobo-324/dekko/customScheme

« back to all changes in this revision

Viewing changes to qml/MessageView/MultipartAlternativeWidget.qml

  • Committer: Dan Chapman
  • Date: 2014-11-07 19:41:38 UTC
  • mfrom: (148.1.15 removeQtWebkit)
  • Revision ID: dpniel@ubuntu.com-20141107194138-n95ozzhrcu2rg5ib
Finally webkit has been nuked from dekko!! Thanks for your work on this boren

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import Ubuntu.Components.ListItems 1.0 as ListItem
20
20
Column {
21
21
    id: column
22
 
    property url plainTextUrl;
23
 
    property alias typeIndex: messageTypeSelector.selectedIndex
24
 
    property var mimeTypes: []
25
 
    property var mimeTypeItems: []
26
22
    width: parent.width
27
23
    spacing: units.gu(1)
28
 
    ListItem.ValueSelector {
29
 
        id: messageTypeSelector
30
 
        values: column.mimeTypes
31
 
        selectedIndex: -1
32
 
        onSelectedIndexChanged: {
33
 
            for (var i in mimeTypeItems) {
34
 
                if (mimeTypeItems[i] !== null) {
35
 
                    mimeTypeItems[i].visible = (selectedIndex == i);
36
 
                }
37
 
            }
38
 
        }
39
 
    }
40
 
 
 
24
    //Adding mimetype is implemented at the end of PartWidgetFactory::newSimplePartWidget now
41
25
    function addMimeType(item, type) {
42
 
        console.log("addMimeType " + type + " " + item);
43
 
        mimeTypes.push(type);
44
 
        messageTypeSelector.values = mimeTypes;
45
 
        mimeTypeItems.push(item);
46
26
        item.parent = column;
47
27
    }
48
 
 
49
28
    function setDisplayedMessageType(idx) {
50
 
        messageTypeSelector.selectedIndex = idx;
 
29
        oneMessagePage.head.sections.selectedIndex = idx;
51
30
    }
52
31
}