Changeset View
Changeset View
Standalone View
Standalone View
plasmoid/contents/ui/Suggestions.qml
Show All 37 Lines | 29 | MouseArea { | |||
---|---|---|---|---|---|
38 | 38 | | |||
39 | onExited: { | 39 | onExited: { | ||
40 | suggestionbutton1.color = "#00000000" | 40 | suggestionbutton1.color = "#00000000" | ||
41 | suggestionbutton1.border.color = "grey" | 41 | suggestionbutton1.border.color = "grey" | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | onClicked: { | 44 | onClicked: { | ||
45 | suggst.visible = false | 45 | suggst.visible = false | ||
46 | var componentmsg = Qt.createComponent("MessageBox.qml") | 46 | conversationInputList.append({"InputQuery": suggestiontext1.text}); | ||
47 | var loadmsg = componentmsg.createObject({}) | 47 | inputlistView.positionViewAtEnd(); | ||
48 | for(var sia=0; sia<1; sia++){ | | |||
49 | conversationInputList.insert(sia, loadmsg); | | |||
50 | conversationInputList.get(0).mssg = suggestiontext1.text; | | |||
51 | } | | |||
52 | var socketmessage = {}; | 48 | var socketmessage = {}; | ||
53 | socketmessage.type = "recognizer_loop:utterance"; | 49 | socketmessage.type = "recognizer_loop:utterance"; | ||
54 | socketmessage.data = {}; | 50 | socketmessage.data = {}; | ||
55 | socketmessage.data.utterances = [suggestiontext1.text]; | 51 | socketmessage.data.utterances = [suggestiontext1.text]; | ||
56 | socket.sendTextMessage(JSON.stringify(socketmessage)); | 52 | socket.sendTextMessage(JSON.stringify(socketmessage)); | ||
57 | qinput.text = suggestiontext1.text | 53 | qinput.text = suggestiontext1.text | ||
58 | filtersuggest(); | 54 | filtersuggest(); | ||
59 | qinput.text = "" | 55 | qinput.text = "" | ||
Show All 32 Lines | 78 | MouseArea { | |||
92 | 88 | | |||
93 | onExited: { | 89 | onExited: { | ||
94 | suggestionbutton2.color = "#00000000" | 90 | suggestionbutton2.color = "#00000000" | ||
95 | suggestionbutton2.border.color = "grey" | 91 | suggestionbutton2.border.color = "grey" | ||
96 | } | 92 | } | ||
97 | 93 | | |||
98 | onClicked: { | 94 | onClicked: { | ||
99 | suggst.visible = false | 95 | suggst.visible = false | ||
100 | //conversationInputList.append({author:"Me", recipient:"MyCroft", InputQuery:suggestiontext2.text}) | 96 | conversationInputList.append({"InputQuery": suggestiontext2.text}); | ||
101 | var componentmsg = Qt.createComponent("MessageBox.qml") | 97 | inputlistView.positionViewAtEnd(); | ||
102 | var loadmsg = componentmsg.createObject({}) | | |||
103 | for(var sib=0; sib<1; sib++){ | | |||
104 | conversationInputList.insert(sib, loadmsg); | | |||
105 | conversationInputList.get(0).mssg = suggestiontext2.text; | | |||
106 | } | | |||
107 | var socketmessage = {}; | 98 | var socketmessage = {}; | ||
108 | socketmessage.type = "recognizer_loop:utterance"; | 99 | socketmessage.type = "recognizer_loop:utterance"; | ||
109 | socketmessage.data = {}; | 100 | socketmessage.data = {}; | ||
110 | socketmessage.data.utterances = [suggestiontext2.text]; | 101 | socketmessage.data.utterances = [suggestiontext2.text]; | ||
111 | socket.sendTextMessage(JSON.stringify(socketmessage)); | 102 | socket.sendTextMessage(JSON.stringify(socketmessage)); | ||
112 | qinput.text = suggestiontext1.text | 103 | qinput.text = suggestiontext1.text | ||
113 | filtersuggest(); | 104 | filtersuggest(); | ||
114 | qinput.text = "" | 105 | qinput.text = "" | ||
Show All 31 Lines | 128 | MouseArea { | |||
146 | 137 | | |||
147 | onExited: { | 138 | onExited: { | ||
148 | suggestionbutton3.color = "#00000000" | 139 | suggestionbutton3.color = "#00000000" | ||
149 | suggestionbutton3.border.color = "grey" | 140 | suggestionbutton3.border.color = "grey" | ||
150 | } | 141 | } | ||
151 | 142 | | |||
152 | onClicked: { | 143 | onClicked: { | ||
153 | suggst.visible = false | 144 | suggst.visible = false | ||
154 | //conversationInputList.append({author:"Me", recipient:"MyCroft", InputQuery:suggestiontext3.text}) | 145 | conversationInputList.append({"InputQuery": suggestiontext3.text}); | ||
155 | var componentmsg = Qt.createComponent("MessageBox.qml") | 146 | inputlistView.positionViewAtEnd(); | ||
156 | var loadmsg = componentmsg.createObject({}) | | |||
157 | for(var sic=0; sic<1; sic++){ | | |||
158 | conversationInputList.insert(sic, loadmsg); | | |||
159 | conversationInputList.get(0).mssg = suggestiontext3.text; | | |||
160 | } | | |||
161 | var socketmessage = {}; | 147 | var socketmessage = {}; | ||
162 | socketmessage.type = "recognizer_loop:utterance"; | 148 | socketmessage.type = "recognizer_loop:utterance"; | ||
163 | socketmessage.data = {}; | 149 | socketmessage.data = {}; | ||
164 | socketmessage.data.utterances = [suggestiontext3.text]; | 150 | socketmessage.data.utterances = [suggestiontext3.text]; | ||
165 | socket.sendTextMessage(JSON.stringify(socketmessage)); | 151 | socket.sendTextMessage(JSON.stringify(socketmessage)); | ||
166 | qinput.text = suggestiontext1.text | 152 | qinput.text = suggestiontext1.text | ||
167 | filtersuggest(); | 153 | filtersuggest(); | ||
168 | qinput.text = "" | 154 | qinput.text = "" | ||
Show All 13 Lines |