diff --git a/CMakeLists.txt b/CMakeLists.txt index b1860bc..8887163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,38 +1,38 @@ # Set minimum CMake version (required for CMake 3.0 or later) cmake_minimum_required(VERSION 2.8.12) set(QT_MIN_VERSION "5.9.0") set(KF5_MIN_VERSION "5.0.0") # Use Extra CMake Modules (ECM) for common functionality. # See http://api.kde.org/ecm/manual/ecm.7.html # and http://api.kde.org/ecm/manual/ecm-kde-modules.7.html find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_MODULE_PATH}) set(VERSION 2.1.0) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) # Locate plasma_install_package macro. find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Plasma I18n Notifications ) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Quick Core Qml DBus Network ) add_subdirectory(plugin) add_subdirectory(icons) -plasma_install_package(plasmoid org.kde.phone.mycroftplasmoid) +plasma_install_package(plasmoid org.kde.phone.mycroftplasmoidmobile) install( DIRECTORY mycroft DESTINATION ${SYSCONF_INSTALL_DIR}) diff --git a/plasmoid/Messages.sh b/plasmoid/Messages.sh index ea6d68a..5bb2ca6 100644 --- a/plasmoid/Messages.sh +++ b/plasmoid/Messages.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -$XGETTEXT `find . -name '*.qml'` -o $podir/plasma_applet_org.kde.plasma.mycroftplasmoid.pot +$XGETTEXT `find . -name '*.qml'` -o $podir/plasma_applet_org.kde.plasma.mycroftplasmoidmobile.pot diff --git a/plasmoid/contents/ui/AutocompleteBox.qml b/plasmoid/contents/ui/AutocompleteBox.qml index 424be23..b5a6709 100644 --- a/plasmoid/contents/ui/AutocompleteBox.qml +++ b/plasmoid/contents/ui/AutocompleteBox.qml @@ -1,129 +1,148 @@ +/* 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.7 import QtQuick.Controls 2.2 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents Rectangle { id: container implicitHeight: autoCompListView.implicitHeight implicitWidth: cbwidth color: theme.backgroundColor border.width: 1 border.color: Qt.lighter(theme.backgroundColor, 1.2); property QtObject model: undefined property int count: filterItem.model.count property alias suggestionsModel: filterItem.model property alias filter: filterItem.filter property alias property: filterItem.property property alias navView: autoCompListView signal itemSelected(variant item) function filterMatchesLastSuggestion() { return suggestionsModel.count == 1 && suggestionsModel.get(0).name === filter } visible: filter.length > 0 && suggestionsModel.count > 0 && !filterMatchesLastSuggestion() Logic { id: filterItem sourceModel: container.model } ListView{ id: autoCompListView anchors.fill: parent model: container.suggestionsModel implicitHeight: contentItem.childrenRect.height verticalLayoutDirection: ListView.TopToBottom keyNavigationEnabled: true keyNavigationWraps: true clip: true delegate: Item { id: delegateItem property bool keyboardSelected: autoCompListView.selectedIndex === suggestion.index property bool selected: itemMouseArea.containsMouse property variant suggestion: model height: textComponent.height + units.gridUnit * 2 width: container.width FocusScope{ anchors.fill:parent focus: true Rectangle{ id: autdelRect color: delegateItem.selected ? Qt.darker(theme.textColor, 1.2) : Qt.darker(theme.backgroundColor, 1.2) width: parent.width height: textComponent.height + units.gridUnit * 2 PlasmaCore.IconItem { id : smallIconV source: "text-speak" width: units.gridUnit * 2 height: units.gridUnit * 2 anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: units.gridUnit * 0.35 } PlasmaCore.SvgItem { id: innerDelegateRectDividerLine anchors { left: smallIconV.right leftMargin: units.gridUnit * 0.35 top: parent.top topMargin: 0 bottom: parent.bottom bottomMargin: 0 } width: lineitemdividerSvg.elementSize("vertical-line").width z: 110 elementId: "vertical-line" svg: PlasmaCore.Svg { id: lineitemdividerSvg; imagePath: "widgets/line" } } Text { id: textComponent anchors.left: innerDelegateRectDividerLine.right anchors.leftMargin: units.gridUnit * 0.35 color: delegateItem.selected ? Qt.darker(theme.backgroundColor, 1.2) : Qt.darker(theme.textColor, 1.2) text: model.name; width: parent.width - 4 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter } MouseArea { id: itemMouseArea anchors.fill: parent hoverEnabled: true onClicked: container.itemSelected(delegateItem.suggestion) } PlasmaCore.SvgItem { anchors { left: parent.left right: parent.right bottom: parent.bottom } width: 1 height: horlineAutoCSvg.elementSize("horizontal-line").height elementId: "horizontal-line" z: 110 svg: PlasmaCore.Svg { id: horlineAutoCSvg; imagePath: "widgets/line" } } } } } ScrollBar.vertical: ScrollBar { } } } diff --git a/plasmoid/contents/ui/CustomMicIndicator.qml b/plasmoid/contents/ui/CustomMicIndicator.qml index 9dd8736..9ab93cf 100644 --- a/plasmoid/contents/ui/CustomMicIndicator.qml +++ b/plasmoid/contents/ui/CustomMicIndicator.qml @@ -1,284 +1,304 @@ +/* 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 org.kde.plasma.components 2.0 as PlasmaComponents import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 Item { id: bgrectA function aniRunWorking(){ animtimer.start() topCircle.inneranimtopworking.start() maskItem.inneranimworking.start() } function aniRunTransition(){ animtimer.start() topCircle.inneranimtoptransition.start() maskItem.inneranimtransition.start() } function aniRunHappy (){ animtimer.start() topCircle.inneranimtophappy.start() maskItem.inneranimhappy.start() } function aniRunError(){ animtimer.start() topCircle.inneranimtopsad.start() maskItem.inneranimsad.start() } Item{ id: customIndicatorBusy anchors.fill: parent visible: true RotationAnimator { target:topCircle id: antoWorking from: 0; to: 360; duration: 500 running: false alwaysRunToEnd: true } RotationAnimator { target:topCircle id: antoTransition from: 0; to: 0; duration: 500 running: false alwaysRunToEnd: true } RotationAnimator { target:topCircle id: antoSad from: 0; to: 180; duration: 500 direction: RotationAnimator.Counterclockwise running: false alwaysRunToEnd: true; } RotationAnimator { target:topCircle id: antoHappy from: 0; to: 360; duration: 500 running: false alwaysRunToEnd: true; } SequentialAnimation { id: seqmaskanimworking running: false loops: Animation.Infinite PropertyAction { target: myRot; property: "origin.x"; value: units.gridUnit * 0.78 } PropertyAction { target: myRot; property: "origin.y"; value: units.gridUnit * 0.78 } NumberAnimation { target: myRot; property: "angle"; from:0; to: -360; duration: 500} onStopped: { myRot.angle = 0 } } SequentialAnimation { id: seqmaskanimtransition running: false loops: Animation.Infinite PropertyAction { target: myRot; property: "origin.x"; value: units.gridUnit * 0.78 } PropertyAction { target: myRot; property: "origin.y"; value: units.gridUnit * 0.78 } NumberAnimation { target: myRot; property: "angle"; from: 0; to: 0; duration: 500} } SequentialAnimation { id: colrmeonAnsHappy ParallelAnimation { PropertyAnimation { target: innerCircleSurround; property: "color"; from: "#ffffff"; to: "lightgreen"; duration: 500; } PropertyAnimation { target: circ; property: "color"; from: "#ffffff"; to: "lightgreen"; duration: 500; } PropertyAnimation { target: topCircle.circle; property: "color"; from: "#ffffff"; to: "lightgreen"; duration: 500; } } ParallelAnimation { PropertyAnimation { target: innerCircleSurround; property: "color"; from: "lightgreen"; to: "#fff"; duration: 500; } PropertyAnimation { target: circ; property: "color"; from: "lightgreen"; to: "#fff"; duration: 500; } PropertyAnimation { target: topCircle.circle; property: "color"; from: "lightgreen"; to: "#fff"; duration: 500; } } } SequentialAnimation { id: colrmeonAnsSad ParallelAnimation { PropertyAnimation { target: innerCircleSurround; property: "color"; from: "#ffffff"; to: "red"; duration: 500; } PropertyAnimation { target: circ; property: "color"; from: "#ffffff"; to: "red"; duration: 1000; } PropertyAnimation { target: topCircle.circle; property: "color"; from: "#ffffff"; to: "red"; duration: 500; } } ParallelAnimation { PropertyAnimation { target: innerCircleSurround; property: "color"; from: "red"; to: "#fff"; duration: 500; } PropertyAnimation { target: circ; property: "color"; from: "red"; to: "#fff"; duration: 1000; } PropertyAnimation { target: topCircle.circle; property: "color"; from: "red"; to: "#fff"; duration: 500; } } } SequentialAnimation { id: seqmaskanimhappy running: false loops: Animation.Infinite PropertyAction { target: myRot; property: "origin.x"; value: units.gridUnit * 0.74 } PropertyAction { target: myRot; property: "origin.y"; value: units.gridUnit * 0.76 } NumberAnimation { target: myRot; property: "angle"; from:0; to: -360; duration: 500 } onStopped: { myRot.angle = -90 transtimer.start() } onStarted: { colrmeonAnsHappy.running = true } } SequentialAnimation { id: seqmaskanimsad running: false loops: Animation.Infinite PropertyAction { target: myRot; property: "origin.x"; value: units.gridUnit * 0.76 } PropertyAction { target: myRot; property: "origin.y"; value: units.gridUnit * 0.76 } NumberAnimation { target: myRot; property: "angle"; from:0; to: 360; duration: 500} onStopped: { myRot.angle = 90 transtimer.start() } onStarted: { colrmeonAnsSad.running = true } } Item{ anchors.fill: parent Rectangle { id: topCircle anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter color: "#00000000" radius: 1 opacity: 1 implicitWidth: units.gridUnit * 3 implicitHeight: units.gridUnit * 3 property alias inneranimtopworking: antoWorking property alias inneranimtophappy: antoHappy property alias inneranimtopsad: antoSad property alias inneranimtoptransition: antoTransition property alias circle: innerSqr Rectangle{ id: innerSqr anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter color: "#fff" radius: 100 width: units.gridUnit * 0.3 height: units.gridUnit * 0.3 } } Rectangle { id: innerCircleSurround anchors.centerIn: parent color: "#ffffff" radius: 100 implicitWidth: units.gridUnit * 2 implicitHeight: units.gridUnit * 2 opacity: 1 } Rectangle { id: innerCircleSurroundOutterRing anchors.centerIn: parent color: theme.linkColor radius: 100 implicitWidth: units.gridUnit * 1.833 implicitHeight: units.gridUnit * 1.833 opacity: 1 } Rectangle { id: maskItem anchors.verticalCenter: parent.verticalCenter anchors.left: innerCircleSurroundOutterRing.left anchors.leftMargin: units.gridUnit * 0.2 color: "#00000000" radius: 1000 implicitWidth: units.gridUnit * 0.833 implicitHeight: units.gridUnit * 1.6 clip: true property alias cc: semicirc property alias inneranimworking: seqmaskanimworking property alias inneranimtransition: seqmaskanimtransition property alias inneranimhappy: seqmaskanimhappy property alias inneranimsad: seqmaskanimsad opacity: 1 transform: Rotation { id: myRot } Item { id: semicirc anchors.left: parent.left anchors.top: parent.top anchors.bottom: parent.bottom width: units.gridUnit * 3.133 clip:true opacity: 1 Rectangle{ id: circ width: parent.width height: parent.height radius:100 color: "white" } } } Timer { id: animtimer interval: 500; repeat: false onTriggered: { maskItem.inneranimworking.stop() maskItem.inneranimtransition.stop() maskItem.inneranimhappy.stop() maskItem.inneranimsad.stop() topCircle.inneranimtopworking.stop() topCircle.inneranimtoptransition.stop() topCircle.inneranimtophappy.stop() topCircle.inneranimtopsad.stop() } } Timer { id: transtimer interval: 500; repeat: false onTriggered: { myRot.angle = 0 antoTransition.running = true } } } } } diff --git a/plasmoid/contents/ui/FallbackWebSearchType.qml b/plasmoid/contents/ui/FallbackWebSearchType.qml index 2810472..8e6a416 100644 --- a/plasmoid/contents/ui/FallbackWebSearchType.qml +++ b/plasmoid/contents/ui/FallbackWebSearchType.qml @@ -1,85 +1,85 @@ /* 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 QtQml.Models 2.2 import QtQuick.Controls 2.2 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 +import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa import QtWebKit 3.0 import QtWebKit.experimental 1.0 Column { spacing: 6 anchors.right: parent.right Row { id: messageRow spacing: 6 Item { id: messageRect width: cbwidth height: newolfFlick.height Flickable { id: newolfFlick width: messageRect.width height: units.gridUnit * 10 contentHeight: wikiview.height clip: true WebView { id: wikiview height: units.gridUnit * 20 width: parent.width url: InputQuery experimental.preferredMinimumContentsWidth: cbwidth experimental.useDefaultContentItemSize: false experimental.transparentBackground: true experimental.userStyleSheets: "../code/fallback.css" opacity: 0 onLoadingChanged: { switch (loadRequest.status) { case WebView.LoadSucceededStatus: opacity = 1 return case WebView.LoadStartedStatus: break case WebView.LoadStoppedStatus: break case WebView.LoadFailedStatus: break } opacity = 0 } } ScrollIndicator.vertical: ScrollIndicator { } } } } } diff --git a/plasmoid/contents/ui/LoaderType.qml b/plasmoid/contents/ui/LoaderType.qml index 0a48b26..cb926b4 100644 --- a/plasmoid/contents/ui/LoaderType.qml +++ b/plasmoid/contents/ui/LoaderType.qml @@ -1,81 +1,81 @@ /* 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 QtQml.Models 2.2 import QtQuick.Controls 2.2 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 +import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa Column { spacing: 6 anchors.right: parent.right property string filename: "file:///" + model.InputQuery property int getHeight Component.onCompleted: { var mObj = loaderComp.createObject(loaderView, {}) } Row { id: messageRow spacing: 6 Rectangle { id: messageRect width: cbwidth radius: 2 height: newikiFlick.height color: theme.backgroundColor Flickable { id: newikiFlick width: messageRect.width height: getHeight Item { id: loaderView anchors.fill: parent } Component { id: loaderComp Loader { id: loaderScreen anchors.left: parent.left anchors.right: parent.right height: Math.max(item ? item.implicitHeight : 0, units.gridUnit * 10) source: filename function reload(){ source = filename + "?t=" + Date.now() } Component.onCompleted: { loaderScreen.reload(); getHeight = height } } } } } } } diff --git a/plasmoid/contents/ui/Logic.qml b/plasmoid/contents/ui/Logic.qml index 128184e..a628ef1 100644 --- a/plasmoid/contents/ui/Logic.qml +++ b/plasmoid/contents/ui/Logic.qml @@ -1,59 +1,78 @@ +/* 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.7 Item { id: component property alias model: filterModel property QtObject sourceModel: undefined property string filter: "" property string property: "" Connections { onFilterChanged: invalidateFilter() onPropertyChanged: invalidateFilter() onSourceModelChanged: invalidateFilter() } Component.onCompleted: invalidateFilter() ListModel { id: filterModel } function invalidateFilter() { if (sourceModel === undefined) return; filterModel.clear(); if (!isFilteringPropertyOk()) return var length = sourceModel.count for (var i = 0; i < length; ++i) { var item = sourceModel.get(i); if (isAcceptedItem(item)) { filterModel.append(item) } } } function isAcceptedItem(item) { if (item[this.property] === undefined) return false if (item[this.property].match(this.filter) === null) { return false } return true } function isFilteringPropertyOk() { if(this.property === undefined || this.property === "") { return false } return true } } diff --git a/plasmoid/contents/ui/MainPage.qml b/plasmoid/contents/ui/MainPage.qml index ef85fbc..938cec0 100644 --- a/plasmoid/contents/ui/MainPage.qml +++ b/plasmoid/contents/ui/MainPage.qml @@ -1,1773 +1,1773 @@ /* 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 QtQml.Models 2.2 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import Qt.WebSockets 1.0 import Qt.labs.settings 1.0 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.components 3.0 as PlasmaComponents3 import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.private.mycroftplasmoid 1.0 as PlasmaLa +import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa import org.kde.plasma.private.volume 0.1 import org.kde.kirigami 2.1 as Kirigami import QtGraphicalEffects 1.0 Item { id: main anchors.fill: parent z: 999 Component.onCompleted: { mycroftStatusCheckSocket.active = true refreshAllSkills(); } property var skillList: [] property alias cbwidth: rectangle2.width property alias cbheight: rectangle2.height property var dwrpaddedwidth: main.width + units.gridUnit * 1 property var cbdrawercontentheight: parent.height + units.gridUnit * 0.5 - rectanglebottombar.height property string defaultmcorestartpath: "/usr/share/plasma/plasmoids/org.kde.phone.mycroftplasmoid/contents/code/startservice.sh" property string defaultmcorestoppath: "/usr/share/plasma/plasmoids/org.kde.phone.mycroftplasmoid/contents/code/stopservice.sh" property string packagemcorestartcmd: "/usr/share/plasma/plasmoids/org.kde.phone.mycroftplasmoid/contents/code/pkgstartservice.sh" property string packagemcorestopcmd: "/usr/share/plasma/plasmoids/org.kde.phone.mycroftplasmoid/contents/code/pkgstopservice.sh" property string customlocstartpath: startsrvcustom.text property string customlocstoppath: stopsrvcustom.text property string customloc: " " property string coreinstallstartpath: defaultmcorestartpath property string coreinstallstoppath: defaultmcorestoppath property variant searchIndex: [] property variant results: [] property var smintent property var dataContent property alias autoCompModel: completionItems property alias textInput: qinput property alias plcLmodel: placesListModel property alias dashLmodel: dashListModel property alias recipeLmodel: recipesListModel property alias recipeReadLmodel: recipeReadListModel property alias stackLmodel: stackexListModel property alias bookLmodel: bookListModel property alias wikiLmodel: wikiListModel property alias yelpLmodel: yelpListModel property bool intentfailure: false property bool locationUserSelected: false property bool connectCtx: false property bool micIsMuted property var geoLat property var geoLong property var globalcountrycode property var weatherMetric: "metric" property date currentDate: new Date() function checkDashStatus(){ if(dashListModel.count == 0){ checkConnectionStatus() } } function checkConnectionStatus(){ var isConnected = PlasmaLa.ConnectionCheck.checkConnection() if(!isConnected){ if(!connectCtx){ var conError = i18n("I am not connected to the internet, Please check your network connection") convoLmodel.append({"itemType": "NonVisual", "InputQuery": conError}); connectCtx = true } } else { geoDataSource.connectedSources = ["location"] } } function toggleInputMethod(selection){ switch(selection){ case "KeyboardSetActive": expandbartxtinput.visible = true keybindic.color = "green" break case "KeyboardSetDisable": expandbartxtinput.visible = false keybindic.color = theme.textColor break } } function retryConn(){ socket.active = true if (socket.active = false){ console.log(socket.errorString) } } function filterSpeak(msg){ convoLmodel.append({ "itemType": "NonVisual", "InputQuery": msg }) inputlistView.positionViewAtEnd(); } function filterincoming(intent, metadata) { var intentVisualArray = ['CurrentWeatherIntent']; var itemType var filterintentname = intent.split(':'); var intentname = filterintentname[1]; if (intentVisualArray.indexOf(intentname) !== -1) { switch (intentname){ case "CurrentWeatherIntent": itemType = "CurrentWeather" break; } convoLmodel.append({"itemType": itemType, "itemData": metadata}) } else { convoLmodel.append({"itemType": "WebViewType", "InputQuery": metadata.url}) } } function filtervisualObj(metadata){ convoLmodel.append({"itemType": "LoaderType", "InputQuery": metadata.url}) inputlistView.positionViewAtEnd(); } function isBottomEdge() { return plasmoid.location == PlasmaCore.Types.BottomEdge; } function clearList() { inputlistView.clear() } function muteMicrophone() { if (!sourceModel.defaultSource) { return; } var toMute = !sourceModel.defaultSource.muted; sourceModel.defaultSource.muted = toMute; } function refreshAllSkills(){ getSkills(); msmskillsModel.reload(); } function getAllSkills(){ if(skillList.length <= 0){ getSkills(); } return skillList; } function getSkillByName(skillName){ var tempSN=[]; for(var i = 0; i Your Mycroft Core Installation Path") } PlasmaComponents.ButtonColumn { id: radiobuttonColoumn anchors.top: settingsTabUnits.bottom anchors.topMargin: 5 PlasmaComponents.RadioButton { id: settingsTabUnitsOpZero exclusiveGroup: installPathGroup text: i18n("Default Path") checked: true onCheckedChanged: { locationUserSelected = true if (settingsTabUnitsOpZero.checked === true && coreinstallstartpath === packagemcorestartcmd) { coreinstallstartpath = defaultmcorestartpath; } else if (settingsTabUnitsOpZero.checked === true && coreinstallstartpath === customlocstartpath) { coreinstallstartpath = defaultmcorestartpath; } if (settingsTabUnitsOpZero.checked === true && coreinstallstoppath === packagemcorestopcmd) { coreinstallstoppath = defaultmcorestoppath; } else if (settingsTabUnitsOpZero.checked === true && coreinstallstoppath === customlocstoppath) { coreinstallstoppath = defaultmcorestoppath; } } } PlasmaComponents.RadioButton { id: settingsTabUnitsOpOne exclusiveGroup: installPathGroup text: i18n("Installed Using Mycroft Package") checked: false onCheckedChanged: { if (settingsTabUnitsOpOne.checked === true && coreinstallstartpath === defaultmcorestartpath) { coreinstallstartpath = packagemcorestartcmd; } else if (settingsTabUnitsOpOne.checked === true && coreinstallstartpath === customlocstartpath) { coreinstallstartpath = packagemcorestartcmd; } if (settingsTabUnitsOpOne.checked === true && coreinstallstoppath === defaultmcorestoppath) { coreinstallstoppath = packagemcorestopcmd; } else if (settingsTabUnitsOpOne.checked === true && coreinstallstoppath === customlocstoppath) { coreinstallstoppath = packagemcorestopcmd; } } } PlasmaComponents.RadioButton { id: settingsTabUnitsOpTwo exclusiveGroup: installPathGroup text: i18n("Location of Mycroft-Core Directory") checked: false onCheckedChanged: { locationUserSelected = true if (settingsTabUnitsOpTwo.checked === true && coreinstallstartpath === defaultmcorestartpath) { coreinstallstartpath = customlocstartpath; } else if (settingsTabUnitsOpTwo.checked === true && coreinstallstartpath === packagemcorestartcmd) { coreinstallstartpath = customlocstartpath; } if (settingsTabUnitsOpTwo.checked === true && coreinstallstoppath === defaultmcorestoppath) { coreinstallstoppath = customlocstoppath; } else if (settingsTabUnitsOpTwo.checked === true && coreinstallstoppath === packagemcorestopcmd) { coreinstallstoppath = customlocstoppath; } } } } PlasmaComponents.TextField { id: settingsTabUnitsOpThree width: settingscontent.width / 1.1 anchors.top: radiobuttonColoumn.bottom anchors.topMargin: 10 placeholderText: i18n("/mycroft-core/") onTextChanged: { var cstloc = settingsTabUnitsOpThree.text customloc = cstloc } } PlasmaComponents.Button { id: acceptcustomPath anchors.left: settingsTabUnitsOpThree.right anchors.verticalCenter: settingsTabUnitsOpThree.verticalCenter anchors.right: parent.right iconSource: "checkbox" onClicked: { var cstlocl = customloc var ctstart = cstlocl + "start-mycroft.sh all" var ctstop = cstlocl + "stop-mycroft.sh" startsrvcustom.text = ctstart stopsrvcustom.text = ctstop console.log(startsrvcustom.text) } } PlasmaComponents.TextField { id: settingsTabUnitsWSpath width: settingscontent.width / 1.1 anchors.top: settingsTabUnitsOpThree.bottom anchors.topMargin: 10 placeholderText: i18n("ws://0.0.0.0:8181/core") text: i18n("ws://0.0.0.0:8181/core") } PlasmaComponents.Button { id: acceptcustomWSPath anchors.left: settingsTabUnitsWSpath.right anchors.verticalCenter: settingsTabUnitsWSpath.verticalCenter anchors.right: parent.right iconSource: "checkbox" onClicked: { innerset.wsurl = settingsTabUnitsWSpath.text } } PlasmaComponents.TextField { id: settingsTabUnitsIRCmd width: settingscontent.width / 1.1 anchors.top: settingsTabUnitsWSpath.bottom anchors.topMargin: 10 placeholderText: i18n("Your Custom Image Recognition Skill Voc Keywords") text: i18n("search image url") } PlasmaComponents.Button { id: acceptcustomIRCmd anchors.left: settingsTabUnitsIRCmd.right anchors.verticalCenter: settingsTabUnitsIRCmd.verticalCenter anchors.right: parent.right iconSource: "checkbox" } PlasmaComponents.TextField { id: settingsTabUnitsOCRCmd width: settingscontent.width / 1.1 anchors.top: settingsTabUnitsIRCmd.bottom anchors.topMargin: 10 placeholderText: i18n("Your Custom Image OCR Skill Voc Keywords") text: i18n("ocr image url") } PlasmaComponents.Button { id: acceptcustomOCRCmd anchors.left: settingsTabUnitsOCRCmd.right anchors.verticalCenter: settingsTabUnitsOCRCmd.verticalCenter anchors.right: parent.right iconSource: "checkbox" } PlasmaComponents.Switch { id: notificationswitch anchors.top: settingsTabUnitsOCRCmd.bottom anchors.topMargin: 10 text: i18n("Enable Notifications") checked: true } PlasmaComponents.Switch { id: wolframfallbackswitch anchors.top: notificationswitch.bottom anchors.topMargin: 10 text: i18n("Enable Fallback To Wolfram Alpha Web-Search") checked: true } PlasmaComponents.Label { id: wolframkeylabel text: i18n("Wolfram Alpha API:") anchors.top: wolframfallbackswitch.bottom anchors.topMargin: 10 } PlasmaComponents.TextField { id: wolframapikeyfld anchors.right: parent.right anchors.rightMargin: units.gridUnit * 0.25 anchors.left: wolframkeylabel.right anchors.leftMargin: units.gridUnit * 0.25 anchors.verticalCenter: wolframkeylabel.verticalCenter text: i18n("RJVUY3-T6YLWQVXRR") } PlasmaExtras.Paragraph { id: settingsTabTF2 anchors.top: wolframapikeyfld.bottom anchors.topMargin: 15 text: i18n("Please Note: Default path is set to /home/$USER/mycroft-core/. Change the above settings to match your installation") } PlasmaComponents.Label { id: startsrvcustom visible: false } PlasmaComponents.Label { id: stopsrvcustom visible: false } } } Item { id: dashsettingscontent Layout.fillWidth: true; Layout.fillHeight: true; anchors.top: settingstabBar.bottom anchors.topMargin: units.gridUnit * 0.50 anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom visible: settingstabBar.currentTab == dashSettingsTab; Flickable { id: dashsettingFlick anchors.fill: parent; contentWidth: mycroftSettingsColumn.width contentHeight: units.gridUnit * 22 clip: true; Column { spacing: 6 PlasmaComponents.Switch { id: dashswitch text: i18n("Enable / Disable Dashboard") checked: true onCheckedChanged: { if(dashswitch.checked){ tabBar.currentTab = mycroftTab disclaimbox.visible = false showDash("setVisible") } else if(!dashswitch.checked){ convoLmodel.clear() if(!socket.active){ disclaimbox.visible = true } } } } PlasmaComponents.Label { id: dashSettingsLabel1 text: i18n("Card Settings:") font.bold: true; } PlasmaComponents.Switch { id: disclaimercardswitch text: i18n("Enable / Disable Disclaimer Card") checked: true } PlasmaComponents.Switch { id: newscardswitch text: i18n("Enable / Disable News Card") checked: true } PlasmaComponents.Switch { id: cryptocardswitch text: i18n("Enable / Disable Cryptocurrency Card") checked: false } Row { spacing: 2 PlasmaComponents.Label{ id: cryptoCurrencySelected text: "Selected CryptoCurrency:" } PlasmaComponents3.ComboBox { id: cryptoSelectedBox textRole: "cryptoname" displayText: currentText model: CrypCurModel{} property string cryptInfo: cryptoSelectedBox.model.get(currentIndex).value } } PlasmaComponents.Label{ id: localCurrencySelected text: "Display Currencies:" } PlasmaComponents3.ComboBox { id: cryptoSelectCur1 textRole: "currencyname" displayText: currentText model: CurModel{} property string cur1Info: cryptoSelectCur1.model.get(currentIndex).value } PlasmaComponents3.ComboBox { id: cryptoSelectCur2 textRole: "currencyname" displayText: currentText model: CurModel{} property string cur2Info: cryptoSelectCur2.model.get(currentIndex).value } PlasmaComponents3.ComboBox { id: cryptoSelectCur3 textRole: "currencyname" displayText: currentText model: CurModel{} property string cur3Info: cryptoSelectCur3.model.get(currentIndex).value } Row { spacing: 2 PlasmaComponents.Label { id: newsApiKeyLabelFld text: "NewsApi App_Key:" } PlasmaComponents.TextField{ id: newsApiKeyTextFld width: units.gridUnit * 12 text: "a1091945307b434493258f3dd6f36698" } } PlasmaComponents.Switch { id: weathercardswitch text: i18n("Enable / Disable Weather Card") checked: true } Row { spacing: 2 PlasmaComponents.Label { id: owmApiKeyLabelFld text: "Open Weather Map App_ID:" } PlasmaComponents.TextField{ id: owmApiKeyTextFld width: units.gridUnit * 12 text: "7af5277aee7a659fc98322c4517d3df7" } } Row{ id: weatherCardMetricsRowList spacing: 2 PlasmaComponents.Button { id: owmApiKeyMetricCel text: i18n("Celcius") onClicked: { weatherMetric = "metric" updateCardData() } } PlasmaComponents.Button{ id: owmApiKeyMetricFar text: i18n("Fahrenheit") onClicked: { weatherMetric = "imperial" updateCardData() } } } } } } } ColumnLayout { id: mycroftMsmColumn visible: tabBar.currentTab == mycroftMSMinstTab; anchors.top: root.top anchors.left: root.left anchors.leftMargin: units.gridUnit * 0.25 anchors.right: root.right anchors.bottom: root.bottom Item { id: msmtabtopbar width: parent.width anchors.left: parent.left anchors.right: parent.right height: units.gridUnit * 2 PlasmaComponents.TextField { id: msmsearchfld anchors.left: parent.left anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: getskillsbx.left placeholderText: i18n("Search Skills") clearButtonShown: true onTextChanged: { if(text.length > 0 ) { msmskillsModel.applyFilter(text.toLowerCase()); } else { msmskillsModel.reload(); } } } PlasmaComponents.ToolButton { id: getskillsbx anchors.right: parent.right anchors.top: parent.top anchors.bottom: parent.bottom iconSource: "view-refresh" tooltip: i18n("Refresh List") flat: true width: Math.round(units.gridUnit * 2) height: width z: 102 onClicked: { msmskillsModel.clear(); refreshAllSkills(); } } } ListModel { id: msmskillsModel Component.onCompleted: { reload(); //console.log('Completing too early?'); } function reload() { var skList = getAllSkills(); msmskillsModel.clear(); for( var i=0; i < skList.length ; ++i ) { msmskillsModel.append(skList[i]); } } function applyFilter(skName) { var skList = getSkillByName(skName); msmskillsModel.clear(); for( var i=0; i < skList.length ; ++i ) { msmskillsModel.append(skList[i]); } } } ListView { id: msmlistView anchors.top: msmtabtopbar.bottom anchors.topMargin: 5 anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom model: msmskillsModel delegate: MsmView{} spacing: 4 focus: false interactive: true clip: true; } } } SourceModel { id: sourceModel } PlasmaCore.SvgItem { anchors { left: main.left right: main.right bottom: root.bottom } width: 1 height: horlineSvg.elementSize("horizontal-line").height elementId: "horizontal-line" z: 110 svg: PlasmaCore.Svg { id: horlineSvg; imagePath: "widgets/line" } } Item { id: expandbartxtinput height: units.gridUnit * 3.5 anchors.bottom: rectanglebottombar.top anchors.left: parent.left anchors.right: parent.right z: 1001 visible: false Rectangle { id: topBarSecondary anchors.fill: parent color: theme.backgroundColor height: units.gridUnit * 3.5 z: 101 ListModel { id: completionItems } PlasmaComponents.TextField { id: qinput anchors.fill: parent placeholderText: i18n("Enter Query or Say 'Hey Mycroft'") clearButtonShown: true onAccepted: { var doesExist = autoAppend(autoCompModel, function(item) { return item.name === qinput.text }, qinput.text) var evaluateExist = doesExist if(evaluateExist === null){ autoCompModel.append({"name": qinput.text}); } suggst.visible = true; var socketmessage = {}; socketmessage.type = "recognizer_loop:utterance"; socketmessage.data = {}; socketmessage.data.utterances = [qinput.text]; socket.sendTextMessage(JSON.stringify(socketmessage)); qinput.text = ""; } onTextChanged: { //var terms = getTermsForSearchString(qinput.text); evalAutoLogic(); } } AutocompleteBox { id: suggestionsBox model: completionItems width: parent.width anchors.bottom: qinput.top anchors.left: parent.left anchors.right: parent.right filter: textInput.text property: "name" onItemSelected: complete(item) function complete(item) { if (item !== undefined) textInput.text = item.name } } } } Item { id: rectanglebottombar height: units.gridUnit * 3.5 anchors.left: main.left anchors.right: main.right anchors.bottom: main.bottom z: 110 Rectangle { id: suggestionbottombox anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right anchors.left: parent.left color: theme.backgroundColor Rectangle { id: keyboardactivaterect color: theme.backgroundColor border.width: 1 border.color: Qt.lighter(theme.backgroundColor, 1.2) width: units.gridUnit * 2 height: qinput.height anchors.top: parent.top anchors.bottom: parent.bottom anchors.left: parent.left PlasmaCore.IconItem { id: keybdImg source: "input-keyboard" anchors.centerIn: parent width: units.gridUnit * 2 height: units.gridUnit * 2 } Rectangle { id: keybindic anchors.top: keybdImg.bottom anchors.topMargin: 2 anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: 8 anchors.rightMargin: 8 height: 2 color: theme.textColor } MouseArea{ anchors.fill: parent hoverEnabled: true onEntered: {} onExited: {} onClicked: { if(expandbartxtinput.visible === false){ toggleInputMethod("KeyboardSetActive") } else if(expandbartxtinput.visible === true){ toggleInputMethod("KeyboardSetDisable") } } } } Suggestions { id: suggst visible: true; anchors.left: keyboardactivaterect.right anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: voiceinputsettingrect.left } Rectangle { id: voiceinputsettingrect color: theme.backgroundColor border.width: 1 border.color: Qt.lighter(theme.backgroundColor, 1.2) width: units.gridUnit * 2.5 height: qinput.height anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right PlasmaCore.IconItem { id: qinputmicbx anchors.centerIn: parent source: "mic-on" width: units.gridUnit * 2 height: units.gridUnit * 2 z: 102 } MouseArea { anchors.fill: parent onClicked: { if (qinputmicbx.source == "mic-on") { qinputmicbx.source = "mic-off" } else if (qinputmicbx.source == "mic-off") { qinputmicbx.source = "mic-on" } muteMicrophone() } } } } } Settings { id: innerset property alias wsurl: settingsTabUnitsWSpath.text property alias customrecog: settingsTabUnitsIRCmd.text property alias customocrrecog: settingsTabUnitsOCRCmd.text property alias customsetuppath: settingsTabUnitsOpThree.text property alias notifybool: notificationswitch.checked property alias wolffallbackbool: wolframfallbackswitch.checked property alias wolframKey: wolframapikeyfld.text property alias radiobt1: settingsTabUnitsOpOne.checked property alias radiobt2: settingsTabUnitsOpTwo.checked property alias radiobt3: settingsTabUnitsOpZero.checked property alias dashboardSetting: dashswitch.checked property alias disclaimerCardSetting: disclaimercardswitch.checked property alias newsCardSetting: newscardswitch.checked property alias newsCardAPIKey: newsApiKeyLabelFld.text property alias weatherCardSetting: weathercardswitch.checked property alias weatherCardAPIKey: owmApiKeyLabelFld.text property alias weatherMetricC: owmApiKeyMetricCel.checked property alias weatherMetricF: owmApiKeyMetricFar.checked property alias selectedCryptoidx: cryptoSelectedBox.currentIndex property alias selectedCrypto: cryptoSelectedBox.cryptInfo property alias selectedCur1idx: cryptoSelectCur1.currentIndex property alias selectedCur1: cryptoSelectCur1.cur1Info property alias selectedCur2idx: cryptoSelectCur2.currentIndex property alias selectedCur2: cryptoSelectCur2.cur2Info property alias selectedCur3idx: cryptoSelectCur3.currentIndex property alias selectedCur3: cryptoSelectCur3.cur3Info } } diff --git a/plasmoid/contents/ui/MsmView.qml b/plasmoid/contents/ui/MsmView.qml index fab8fd3..e38ffec 100644 --- a/plasmoid/contents/ui/MsmView.qml +++ b/plasmoid/contents/ui/MsmView.qml @@ -1,194 +1,194 @@ /* 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 +import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa import Qt.labs.settings 1.0 Rectangle { id: skillcontent Layout.fillWidth: true; anchors { left: parent.left; leftMargin: 0.5; right: parent.right } height: units.gridUnit * 4 border.width: 1 border.color: Qt.darker(theme.linkColor, 1.2) color: Qt.darker(theme.backgroundColor, 1.2) function exec(msmparam) { var bscrpt = "/usr/share/plasma/plasmoids/org.kde.plasma.mycroftplasmoid/contents/code/msm.sh" return launchinstaller.msmapp("bash " + bscrpt + " install " + model.url) } function getSkillInfoLocal() { var customFold = '/opt/mycroft/skills/' var skillPath = customFold + model.name if(PlasmaLa.FileReader.file_exists_local(skillPath)){ installLabl.text = i18n("Installed") getskillviamsmRect.color = Qt.lighter(theme.textColor, 1.2) installLabl.color = Qt.darker(theme.backgroundColor, 1.2) skillcontent.border.color = Qt.lighter(theme.textColor, 1.2) } } PlasmaLa.MsmApp{ id: launchinstaller } Component.onCompleted: { msmSkillInstallProgBar.visible = false; getSkillInfoLocal(); } PlasmaComponents.Label { id: skllname font.capitalization: Font.AllUppercase anchors.top: parent.top anchors.left: parent.left anchors.leftMargin: units.gridUnit * 0.5 anchors.right: parent.right anchors.rightMargin: units.gridUnit * 0.5 wrapMode: Text.WordWrap text: model.name Rectangle { id: sepratrmsm width: parent.width height: 1 anchors.left: parent.left anchors.bottom: parent.bottom anchors.bottomMargin: 2 color: Qt.darker(theme.linkColor, 1.2) } } PlasmaComponents.Label { id: urlskllable anchors.top: skllname.bottom anchors.topMargin: units.gridUnit * 0.03 anchors.left: parent.left anchors.leftMargin: units.gridUnit * 0.5 anchors.right: parent.right anchors.rightMargin: units.gridUnit * 0.5 wrapMode: Text.WordWrap color: theme.textColor text: model.url MouseArea{ id: gotoGit anchors.fill: parent hoverEnabled: true onClicked: {Qt.openUrlExternally(model.url)} onEntered: { urlskllable.color = Qt.darker(theme.linkColor, 1.2) } onExited: { urlskllable.color = theme.textColor } } } Rectangle { id: getskillviamsmRect width: parent.width height: units.gridUnit * 1 anchors.bottom: parent.bottom color: Qt.darker(theme.linkColor, 1.2) PlasmaComponents.Label{ id: installLabl wrapMode: Text.WordWrap anchors.centerIn: parent text: i18n("Install") color: Qt.darker(theme.backgroundColor, 1.2) } PlasmaComponents.ProgressBar { anchors.centerIn: parent width: parent.width / 1.2 id: msmSkillInstallProgBar visible: false indeterminate: false } MouseArea { anchors.fill: parent hoverEnabled: true onEntered: { switch(installLabl.text){ case i18n("Install"): getskillviamsmRect.color = Qt.lighter(theme.backgroundColor, 1.2) installLabl.color = Qt.darker(theme.linkColor, 1.2) getskillviamsmRect.border.width = 1 getskillviamsmRect.border.color = Qt.darker(theme.linkColor, 1.2) break case i18n("Installed"): getskillviamsmRect.color = Qt.lighter(theme.textColor, 1.2) installLabl.color = Qt.darker(theme.backgroundColor, 1.2) getskillviamsmRect.border.width = 0 getskillviamsmRect.border.color = Qt.darker(theme.backgroundColor, 1.2) skillcontent.border.color = Qt.darker(theme.textColor, 1.2) break } } onExited: { switch(installLabl.text){ case i18n("Install"): getskillviamsmRect.color = Qt.darker(theme.linkColor, 1.2) installLabl.color = Qt.darker(theme.backgroundColor, 1.2) getskillviamsmRect.border.width = 0 break case i18n("Installed"): getskillviamsmRect.color = Qt.lighter(theme.textColor, 1.2) installLabl.color = Qt.darker(theme.backgroundColor, 1.2) getskillviamsmRect.border.width = 0 getskillviamsmRect.color = Qt.lighter(theme.textColor, 1.2) skillcontent.border.color = Qt.lighter(theme.textColor, 1.2) break } } onClicked: { var msmprogress = exec() var getcurrentprogress = msmprogress.split("\n") if(getcurrentprogress.indexOf("Cloning repository") != -1) { installLabl.visible = false msmSkillInstallProgBar.visible = true; msmSkillInstallProgBar.indeterminate = true; } if(getcurrentprogress.indexOf("Skill installed!") != -1) { msmSkillInstallProgBar.visible = false installLabl.visible = true installLabl.text = i18n("Installed") getSkillInfoLocal() } } } } } diff --git a/plasmoid/contents/ui/NavigationDelegate.qml b/plasmoid/contents/ui/NavigationDelegate.qml index 58dd922..e9eab5c 100644 --- a/plasmoid/contents/ui/NavigationDelegate.qml +++ b/plasmoid/contents/ui/NavigationDelegate.qml @@ -1,101 +1,120 @@ +/* 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 QtQml.Models 2.2 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import Qt.WebSockets 1.0 import Qt.labs.settings 1.0 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 QtWebKit 3.0 import QtWebKit.experimental 1.0 import QtGraphicalEffects 1.0 Rectangle { id: navMapDelegateItm height: units.gridUnit * 5 width: parent.width color: theme.backgroundColor function filterDirection(getInfo){ var keyleft = ["left","east"] var keyright = ["right", "west"] var keynorth = ["north", "Head"] var keyuturn = ["U-Turn", "u-turn"] var keyramp = ["ramp", "Ramp"] var keyarrive = ["Arrive", "arrive"] for (var i=0; i + + 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 org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import QtGraphicalEffects 1.0 Item { id: pulleyFrame anchors.fill: parent anchors.topMargin: units.gridUnit * 0.05 anchors.bottomMargin: units.gridUnit * 0.02 property bool opened: state === "PulleyExpanded" property bool closed: state === "PulleyClosed" property bool _isVisible property var barColor signal pulleyExpanded() signal pulleyClosed() function open() { pulleyFrame.state = "PulleyExpanded"; pulleyExpanded(); } function close() { pulleyFrame.state = "PulleyClosed"; pulleyListView.positionViewAtBeginning() pulleyClosed(); } states: [ State { name: "PulleyExpanded" PropertyChanges { target: pulleyMenu; height: pulleyFrame.height - pulleyIconBar.height; } PropertyChanges { target: pulleyListView; interactive: true; } PropertyChanges { target: menudrawIcon; source: "go-down";} }, State { name: "PulleyClosed" PropertyChanges { target: pulleyMenu; height: 0; } PropertyChanges { target: pulleyListView; interactive: false; } PropertyChanges { target: menudrawIcon; source: "go-up";} } ] transitions: [ Transition { to: "*" NumberAnimation { target: pulleyMenu; properties: "height"; duration: 450; easing.type: Easing.OutCubic; } } ] Rectangle { id: pulleyIconBar anchors.bottom: pulleyMenu.top anchors.bottomMargin: 4 height: units.gridUnit * 0.40 color: barColor width: cbwidth PlasmaCore.IconItem { id: menudrawIcon visible: _isVisible anchors.centerIn: parent source: "go-up" width: units.gridUnit * 1.25 height: units.gridUnit * 1.25 } MouseArea{ anchors.fill: parent propagateComposedEvents: true onClicked: { if (pulleyFrame.opened) { pulleyFrame.close(); } else { pulleyFrame.open(); } } } } Rectangle { id: pulleyMenu width: parent.width color: PlasmaCore.ColorScope.backgroundColor anchors.bottom: parent.bottom height: 0 ListView { id: pulleyListView width: parent.width anchors.top: parent.top anchors.bottom: pulleyEndArea.bottom model: SkillModel{} clip: true interactive: false; spacing: 5 delegate: Rectangle { id: pulleyDelegateListBg height: units.gridUnit * 2.5 color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) radius: 4 anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: units.gridUnit * 0.50 anchors.rightMargin: units.gridUnit * 0.50 layer.enabled: true layer.effect: DropShadow { horizontalOffset: 0 verticalOffset: 1 radius: 10 samples: 32 spread: 0.1 color: Qt.rgba(0, 0, 0, 0.3) } MouseArea { anchors.fill: parent hoverEnabled: true propagateComposedEvents: true onEntered: { removeItemButton.visible = true pulleyDelegateListBg.color = theme.linkColor } onExited: { removeItemButton.visible = false pulleyDelegateListBg.color = Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) } onClicked: { pulleyFrame.close(); 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)); qinput.text = ""; } } PlasmaCore.IconItem { id: removeItemButton source: "window-close" width: units.gridUnit * 1.5 height: units.gridUnit * 1.5 anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: units.gridUnit * 0.50 visible: false MouseArea { anchors.fill: parent hoverEnabled: true propagateComposedEvents: true onEntered: { removeItemButton.visible = true } onClicked: { SkillModel.remove(index) } } } PlasmaComponents.Label { id: pulleyDelegateListLabel anchors.centerIn: parent text: CommandList.get(0).Commands color: PlasmaCore.ColorScope.textColor } } } Item { id: pulleyEndArea anchors.bottom: parent.bottom anchors.bottomMargin: units.gridUnit * 1.22 width: parent.width height: units.gridUnit * 2.5 } } } diff --git a/plasmoid/contents/ui/SkillView.qml b/plasmoid/contents/ui/SkillView.qml index 4cb4f3c..bf6824b 100644 --- a/plasmoid/contents/ui/SkillView.qml +++ b/plasmoid/contents/ui/SkillView.qml @@ -1,115 +1,115 @@ /* 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 +import org.kde.private.mycroftplasmoidmobile 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)} } } } diff --git a/plasmoid/contents/ui/TomorrowWeatherType.qml b/plasmoid/contents/ui/TomorrowWeatherType.qml index ee2fdcd..35a90e2 100644 --- a/plasmoid/contents/ui/TomorrowWeatherType.qml +++ b/plasmoid/contents/ui/TomorrowWeatherType.qml @@ -1,149 +1,168 @@ +/* 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.0 import QtQuick.Window 2.2 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.0 import QtQml.Models 2.2 import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.plasmoid 2.0 Column { spacing: 6 //anchors.right: parent.right //anchors.left: parent.left //readonly property bool sentByMe: model.recipient !== "Me" //property alias cttemp: currenttempitem.text property alias lttemp: lowtempitem.text property alias httemp: hightempitem.text Row { id: messageRow spacing: 6 Rectangle{ id: messageWrapper width: cbwidth height: messageRect.height color: theme.backgroundColor Rectangle { id: messageRect width: cbwidth / 1.1 height: 100 //anchors.right: avatar.right color: theme.backgroundColor Rectangle { id: rectangleltt width: 100 height: 60 color: "#00000000" anchors.top: todayweather.bottom anchors.topMargin: 5 anchors.left: parent.left anchors.leftMargin: 0 PlasmaComponents.Label { id: lowtemplable anchors.left: parent.left anchors.verticalCenter: lowtempaniimage.verticalCenter text: i18n("Low") // font.family: "Courier" font.pointSize: 12 font.bold: true anchors.top: parent.top anchors.topMargin: 8 anchors.leftMargin: 30 } PlasmaComponents.Label { id: lowtempitem x: 63 y: 33 anchors.top: lowtemplable.bottom text: i18n("100") anchors.horizontalCenter: lowtemplable.horizontalCenter anchors.topMargin: 10 } PlasmaComponents.Label { id: weatherwidgetlowtempdegree text: i18n("°") anchors.verticalCenterOffset: -5 anchors.verticalCenter: lowtempitem.verticalCenter anchors.left: lowtempitem.right anchors.leftMargin: 5 font.pixelSize: 12 } } Rectangle { id: rectanglehtt width: 100 height: 60 color: "#00000000" anchors.top: todayweather.bottom anchors.topMargin: 5 anchors.left: rectangleltt.right anchors.leftMargin: 0 PlasmaComponents.Label { id: hightempitem x: 65 y: 70 anchors.top: hightemplable.bottom text: i18n("100") anchors.topMargin: 10 anchors.horizontalCenter: hightemplable.horizontalCenter } PlasmaComponents.Label { id: hightemplable anchors.left: parent.left text: i18n("High") font.pointSize: 12 font.bold: true // font.family: "Courier" anchors.top: parent.top anchors.topMargin: 8 anchors.verticalCenter: hightempaniimage.verticalCenter anchors.leftMargin: 30 } PlasmaComponents.Label { id: weatherwidgethightempdegree text: i18n("°") anchors.verticalCenterOffset: -5 anchors.verticalCenter: hightempitem.verticalCenter anchors.left: hightempitem.right anchors.leftMargin: 5 font.pixelSize: 12 } } PlasmaComponents.Label { id: todayweather text: i18n("Tomorrow's Weather") anchors.left: parent.left anchors.leftMargin: 9 // font.family: "Courier" font.italic: false font.bold: true font.pixelSize: 17 } } } } } diff --git a/plasmoid/contents/ui/WebViewType.qml b/plasmoid/contents/ui/WebViewType.qml index bac0108..f4f2d48 100644 --- a/plasmoid/contents/ui/WebViewType.qml +++ b/plasmoid/contents/ui/WebViewType.qml @@ -1,94 +1,94 @@ /* 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 QtQml.Models 2.2 import QtQuick.Controls 2.2 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 +import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa import QtWebKit 3.0 import QtWebKit.experimental 1.0 Column { spacing: 6 anchors.right: parent.right Row { id: messageRow spacing: 6 Rectangle { id: messageRect width: cbwidth radius: 2 height: newikiFlick.height color: theme.backgroundColor Flickable { id: newikiFlick width: messageRect.width height: units.gridUnit * 10 WebView { id: wikiview anchors.fill: parent experimental.preferredMinimumContentsWidth: 450 url: model.InputQuery Rectangle { id: hoverBg1 anchors.right: parent.right anchors.rightMargin: 15 anchors.top: parent.top anchors.topMargin: 5 visible: true height: units.gridUnit * 2.2 width: units.gridUnit * 2.2 radius: 10 z: 2 color: theme.backgroundColor PlasmaComponents.ToolButton { id: viewExtendedScreen anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter visible: true iconSource: "file-zoom-in" flat: false checked: false focus: false height: units.gridUnit * 2 width: units.gridUnit * 2 z: 10 onClicked: { var browsrUrl = model.InputQuery PlasmaLa.LaunchApp.runCommand("x-www-browser", browsrUrl) } } } } ScrollIndicator.vertical: ScrollIndicator { } } } } } diff --git a/plasmoid/contents/ui/WikiDelegate.qml b/plasmoid/contents/ui/WikiDelegate.qml index 9c0cb5a..d5c3cfa 100644 --- a/plasmoid/contents/ui/WikiDelegate.qml +++ b/plasmoid/contents/ui/WikiDelegate.qml @@ -1,99 +1,118 @@ +/* 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 QtQml.Models 2.2 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 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 QtGraphicalEffects 1.0 Rectangle { id: mainRect height: headrTitle.height + splitter.height + wikiImg.height + wikisum.height + units.gridUnit * 0.50 width: cbwidth border.width: 1 border.color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) color: Qt.darker(PlasmaCore.ColorScope.backgroundColor, 1.2) layer.enabled: true layer.effect: DropShadow { horizontalOffset: 0 verticalOffset: 1 radius: 10 samples: 32 spread: 0.1 color: Qt.rgba(0, 0, 0, 0.3) } Column{ id: mainColWdel spacing: 2 anchors.fill: parent Row { id: headerRowWiki anchors.left: parent.left anchors.right: parent.right height: headrTitle.height spacing: 2 Image { id: headrTitleLogo width: parent.height height: parent.height source: "../images/wikip.png" } PlasmaCore.SvgItem { id: headerDivWiki anchors { top: parent.top topMargin: 0 bottom: parent.bottom bottomMargin: 0 } width: linetopleftvertSvg.elementSize("vertical-line").width z: 110 elementId: "vertical-line" svg: PlasmaCore.Svg { id: linetopleftvertSvg; imagePath: "widgets/line" } } PlasmaComponents.Label { id: headrTitle anchors.top: parent.top anchors.topMargin: units.gridUnits * 0.25 text: i18n("Wikipedia") font.capitalization: Font.SmallCaps color: theme.textColor height: units.gridUnits * 2 width: parent.width } } Rectangle { id: splitter anchors.left: parent.left anchors.right: parent.right height: 1 color: theme.textColor } Image { id: wikiImg width: parent.width height: units.gridUnit * 3 source: model.image } PlasmaComponents.Label { id: wikisum text: i18n(model.summary) width: parent.width wrapMode: Text.Wrap } } } diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index c665e98..b6668bd 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -1,84 +1,84 @@ /* 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 QtQml.Models 2.2 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import Qt.WebSockets 1.0 import QtWebKit 3.0 import Qt.labs.settings 1.0 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 +import org.kde.private.mycroftplasmoidmobile 1.0 as PlasmaLa import org.kde.plasma.private.volume 0.1 PlasmaComponents.ToolButton { id: rootIcon Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation Plasmoid.toolTipMainText: i18n("Mycroft") Layout.preferredWidth: units.gridUnits * 2 Layout.preferredHeight: units.gridUnits * 2 iconSource: "audio-input-microphone" property variant getWidth property variant getHeight property variant getY property alias rDrawer: rootDrawer Timer { id: timer } function delay(delayTime, cb) { timer.interval = delayTime; timer.repeat = false; timer.triggered.connect(cb); timer.start(); } onClicked: { rootDrawer.open() } Component.onCompleted: { delay(4000, function() { getHeight = plasmoid.availableScreenRect.height getWidth = plasmoid.availableScreenRect.width getY = plasmoid.availableScreenRect.y }); } Drawer { id: rootDrawer width: getWidth height: getHeight y: getY //edge: Qt.LeftEdge dragMargin: 0 z: 1000 MainPage{ id: mainPageComponent anchors.fill: parent z: 1000 } } } diff --git a/plasmoid/metadata.desktop b/plasmoid/metadata.desktop index 8900130..8f0597a 100644 --- a/plasmoid/metadata.desktop +++ b/plasmoid/metadata.desktop @@ -1,61 +1,61 @@ [Desktop Entry] Encoding=UTF-8 -Name=MycroftPlasmoid -Name[ca]=Plasmoide del Mycroft -Name[ca@valencia]=Plasmoide del Mycroft -Name[cs]=MycroftPlasmoid -Name[de]=MycroftPlasmoid -Name[es]=Plasmoide de Mycroft -Name[et]=Mycrofti plasmoid -Name[fi]=MycroftPlasmoid -Name[fr]=MycroftPlasmoid -Name[gl]=Plasmoide de Mycroft -Name[ia]=MycroftPlasmoid -Name[it]=Plasmoide Mycroft -Name[ko]=MycroftPlasmoid -Name[nl]=MycroftPlasmoid -Name[pl]=PlazmoidMycroft -Name[pt]=MycroftPlasmoid -Name[pt_BR]=MycroftPlasmoid -Name[sk]=MycroftPlasmoid -Name[sv]=Mycroft Plasmoid -Name[tg]=MycroftPlasmoid -Name[uk]=Плазмоїд Mycroft -Name[x-test]=xxMycroftPlasmoidxx -Name[zh_TW]=MycroftPlasmoid -Comment=Mycroft applet for plasma desktop +Name=MycroftPlasmoidMobile +Name[ca]=Plasmoide del Mycroft Mobile +Name[ca@valencia]=Plasmoide del Mycroft Mobile +Name[cs]=MycroftPlasmoidMobile +Name[de]=MycroftPlasmoidMobile +Name[es]=Plasmoide de Mycroft Mobile +Name[et]=Mycrofti plasmoid Mobile +Name[fi]=MycroftPlasmoidMobile +Name[fr]=MycroftPlasmoidMobile +Name[gl]=Plasmoide de Mycroft Mobile +Name[ia]=MycroftPlasmoidMobile +Name[it]=Plasmoide Mycroft Mobile +Name[ko]=MycroftPlasmoidMobile +Name[nl]=MycroftPlasmoidMobile +Name[pl]=PlazmoidMycroftMobile +Name[pt]=MycroftPlasmoidMobile +Name[pt_BR]=MycroftPlasmoidMobile +Name[sk]=MycroftPlasmoidMobile +Name[sv]=Mycroft PlasmoidMobile +Name[tg]=MycroftPlasmoidMobile +Name[uk]=Плазмоїд MycroftMobile +Name[x-test]=xxMycroftPlasmoidMobilexx +Name[zh_TW]=MycroftPlasmoidMobile +Comment=Mycroft applet for plasma mobile Comment[ca]=Miniaplicació Mycroft per a l'escriptori Plasma Comment[ca@valencia]=Miniaplicació Mycroft per a l'escriptori Plasma -Comment[cs]=Applet Mycroft pro pracovní prostředí Plasma -Comment[de]=Mycroft-Miniprogramm für die Plasma-Arbeitsfläche +Comment[cs]=Applet Mycroft pro pracovní prostředí Plasma Mobile +Comment[de]=Mycroft-Miniprogramm für die Plasma-Arbeitsfläche Comment[es]=Miniaplicación Mycroft para el escritorio Plasma Comment[et]=Mycrofti aplett Plasma töölauale Comment[fi]=Mycroft-sovelma Plasma-työpöydälle Comment[fr]=Composant Mycroft pour le bureau plasma Comment[gl]=Trebello de Mycroft para o escritorio Plasma. Comment[it]=Applet di Mycroft per il desktop Plasma Comment[ko]=Plasma 데스크톱용 Mycroft 애플릿 Comment[nl]=Mycroft applet voor Plasma Bureaublad Comment[pl]=Aplet Mycroft dla pulpitu Plazmy Comment[pt]='Applet' do Mycroft para o ambiente de trabalho Plasma Comment[pt_BR]=Widget do Mycroft para a área de trabalho do Plasma Comment[sk]=Applet Mycroft pre plochu Plasma Comment[sv]=Mycroft miniprogram för Plasma-skrivbordet Comment[tg]=Зербарномаи Mycroft барои мизи кории Плазма Comment[uk]=Аплет Mycroft для стільниці Плазми Comment[x-test]=xxMycroft applet for plasma desktopxx Comment[zh_TW]=適用於 Plasma 桌面的 Mycroft 元件 Type=Service X-KDE-ParentApp= X-KDE-PluginInfo-Author=Aditya Mehra X-KDE-PluginInfo-Email=aix.m@outlook.com X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.phone.mycroftplasmoid +X-KDE-PluginInfo-Name=org.kde.phone.mycroftplasmoidmobile X-KDE-PluginInfo-Version=0.1 X-KDE-PluginInfo-Website=plasma.kde.org X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml X-Plasma-RemoteLocation= X-KDE-PluginInfo-Category=Utilities Icon=mycroft-plasma-appicon diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index b704afb..f19dd1d 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -1,15 +1,15 @@ find_package(PkgConfig) kde_enable_exceptions() -set(mycroftplasmoidplugin_SRCS mycroftplasmoidplugin.cpp launchapp.cpp notify.cpp filereader.cpp msmapp.cpp mycroftplasmoid_dbus.cpp) +set(mycroftplasmoidmobileplugin_SRCS mycroftplasmoidmobileplugin.cpp launchapp.cpp notify.cpp filereader.cpp msmapp.cpp mycroftplasmoid_dbus.cpp) -add_library(mycroftplasmoidplugin SHARED ${mycroftplasmoidplugin_SRCS}) +add_library(mycroftplasmoidmobileplugin SHARED ${mycroftplasmoidmobileplugin_SRCS}) -target_link_libraries(mycroftplasmoidplugin Qt5::Gui Qt5::Core Qt5::Qml Qt5::DBus KF5::Plasma KF5::I18n KF5::Notifications) +target_link_libraries(mycroftplasmoidmobileplugin Qt5::Gui Qt5::Core Qt5::Qml Qt5::DBus KF5::Plasma KF5::I18n KF5::Notifications) -install(TARGETS mycroftplasmoidplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/private/mycroftplasmoid) +install(TARGETS mycroftplasmoidmobileplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/private/mycroftplasmoidmobile) -install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/private/mycroftplasmoid) +install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/private/mycroftplasmoidmobile) -install(FILES mycroftPlasmoid.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR}) +install(FILES mycroftPlasmoidMobile.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR}) diff --git a/plugin/mycroftPlasmoid.notifyrc b/plugin/mycroftPlasmoidMobile.notifyrc similarity index 69% rename from plugin/mycroftPlasmoid.notifyrc rename to plugin/mycroftPlasmoidMobile.notifyrc index c6bf48e..2af39ac 100644 --- a/plugin/mycroftPlasmoid.notifyrc +++ b/plugin/mycroftPlasmoidMobile.notifyrc @@ -1,74 +1,74 @@ [Global] IconName=mycroft-plasma-appicon -Comment=Mycroft Plasmoid -Comment[ca]=Plasmoide del Mycroft -Comment[ca@valencia]=Plasmoide del Mycroft -Comment[cs]=Plasmoid Mycroft -Comment[de]=Mycroft-Plasmoid -Comment[es]=Plasmoide de Mycroft -Comment[et]=Mycrofti plasmoid -Comment[fi]=Mycroft-sovelma -Comment[fr]=Composant graphique Mycroft -Comment[gl]=Plasmoide de Mycroft -Comment[it]=Plasmoide Mycroft -Comment[ko]=Mycroft Plasmoid -Comment[nl]=Mycroft Plasmoid -Comment[pl]=Plazmoid Mycroft -Comment[pt]=Plasmóide do Mycroft -Comment[pt_BR]=Plasmóide Mycroft -Comment[sk]=Mycroft Plazmoid -Comment[sv]=Mycroft Plasmoid -Comment[tg]=Mycroft Plasmoid -Comment[uk]=Плазмоїд Mycroft -Comment[x-test]=xxMycroft Plasmoidxx -Comment[zh_TW]=Mycroft Plasmoid +Comment=Mycroft Plasmoid Mobile +Comment[ca]=Plasmoide del Mycroft Mobile +Comment[ca@valencia]=Plasmoide del Mycroft Mobile +Comment[cs]=Plasmoid Mycroft Mobile +Comment[de]=Mycroft-Plasmoid Mobile +Comment[es]=Plasmoide de Mycroft Mobile +Comment[et]=Mycrofti plasmoid Mobile +Comment[fi]=Mycroft-sovelma Mobile +Comment[fr]=Composant graphique Mycroft Mobile +Comment[gl]=Plasmoide de Mycroft Mobile +Comment[it]=Plasmoide Mycroft Mobile +Comment[ko]=Mycroft Plasmoid Mobile +Comment[nl]=Mycroft Plasmoid Mobile +Comment[pl]=Plazmoid Mycroft Mobile +Comment[pt]=Plasmóide do Mycroft Mobile +Comment[pt_BR]=Plasmóide Mycroft Mobile +Comment[sk]=Mycroft Plazmoid Mobile +Comment[sv]=Mycroft Plasmoid Mobile +Comment[tg]=Mycroft Plasmoid Mobile +Comment[uk]=Плазмоїд Mycroft Mobile +Comment[x-test]=xxMycroft Plasmoid Mobilexx +Comment[zh_TW]=Mycroft Plasmoid Mobile [Event/MycroftResponse] Name=Mycroft Response Name[ca]=Resposta del Mycroft Name[ca@valencia]=Resposta del Mycroft Name[cs]=Odpověď Name[de]=Mycroft-Antwort Name[es]=Respuesta de Mycroft Name[et]=Mycrofti vastus Name[fi]=Mycroftin vastaus Name[fr]=Réponse Mycroft Name[gl]=Resposta de Mycroft Name[it]=Risposta di Mycroft Name[ko]=Mycroft 응답 Name[nl]=Mycroft reactie Name[pl]=Odpowiedź Mycroft Name[pt]=Resposta do Mycroft Name[pt_BR]=Resposta do Mycroft Name[sk]=Odpoveď Mycroft Name[sv]=Mycroft svar Name[tg]=Посухи Mycroft Name[uk]=Відповідь Mycroft Name[x-test]=xxMycroft Responsexx Name[zh_TW]=Mycroft 回應 Comment=Connection to device failed Comment[ca]=Ha fallat la connexió amb el dispositiu Comment[ca@valencia]=Ha fallat la connexió amb el dispositiu Comment[cs]=Připojení k zařízení selhalo Comment[de]=Verbindung zum Gerät fehlgeschlagen Comment[es]=La conexión con el dispositivo ha fallado Comment[et]=Ühendumine seadmega nurjus Comment[fi]=Yhdistäminen laitteeseen epäonnistui Comment[fr]=La connexion au périphérique a échoué Comment[gl]=A conexión co dispositivo fallou. Comment[ia]=Le connexion al dispositivo ha fallite Comment[it]=Connessione al dispositivo non riuscita Comment[ko]=장치에 연결할 수 없음 Comment[nl]=Verbinding met het apparaat is mislukt Comment[pl]=Połączenie do urządzenia nie udało się Comment[pt]=A ligação ao dispositivo foi mal-sucedida Comment[pt_BR]=A conexão com o dispositivo falhou Comment[sk]=Pripojenie k zariadeniu zlyhalo Comment[sv]=Anslutning till enhet misslyckades Comment[tg]=Пайвастшавӣ ба дастгоҳ қатъ шуд Comment[uk]=Не вдалося встановити з’єднання із пристроєм Comment[x-test]=xxConnection to device failedxx Comment[zh_CN]=连接设备失败 Comment[zh_TW]=連線裝置失敗 Icon=mycroft-plasma-appicon Action=Popup diff --git a/plugin/mycroftplasmoid_dbus.cpp b/plugin/mycroftplasmoid_dbus.cpp index 510741d..4ce92ad 100644 --- a/plugin/mycroftplasmoid_dbus.cpp +++ b/plugin/mycroftplasmoid_dbus.cpp @@ -1,75 +1,75 @@ /* * Copyright (C) 2016 by Aditya Mehra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mycroftplasmoid_dbus.h" -#include "mycroftplasmoidplugin.h" +#include "mycroftplasmoidmobileplugin.h" #include #include #include #include #include #include #include #include /* * Implementation of adaptor class MycroftDbusAdapterInterface */ MycroftDbusAdapterInterface::MycroftDbusAdapterInterface(QObject *parent) : QDBusAbstractAdaptor(parent) { // constructor QDBusConnection dbus = QDBusConnection::sessionBus(); dbus.registerObject("/mycroftapplet", this, QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportNonScriptableSlots); dbus.registerService("org.kde.mycroftapplet"); setAutoRelaySignals(true); } MycroftDbusAdapterInterface::~MycroftDbusAdapterInterface() { // destructor } void MycroftDbusAdapterInterface::showMycroft() { // handle method call org.kde.mycroft.showMycroft emit sendShowMycroft("Show"); QMetaObject::invokeMethod(this, "getMethod", Qt::DirectConnection, Q_ARG(QString, "Show")); } void MycroftDbusAdapterInterface::showSkills() { // handle method call org.kde.mycroft.showSkills emit sendShowSkills("ShowSkills"); //QMetaObject::invokeMethod(this, "showSkills"); } void MycroftDbusAdapterInterface::showSkillsInstaller() { // handle method call org.kde.mycroft.showSkillsInstaller emit sendShowInstallSkills("ShowInstallSkills"); //QMetaObject::invokeMethod(this, "showSkillsInstaller"); } Q_INVOKABLE QString MycroftDbusAdapterInterface::getMethod(const QString &method) { QString str = method; return str; } diff --git a/plugin/mycroftplasmoidplugin.cpp b/plugin/mycroftplasmoidmobileplugin.cpp similarity index 91% rename from plugin/mycroftplasmoidplugin.cpp rename to plugin/mycroftplasmoidmobileplugin.cpp index befb89b..667130a 100644 --- a/plugin/mycroftplasmoidplugin.cpp +++ b/plugin/mycroftplasmoidmobileplugin.cpp @@ -1,67 +1,67 @@ /* * Copyright (C) 2016 by Aditya Mehra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "mycroftplasmoidplugin.h" +#include "mycroftplasmoidmobileplugin.h" #include "mycroftplasmoid_dbus.h" #include "launchapp.h" #include "notify.h" #include "filereader.h" #include "msmapp.h" #include #include #include static QObject *notify_singleton(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new Notify; } static QObject *launchapp_singleton(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new LaunchApp; } static QObject *filereader_singleton(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new FileReader; } -void MycroftPlasmoidPlugin::registerTypes(const char *uri) +void MycroftPlasmoidMobilePlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.private.mycroftplasmoid")); qmlRegisterSingletonType(uri, 1, 0, "Notify", notify_singleton); qmlRegisterSingletonType(uri, 1, 0, "LaunchApp", launchapp_singleton); qmlRegisterSingletonType(uri, 1, 0, "FileReader", filereader_singleton); qmlRegisterType(uri, 1, 0, "MsmApp"); } -void MycroftPlasmoidPlugin::initializeEngine(QQmlEngine* engine, const char* uri) +void MycroftPlasmoidMobilePlugin::initializeEngine(QQmlEngine* engine, const char* uri) { QQmlExtensionPlugin::initializeEngine(engine, uri); auto mycroftDbusAdapterInterface = new MycroftDbusAdapterInterface(engine); engine->rootContext()->setContextProperty("main2", mycroftDbusAdapterInterface); } diff --git a/plugin/mycroftplasmoidplugin.h b/plugin/mycroftplasmoidmobileplugin.h similarity index 95% rename from plugin/mycroftplasmoidplugin.h rename to plugin/mycroftplasmoidmobileplugin.h index 332fddd..ba9a0c0 100644 --- a/plugin/mycroftplasmoidplugin.h +++ b/plugin/mycroftplasmoidmobileplugin.h @@ -1,40 +1,40 @@ /* * Copyright (C) 2016 by Aditya Mehra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PROTOTYPEPLASMOIDPLUGIN_H #define PROTOTYPEPLASMOIDPLUGIN_H #include #include #include class QQmlEngine; -class MycroftPlasmoidPlugin : public QQmlExtensionPlugin +class MycroftPlasmoidMobilePlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: void registerTypes(const char *uri); void initializeEngine(QQmlEngine *engine, const char *uri) override; Q_SIGNAL }; #endif // PROTOTYPEPLASMOIDPLUGIN_H diff --git a/plugin/qmldir b/plugin/qmldir index 662f827..833180c 100644 --- a/plugin/qmldir +++ b/plugin/qmldir @@ -1,3 +1,3 @@ -module org.kde.private.mycroftplasmoid +module org.kde.private.mycroftplasmoidmobile -plugin mycroftplasmoidplugin +plugin mycroftplasmoidmobileplugin