Changeset View
Changeset View
Standalone View
Standalone View
plasmoid/contents/ui/main.qml
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 36 | Item { | |||
---|---|---|---|---|---|
69 | property alias autoCompModel: completionItems | 69 | property alias autoCompModel: completionItems | ||
70 | property alias textInput: qinput | 70 | property alias textInput: qinput | ||
71 | property alias plcLmodel: placesListModel | 71 | property alias plcLmodel: placesListModel | ||
72 | property alias dashLmodel: dashListModel | 72 | property alias dashLmodel: dashListModel | ||
73 | property alias recipeLmodel: recipesListModel | 73 | property alias recipeLmodel: recipesListModel | ||
74 | property alias recipeReadLmodel: recipeReadListModel | 74 | property alias recipeReadLmodel: recipeReadListModel | ||
75 | property bool intentfailure: false | 75 | property bool intentfailure: false | ||
76 | property bool locationUserSelected: false | 76 | property bool locationUserSelected: false | ||
77 | property bool connectCtx: false | ||||
77 | property var geoLat | 78 | property var geoLat | ||
78 | property var geoLong | 79 | property var geoLong | ||
79 | property var globalcountrycode | 80 | property var globalcountrycode | ||
80 | property var weatherMetric: "metric" | 81 | property var weatherMetric: "metric" | ||
81 | 82 | | |||
82 | Connections { | 83 | Connections { | ||
84 | target: plasmoid | ||||
85 | onExpandedChanged: { | ||||
86 | if (plasmoid.expanded) { | ||||
87 | checkDashStatus() | ||||
88 | } | ||||
89 | } | ||||
90 | } | ||||
91 | | ||||
92 | Connections { | ||||
83 | target: main2 | 93 | target: main2 | ||
84 | ignoreUnknownSignals: true | 94 | ignoreUnknownSignals: true | ||
85 | 95 | | |||
86 | onSendShowMycroft: { | 96 | onSendShowMycroft: { | ||
87 | plasmoid.expanded = !plasmoid.expanded | 97 | plasmoid.expanded = !plasmoid.expanded | ||
88 | tabBar.currentTab = mycroftTab | 98 | tabBar.currentTab = mycroftTab | ||
89 | } | 99 | } | ||
90 | onSendShowSkills: { | 100 | onSendShowSkills: { | ||
Show All 13 Lines | |||||
104 | function detectInstallType(){ | 114 | function detectInstallType(){ | ||
105 | if(locationUserSelected == false && PlasmaLa.FileReader.file_exists_local("/usr/bin/mycroft-messagebus")){ | 115 | if(locationUserSelected == false && PlasmaLa.FileReader.file_exists_local("/usr/bin/mycroft-messagebus")){ | ||
106 | settingsTabUnitsOpOne.checked = true | 116 | settingsTabUnitsOpOne.checked = true | ||
107 | coreinstallstartpath = packagemcorestartcmd | 117 | coreinstallstartpath = packagemcorestartcmd | ||
108 | coreinstallstoppath = packagemcorestopcmd | 118 | coreinstallstoppath = packagemcorestopcmd | ||
109 | } | 119 | } | ||
110 | } | 120 | } | ||
111 | 121 | | |||
122 | function checkDashStatus(){ | ||||
123 | if(dashListModel.count == 0){ | ||||
124 | checkConnectionStatus() | ||||
125 | } | ||||
126 | } | ||||
127 | | ||||
128 | function checkConnectionStatus(){ | ||||
129 | var isConnected = PlasmaLa.ConnectionCheck.checkConnection() | ||||
130 | if(!isConnected){ | ||||
131 | if(!connectCtx){ | ||||
132 | var conError = i18n("I am not connected to the 🌐 internet, Please check your network connection") | ||||
yurchor: Is it necessary to use "🌐" between "the" and "internet" in this message? Thanks in advance for… | |||||
Thanks for reviewing this, I wasn't sure if there is general issue on using Unicode symbols in strings and rather a shortcut to not using a icon instead, will fix it. Aiix: Thanks for reviewing this, I wasn't sure if there is general issue on using Unicode symbols in… | |||||
133 | convoLmodel.append({"itemType": "NonVisual", "InputQuery": conError}); | ||||
134 | connectCtx = true | ||||
135 | } | ||||
136 | } | ||||
137 | else { | ||||
138 | geoDataSource.connectedSources = ["location"] | ||||
139 | } | ||||
140 | } | ||||
141 | | ||||
112 | function toggleInputMethod(selection){ | 142 | function toggleInputMethod(selection){ | ||
113 | switch(selection){ | 143 | switch(selection){ | ||
114 | case "KeyboardSetActive": | 144 | case "KeyboardSetActive": | ||
115 | qinput.visible = true | 145 | qinput.visible = true | ||
116 | suggestionbottombox.visible = true | 146 | suggestionbottombox.visible = true | ||
117 | customMicIndicator.visible = false | 147 | customMicIndicator.visible = false | ||
118 | keybindic.color = "green" | 148 | keybindic.color = "green" | ||
119 | break | 149 | break | ||
▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Line(s) | 465 | switch(dashState){ | |||
440 | case "setHide": | 470 | case "setHide": | ||
441 | dashLmodel.clear() | 471 | dashLmodel.clear() | ||
442 | convoLmodel.clear() | 472 | convoLmodel.clear() | ||
443 | break | 473 | break | ||
444 | } | 474 | } | ||
445 | } | 475 | } | ||
446 | 476 | | |||
447 | PlasmaCore.DataSource { | 477 | PlasmaCore.DataSource { | ||
448 | id: dataSource | 478 | id: geoDataSource | ||
449 | dataEngine: "geolocation" | 479 | dataEngine: "geolocation" | ||
450 | connectedSources: ["location"] | 480 | | ||
481 | onSourceAdded: { | ||||
482 | connectSource(source) | ||||
483 | } | ||||
451 | 484 | | |||
452 | onNewData: { | 485 | onNewData: { | ||
486 | convoLmodel.clear() | ||||
453 | if (sourceName == "location"){ | 487 | if (sourceName == "location"){ | ||
454 | geoLat = data.latitude | 488 | geoLat = data.latitude | ||
455 | geoLong = data.longitude | 489 | geoLong = data.longitude | ||
456 | var globalcountry = data.country | 490 | var globalcountry = data.country | ||
457 | globalcountrycode = globalcountry.substring(0, 2) | 491 | globalcountrycode = globalcountry.substring(0, 2) | ||
458 | showDash("setVisible") | 492 | showDash("setVisible") | ||
459 | } | 493 | } | ||
460 | } | 494 | } | ||
▲ Show 20 Lines • Show All 1234 Lines • Show Last 20 Lines |
Is it necessary to use "🌐" between "the" and "internet" in this message? Thanks in advance for your answer.