diff --git a/plasmoid/contents/images/productivity.png b/plasmoid/contents/images/productivity.png new file mode 100644 index 0000000..48fc24f Binary files /dev/null and b/plasmoid/contents/images/productivity.png differ diff --git a/plasmoid/contents/ui/SkillModel.qml b/plasmoid/contents/ui/SkillModel.qml index 06a02cc..44b24b6 100644 --- a/plasmoid/contents/ui/SkillModel.qml +++ b/plasmoid/contents/ui/SkillModel.qml @@ -1,96 +1,105 @@ /* Copyright 2016 Aditya Mehra This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ import QtQuick 2.9 ListModel { id: skillshintmodel ListElement { Pic: "../images/alarm.png" Skill: "Alarm" CommandList: [ - ListElement { Commands: "Hey Mycroft, Set alarm for %time" }, - ListElement { Commands: "Hey Mycroft, Set alarm for %time on %date" } + ListElement { Commands: "Hey Mycroft, Set an alarm for 9 pm" }, + ListElement { Commands: "Hey Mycroft, Cancel alarm" } ] } ListElement { Pic: "../images/dateandtime.png" Skill: "Date & Time" CommandList: [ ListElement { Commands: "Hey Mycroft, What is the current time" }, - ListElement { Commands: "Hey Mycroft, Current date in London" } + ListElement { Commands: "Hey Mycroft, What is the date today" } ] } ListElement { Pic: "../images/desktop.png" Skill: "Desktop" CommandList: [ - ListElement { Commands: "Hey Mycroft, Open Firefox"}, - ListElement { Commands: "Hey Mycroft, Open Konsole"} + ListElement { Commands: "Hey Mycroft, Open firefox"}, + ListElement { Commands: "Hey Mycroft, Open konsole"} ] } ListElement { Pic: "../images/joke.png" Skill: "Joke" CommandList: [ ListElement {Commands: "Hey Mycroft, Tell me a joke"}, - ListElement {Commands: "Hey Mycroft, Meaning of life"} + ListElement {Commands: "Hey Mycroft, Sing for me"} ] } ListElement { Pic: "../images/spell.png" Skill: "Spell" CommandList: [ - ListElement {Commands: "Hey Mycroft, Spell Hello"}, - ListElement {Commands: "Hey Mycroft, Spell Mycroft"} + ListElement {Commands: "Hey Mycroft, Spell hello"}, + ListElement {Commands: "Hey Mycroft, Spell mycroft"} + ] + } + + ListElement { + Pic: "../images/productivity.png" + Skill: "Productivity" + CommandList: [ + ListElement {Commands: "Hey Mycroft, What is the stock price of nasdaq"}, + ListElement {Commands: "Hey Mycroft, What is the current price of oil"} ] } ListElement { Pic: "../images/wikip.png" Skill: "WiKi" CommandList: [ - ListElement {Commands: "Hey Mycroft, Wiki the Moon"}, - ListElement {Commands: "Hey Mycroft, Define Relativity"} + ListElement {Commands: "Hey Mycroft, What is the distance to the moon"}, + ListElement {Commands: "Hey Mycroft, What is relativity"} ] } ListElement { Pic: "../images/wolfram.png" Skill: "Wolfram Alpha" CommandList: [ - ListElement {Commands: "Hey Mycroft, Calculate the Pi"}, + ListElement {Commands: "Hey Mycroft, What is PI to 10 digits"}, ListElement {Commands: "Hey Mycroft, What is 2+2"} ] } ListElement { Pic: "../images/weather.png" Skill: "Weather" CommandList: [ ListElement {Commands: "Hey Mycroft, What is the current weather"}, ListElement {Commands: "Hey Mycroft, Current weather in Tokyo"} ] } } diff --git a/plasmoid/contents/ui/SkillView.qml b/plasmoid/contents/ui/SkillView.qml index 4cb4f3c..cba2ef8 100644 --- a/plasmoid/contents/ui/SkillView.qml +++ b/plasmoid/contents/ui/SkillView.qml @@ -1,115 +1,181 @@ /* Copyright 2016 Aditya Mehra This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ import QtQuick 2.9 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.2 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.private.mycroftplasmoid 1.0 as PlasmaLa Rectangle { id: tipscontent Layout.fillWidth: true; anchors { left: parent.left; leftMargin: 0.5; right: parent.right } height: units.gridUnit * 5 border.width: 1 border.color: Qt.darker(theme.linkColor, 1.2) color: Qt.darker(theme.backgroundColor, 1.2) Image { id: innerskImg source: Pic width: units.gridUnit * 1.2 height: units.gridUnit * 1.2 anchors.left: parent.left anchors.leftMargin: units.gridUnit * 0.25 anchors.verticalCenter: parent.verticalCenter } PlasmaCore.SvgItem { anchors { left: innerskImg.right leftMargin: 4 top: parent.top topMargin: 0 bottom: parent.bottom bottomMargin: 0 } width: lineskillpgSvg.elementSize("vertical-line").width z: 110 elementId: "vertical-line" svg: PlasmaCore.Svg { id: lineskillpgSvg; imagePath: "widgets/line" } } Item { id: skilltipsinner anchors.left: innerskImg.right anchors.leftMargin: 10 anchors.right: parent.right //color: theme.backgroundColor anchors.top: tipscontent.top anchors.bottom: parent.bottom PlasmaComponents.Label { id: innerskllname anchors.top: parent.top anchors.topMargin: 2 anchors.left: parent.left anchors.right: parent.right wrapMode: Text.WordWrap; font.bold: true; text: i18n(Skill) } Rectangle { id: sepratrln1 height: 1 anchors.top: innerskllname.bottom anchors.topMargin: 2 anchors.bottomMargin: 2 anchors.left: parent.left anchors.right: parent.right color: Qt.darker(theme.linkColor, 1.2) } Column{ id: innerskillscolumn anchors.top: sepratrln1.bottom - PlasmaComponents.Label {wrapMode: Text.WordWrap; width: main.width; text: i18n('Command: ' + CommandList.get(0).Commands)} - PlasmaComponents.Label {wrapMode: Text.WordWrap; width: main.width; text: i18n('Command: ' + CommandList.get(1).Commands)} + PlasmaComponents.Label { + id: cmd0label + wrapMode: Text.WordWrap; + width: main.width; + text: i18n('Command: ' + CommandList.get(0).Commands) + + MouseArea { + anchors.fill: parent + hoverEnabled: true + + onEntered: { + cmd0label.color = theme.linkColor + cmd0label.font.underline = true + cmd0label.font.bold = true + } + onExited: { + cmd0label.color = theme.textColor + cmd0label.font.underline = false + cmd0label.font.bold = false + } + onClicked: { + var genExampleQuery = CommandList.get(0).Commands + var exampleQuery = genExampleQuery.toString().split(",") + var socketmessage = {}; + socketmessage.type = "recognizer_loop:utterance"; + socketmessage.data = {}; + socketmessage.data.utterances = [exampleQuery[1].toLowerCase()]; + socket.sendTextMessage(JSON.stringify(socketmessage)); + tabBar.currentTab = mycroftTab + qinput.text = ""; + } + } + } + + PlasmaComponents.Label { + id: cmd1label + wrapMode: Text.WordWrap; + width: main.width; + text: i18n('Command: ' + CommandList.get(1).Commands) + + MouseArea { + anchors.fill: parent + hoverEnabled: true + + onEntered: { + cmd1label.color = theme.linkColor + cmd1label.font.underline = true + cmd1label.font.bold = true + } + onExited: { + cmd1label.color = theme.textColor + cmd1label.font.underline = false + cmd1label.font.bold = false + } + onClicked: { + tabBar.currentTab = mycroftTab + var genExampleQuery = CommandList.get(1).Commands + var exampleQuery = genExampleQuery.toString().split(",") + var socketmessage = {}; + socketmessage.type = "recognizer_loop:utterance"; + socketmessage.data = {}; + socketmessage.data.utterances = [exampleQuery[1].toLowerCase()]; + socket.sendTextMessage(JSON.stringify(socketmessage)); + tabBar.currentTab = mycroftTab + qinput.text = ""; + } + } + } } } }