Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/ImgRecogType.qml is written in an unsupported language. File is not indexed.
0001 /* Copyright 2016 Aditya Mehra <aix.m@outlook.com>
0002
0003 This library is free software; you can redistribute it and/or
0004 modify it under the terms of the GNU Lesser General Public
0005 License as published by the Free Software Foundation; either
0006 version 2.1 of the License, or (at your option) version 3, or any
0007 later version accepted by the membership of KDE e.V. (or its
0008 successor approved by the membership of KDE e.V.), which shall
0009 act as a proxy defined in Section 6 of version 3 of the license.
0010
0011 This library is distributed in the hope that it will be useful,
0012 but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0014 Lesser General Public License for more details.
0015
0016 You should have received a copy of the GNU Lesser General Public
0017 License along with this library. If not, see <http://www.gnu.org/licenses/>.
0018 */
0019
0020 import QtQuick 2.9
0021 import QtQuick.Controls 2.2
0022 import org.kde.plasma.components 2.0 as PlasmaComponents
0023 import org.kde.plasma.extras 2.0 as PlasmaExtras
0024
0025 Column {
0026 id: colmsg
0027 spacing: 6
0028 anchors.right: parent.right
0029
0030 readonly property bool sentByMe: model.recipient !== "User"
0031 //property alias mssg: messageText.text
0032
0033 Row {
0034 id: messageRow
0035 spacing: 6
0036
0037 Rectangle {
0038 id: messageRect
0039 width: cbwidth
0040 radius: 2
0041 height: messageText.implicitHeight
0042 color: "#222"
0043
0044 Image {
0045 id: messageText
0046 anchors.top: parent.top
0047 anchors.bottom: buttnRow.top
0048 anchors.left: parent.left
0049 anchors.right: parent.right
0050 anchors.margins: 5
0051 fillMode: Image.PreserveAspectCrop
0052 source: model.InputQuery
0053 sourceSize.width: cbwidth
0054 sourceSize.height: units.gridUnit * 10
0055 }
0056
0057 Row {
0058 id: buttnRow
0059 height: units.gridUnit * 2
0060 anchors.bottom: parent.bottom
0061
0062 PlasmaComponents.Button {
0063 id: generalImgRecog
0064 width: cbwidth / 2
0065 height: units.gridUnit * 2
0066 text: i18n("Broad Recognition")
0067
0068 onClicked: {
0069 var irecogmsgsend = innerset.customrecog
0070 var socketmessage = {};
0071 socketmessage.type = "recognizer_loop:utterance";
0072 socketmessage.data = {};
0073 socketmessage.data.utterances = [irecogmsgsend + " " + model.InputQuery];
0074 socket.sendTextMessage(JSON.stringify(socketmessage));
0075 }
0076 }
0077 PlasmaComponents.Button {
0078 id: ocrImageRecog
0079 width: cbwidth / 2
0080 height: units.gridUnit * 2
0081 text: i18n("OCR Recognition")
0082
0083 onClicked: {
0084 var irecogmsgsend = innerset.customocrrecog
0085 var socketmessage = {};
0086 socketmessage.type = "recognizer_loop:utterance";
0087 socketmessage.data = {};
0088 socketmessage.data.utterances = [irecogmsgsend + " " + model.InputQuery];
0089 socket.sendTextMessage(JSON.stringify(socketmessage));
0090 }
0091 }
0092 }
0093 }
0094 }
0095 }