summaryrefslogtreecommitdiff
path: root/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml
blob: bb87d41c2cd99cc22cf0e278b14cf09aa4004874 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
import QtQuick 2.0
import com.ford.hmiframework 1.0
import "../Layouts"
import "../Animations"
import "../Widgets"

FStateView {
    id:sv
    priority: 2

    view: FView {
        //viewClass: baseScreen
        layout: TileBackLayoutPCA {
            id:l


            listWrap: false
            list_data: FProxyListModel {
                id: menuProxy
                sourceModel: menuItemData
            }
            list_itemWidget: GridViewItemWidget {

            }
        }

        FMenuModel {
            id: menuItemData
            FMenuElement { id: sourceAM; menuText: "AM"; }
            FMenuElement { id: sourceFM; menuText: "FM"; }
            FMenuElement { id: sourceSat; menuText: "Sirius";  }
            FMenuElement { id: sourceCD; menuText: "CD";  }
            FMenuElement { id: sourceBt; menuText: "BT Audio";   }
            FMenuElement { id: sourceIpod; menuText: "iPod";   }
            FMenuElement { id: sourceUSB; menuText: "USB";   }
            FMenuElement { id: sourceLineIn; menuText: "Line In";}            
            FMenuElement { id: sourceSDL; menuText: "SDL Music";}
        }

        FViewUseCaseSimple { condition: sv.isInEntry
            PropertyChanges { target: l; list_data: null }
        }
    }

    baseBehavior: GenListHandling {}

    triggers: [
        // Example for a menu element trigger. This will only work for FMenuModels.
        FTrgMenuElement { menuElement: sourceAM
            FActScriptCall { onScript: dataPool.currSource = "AM" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceFM
            FActScriptCall { onScript: dataPool.currSource = "FM" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceSat
            FActScriptCall { onScript: dataPool.currSource = "Sirius" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceCD
            FActScriptCall { onScript: dataPool.currSource = "CD" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceBt
            FActScriptCall { onScript: dataPool.currSource = "BT_Audio" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceIpod
            FActScriptCall { onScript: dataPool.currSource = "iPod" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceUSB
            FActScriptCall { onScript: dataPool.currSource = "USB" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceLineIn
            FActScriptCall { onScript: dataPool.currSource = "LineIn" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgMenuElement { menuElement: sourceSDL
            FActScriptCall { onScript: dataPool.currSource = "SDL_Music" }
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
            FActViewShow { view: "RadioEventHandlingPCA" }
        },
        FTrgListModel { id: trgList; model: menuItemData
            FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
        },
        FTrgEntry {
            FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
        },
        FTrgEntryComplete {
            FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
        },
        FTrgExit {
            FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
        },
        FTrgExitComplete {
            FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
        }
    ]
}