Browse files

InvokeClient updated with bugfixes and cleaned up code.

  • Loading branch information...
1 parent 58c14a1 commit 35eddcd0644f7a194944815eb80da4f25cb7067f @shaque committed Mar 14, 2013
View
80 invokeclient/assets/ErrorDialog.qml
@@ -1,80 +0,0 @@
-/* Copyright (c) 2012 Research In Motion Limited.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/import bb.cascades 1.0
-
-import bb.cascades 1.0
-
-Dialog {
- id: root
-
- Container {
- horizontalAlignment: HorizontalAlignment.Fill
- verticalAlignment: VerticalAlignment.Fill
-
- layout: DockLayout {}
-
- ImageView {
- horizontalAlignment: HorizontalAlignment.Fill
- verticalAlignment: VerticalAlignment.Fill
-
- imageSource: "asset:///images/background.png"
- }
-
- Container {
- horizontalAlignment: HorizontalAlignment.Fill
- verticalAlignment: VerticalAlignment.Center
-
- Label {
- horizontalAlignment: HorizontalAlignment.Center
-
- text: qsTr ("An Error Occurred")
- textStyle {
- base: SystemDefaults.TextStyles.BigText
- }
- }
-
- //! [0]
- Label {
- horizontalAlignment: HorizontalAlignment.Center
- topMargin: 100
-
- text: _app.errorMessage
- multiline: true
- }
- //! [0]
-
- Button {
- horizontalAlignment: HorizontalAlignment.Center
- topMargin: 100
-
- text: qsTr ("OK")
-
- onClicked: {
- _app.clearError()
- root.close()
- }
- }
- }
- }
-
- //! [1]
- function handleErrorMessage()
- {
- if (_app.errorMessage != "")
- root.open()
- }
-
- onCreationCompleted: _app.errorMessageChanged.connect(handleErrorMessage)
- //! [1]
-}
View
95 invokeclient/assets/QueryResultSheet.qml
@@ -1,19 +1,17 @@
-
/* Copyright (c) 2012 Research In Motion Limited.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/import bb.cascades 1.0
-
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */import bb.cascades 1.0
import bb.cascades 1.0
Sheet {
@@ -25,51 +23,38 @@ Sheet {
_app.closeQueryResults.connect(root.close)
}
//! [0]
-
Page {
- Container {
- layout: DockLayout {}
-
- ImageView {
- imageSource: "asset:///images/background.png"
- }
-
- Container {
- topPadding: 50
- leftPadding: 50
- rightPadding: 50
- bottomPadding: 50
-
- Button {
- horizontalAlignment: HorizontalAlignment.Center
-
- text: qsTr ("Close")
- onClicked: root.close()
+ titleBar: TitleBar {
+ title: "Query Results"
+ dismissAction: ActionItem {
+ title: "Close"
+ onTriggered: {
+ root.close();
}
-
- Divider {}
-
- //! [1]
- ListView {
- horizontalAlignment: HorizontalAlignment.Fill
-
- dataModel: _app.model
-
- listItemComponents: ListItemComponent {
- type: "item"
-
- StandardListItem {
- title: ListItemData.label
- imageSource: ListItemData.imageSource
- }
- }
-
- onTriggered: {
- _app.invokeTarget(dataModel.data(indexPath).name)
+ }
+ }
+ Container {
+ topPadding: 50
+ leftPadding: 50
+ rightPadding: 50
+ bottomPadding: 50
+
+ //! [1]
+ ListView {
+ horizontalAlignment: HorizontalAlignment.Fill
+ dataModel: _app.model
+ listItemComponents: ListItemComponent {
+ type: "item"
+ StandardListItem {
+ title: ListItemData.label
+ imageSource: ListItemData.imageSource
}
}
- //! [1]
+ onTriggered: {
+ _app.invokeTarget(dataModel.data(indexPath).name)
+ }
}
+ //! [1]
}
}
}
View
BIN invokeclient/assets/images/background.png
Deleted file not rendered
View
BIN invokeclient/assets/images/icon.png
Deleted file not rendered
View
BIN invokeclient/assets/images/invoke.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invokeclient/assets/images/light.png
Deleted file not rendered
View
BIN invokeclient/assets/images/menuinvoke.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invokeclient/assets/images/nolight.png
Deleted file not rendered
View
BIN invokeclient/assets/images/query.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
267 invokeclient/assets/main.qml
@@ -1,278 +1,211 @@
/* Copyright (c) 2012 Research In Motion Limited.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/import bb.cascades 1.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */import bb.cascades 1.0
Page {
+
//! [0]
actions: [
ActionItem {
- title: qsTr ("Invoke (best-fit)")
- imageSource: "asset:///images/icon.png"
+ title: qsTr("Invoke (best-fit)")
+ imageSource: "asset:///images/invoke.png"
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {
_app.invoke()
}
},
ActionItem {
- title: qsTr ("Query")
+ title: qsTr("Query")
imageSource: "asset:///images/query.png"
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {
_app.query()
}
},
- InvokeActionItem {
- ActionBar.placement: ActionBarPlacement.OnBar
- query {
- mimeType: "image/png"
- invokeActionId: "bb.action.OPEN"
- }
- },
- InvokeActionItem {
- title: qsTr ("OpenImage1")
- ActionBar.placement: ActionBarPlacement.OnBar
- query {
- mimeType: "image/png"
- invokeActionId: "bb.action.OPEN"
- invokeTargetId: "com.example.bb10samples.invocation.openimage1"
- }
- },
- InvokeActionItem {
- title: qsTr ("OpenImage2")
- ActionBar.placement: ActionBarPlacement.OnBar
- query {
- mimeType: "image/png"
- invokeActionId: "bb.action.OPEN"
- invokeTargetId: "com.example.bb10samples.invocation.openimage2"
+ // This invoke brings up the system UI for platform actions such as SHARE, OPEN and SET
+ ActionItem {
+ title: qsTr("Platform Invoke")
+ imageSource: "asset:///images/menuinvoke.png"
+ ActionBar.placement: ActionBarPlacement.InOverflow
+ onTriggered: {
+ _app.platformInvoke()
}
}
]
//! [0]
-
Container {
- layout: DockLayout {}
-
- ImageView {
- horizontalAlignment: HorizontalAlignment.Fill
- verticalAlignment: VerticalAlignment.Fill
-
- imageSource: "asset:///images/background.png"
+ layout: DockLayout {
}
-
ScrollView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
-
scrollViewProperties {
scrollMode: ScrollMode.Vertical
}
-
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
-
- topPadding: 50
- leftPadding: 50
- rightPadding: 50
-
+ topPadding: 20
+ leftPadding: 20
+ rightPadding: 20
+ bottomPadding: 20
+ Header {
+ title: "Target Type"
+ subtitle: "For queries only"
+ }
//! [1]
DropDown {
horizontalAlignment: HorizontalAlignment.Fill
-
- title: qsTr ("Invocation Type:")
-
+ title: qsTr("Invocation Type:")
Option {
selected: true
- text: qsTr ("All")
- description: qsTr ("All types of invocation targets.")
+ text: qsTr("All")
+ description: qsTr("All types of invocation targets.")
value: 0
}
-
Option {
- text: qsTr ("Application")
- description: qsTr ("Targets that launch in a new window.")
+ text: qsTr("Application")
+ description: qsTr("Targets that launch in a new window.")
value: 1
}
-
Option {
- text: qsTr ("Viewer")
- description: qsTr ("Targets that launch embedded.")
- value: 2
- }
-
- Option {
- text: qsTr ("Service")
- description: qsTr ("Targets that launch in background.")
+ text: qsTr("Service")
+ description: qsTr("Targets that launch in background.")
value: 3
}
-
Option {
- text: qsTr ("Card")
- description: qsTr ("Targets that embeds as Card.")
+ text: qsTr("Card")
+ description: qsTr("Targets that embeds as Card.")
value: 3
}
-
onSelectedValueChanged: {
_app.targetType = selectedValue
}
+ onCreationCompleted: {
+ _app.targetType = selectedValue
+ }
}
//! [1]
-
- Container {
- horizontalAlignment: HorizontalAlignment.Center
-
- layout: DockLayout {}
-
- ImageView {
- horizontalAlignment: HorizontalAlignment.Center
- verticalAlignment: VerticalAlignment.Top
-
- imageSource: "asset:///images/nolight.png"
- }
-
- ImageView {
- horizontalAlignment: HorizontalAlignment.Center
- verticalAlignment: VerticalAlignment.Top
-
- imageSource: "asset:///images/light.png"
-
- animations: [
- FadeTransition {
- id: fadeout
- fromOpacity: 1
- toOpacity: 0
- duration: 300
- onEnded: {
- fadein.play();
- }
- },
- FadeTransition {
- id: fadein
- duration: fadeout.duration
- fromOpacity: 0
- toOpacity: 1
- easingCurve: StockCurve.BounceInOut
- onEnded: {
- fadeout.play();
- }
- }
- ]
- onCreationCompleted: {
- fadeout.play();
- }
- }
+ Header {
+ title: "Action"
}
-
//! [2]
DropDown {
id: actionSelector
-
horizontalAlignment: HorizontalAlignment.Fill
-
- title: qsTr ("Action:")
-
+ title: qsTr("Action:")
Option {
- selected: true
- text: qsTr ("All")
- description: qsTr ("Valid for queries only.")
+ text: qsTr("All")
+ description: qsTr("Valid for queries only.")
value: "__All"
}
-
Option {
- selected: true
- text: qsTr ("Menu Actions")
- description: qsTr ("Valid for queries only.")
+ text: qsTr("Menu Actions")
+ description: qsTr("Valid for queries only.")
value: "__MenuActions"
}
-
Option {
- selected: true
- text: qsTr ("bb.action.OPEN")
- description: qsTr ("A menu action for opening content.")
+ text: qsTr("bb.action.OPEN")
+ description: qsTr("A menu action for opening content.")
value: "bb.action.OPEN"
}
-
Option {
- text: qsTr ("bb.action.SET")
- description: qsTr ("A menu action for setting content as")
+ text: qsTr("bb.action.SET")
+ description: qsTr("A menu action for setting content as")
value: "bb.action.SET"
}
-
Option {
- text: qsTr ("bb.action.SHARE")
- description: qsTr ("A menu action for sharing content.")
+ selected: true
+ text: qsTr("bb.action.SHARE")
+ description: qsTr("A menu action for sharing content.")
value: "bb.action.SHARE"
}
-
Option {
- text: qsTr ("Custom")
- description: qsTr ("Specify a custom action.")
+ text: qsTr("Custom")
+ description: qsTr("Specify a custom action.")
value: ""
}
-
onSelectedValueChanged: {
_app.action = selectedValue
}
+ onCreationCompleted: {
+ _app.action = selectedValue
+ }
}
//! [2]
-
TextField {
visible: (actionSelector.selectedValue == "")
- hintText: qsTr ("[Custom Action]")
-
+ hintText: qsTr("E.g. com.example.BEBOLD")
onTextChanging: {
_app.action = text
}
+ onCreationCompleted: {
+ _app.action = text
+ }
+ }
+ Header {
+ title: "MIME Type"
}
-
//! [3]
TextField {
- hintText: qsTr ("[MIME Type]")
- text: "image/png"
-
+ hintText: qsTr("E.g. image/png")
+ text: "text/plain"
onTextChanging: {
_app.mimeType = text
}
+ onCreationCompleted: {
+ _app.mimeType = text
+ }
}
//! [3]
-
+ Header {
+ title: "URI"
+ }
TextField {
- hintText: qsTr ("[URI]")
-
+ hintText: qsTr("E.g. file:///path/to/my/file.png")
onTextChanging: {
_app.uri = text
}
+ onCreationCompleted: {
+ _app.uri = text
+ }
+ }
+ Header {
+ title: "Data"
}
-
TextField {
- hintText: qsTr ("[Data]")
-
- text: qsTr ("Test data..")
-
+ hintText: qsTr("E.g. anything!")
+ text: qsTr("Test data..")
onTextChanging: {
_app.data = text
}
+ onCreationCompleted: {
+ _app.data = text
+ }
+ }
+ Header {
+ title: "Target ID"
}
-
TextField {
- hintText: qsTr ("[Target ID - for Bound Invocation]")
-
+ hintText: qsTr("E.g. com.example.app")
onTextChanging: {
_app.target = text
}
+ onCreationCompleted: {
+ _app.target = text
+ }
}
-
Label {
text: _app.statusMessage
}
@@ -281,8 +214,8 @@ Page {
//! [4]
attachedObjects: [
- QueryResultSheet {},
- ErrorDialog {}
+ QueryResultSheet {
+ }
]
//! [4]
}
View
4 invokeclient/bar-descriptor.xml
@@ -65,7 +65,7 @@
<!-- The category where the application appears. Either core.games or core.media. -->
<category>core.games</category>
<icon>
- <image>icon.png</image>
+ <image>invoke.png</image>
</icon>
<configuration id="com.qnx.qcc.toolChain.131834024" name="Default">
<platformArchitecture>armle-v7</platformArchitecture>
@@ -97,10 +97,12 @@
<include name="*.qm"/>
</asset>
<asset path="icon.png">icon.png</asset>
+ <asset path="assets/images/invoke.png">invoke.png</asset>
<!-- Request permission to execute native code. Required for native applications. -->
<permission system="true">run_native</permission>
<env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>
+ <cascadesTheme>dark</cascadesTheme>
<!-- The permissions requested by your application. -->
<!-- <permission>access_shared</permission> -->
View
555 invokeclient/src/app.cpp
@@ -1,17 +1,17 @@
/* Copyright (c) 2012 Research In Motion Limited.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include "app.hpp"
@@ -30,347 +30,324 @@ using namespace bb::cascades;
using namespace bb::system;
//! [0]
-App::App(QObject *parent)
- : QObject(parent)
- , m_targetType(0)
- , m_action(QLatin1String("bb.action.OPEN"))
- , m_mimeType(QLatin1String("image/png"))
- , m_model(new GroupDataModel(this))
- , m_invokeManager(new InvokeManager(this))
-{
- // Disable item grouping in the targets result list
- m_model->setGrouping(ItemGrouping::None);
-
- // Create signal/slot connections to handle card status changes
- connect(m_invokeManager, SIGNAL(childCardDone(const bb::system::CardDoneMessage&)), this, SLOT(childCardDone(const bb::system::CardDoneMessage&)));
- connect(m_invokeManager, SIGNAL(peekStarted(bb::system::CardPeek::Type)), this, SLOT(peekStarted(bb::system::CardPeek::Type)));
- connect(m_invokeManager, SIGNAL(peekEnded()), this, SLOT(peekEnded()));
-
- // Load the UI from the QML file
- QmlDocument *qml = QmlDocument::create("asset:///main.qml");
- qml->setContextProperty("_app", this);
-
- AbstractPane *root = qml->createRootObject<AbstractPane>();
- Application::instance()->setScene(root);
+App::App(QObject *parent) :
+ QObject(parent), m_targetType(0), m_action(QLatin1String("bb.action.OPEN")), m_mimeType(QLatin1String("image/png")), m_model(new GroupDataModel(this)), m_invokeManager(new InvokeManager(this)), m_dialog(new SystemDialog(this)) {
+ // Disable item grouping in the targets result list
+ m_model->setGrouping(ItemGrouping::None);
+
+ // Create signal/slot connections to handle card status changes
+ connect(m_invokeManager, SIGNAL(childCardDone(const bb::system::CardDoneMessage&)), this, SLOT(childCardDone(const bb::system::CardDoneMessage&)));
+ connect(m_invokeManager, SIGNAL(peekStarted(bb::system::CardPeek::Type)), this, SLOT(peekStarted(bb::system::CardPeek::Type)));
+ connect(m_invokeManager, SIGNAL(peekEnded()), this, SLOT(peekEnded()));
+
+ // Load the UI from the QML file
+ QmlDocument *qml = QmlDocument::create("asset:///main.qml");
+ qml->setContextProperty("_app", this);
+
+ AbstractPane *root = qml->createRootObject<AbstractPane>();
+ Application::instance()->setScene(root);
}
//! [0]
//! [1]
-void App::invoke()
-{
- // Create a new invocation request
- InvokeRequest request;
-
- // Setup the request properties according to the current configuration
- if (!m_action.isEmpty()) {
- if (m_action != QLatin1String("__All") && m_action != QLatin1String("__MenuActions")) {
- request.setAction(m_action);
- } else if (m_target.isEmpty()) {
- m_errorMessage = tr("[%1] is not a valid action type for an unbound invocation.").arg(m_action);
- emit errorMessageChanged();
- return;
- }
- }
-
- if (!m_mimeType.isEmpty()) {
- request.setMimeType(m_mimeType);
- } else {
- m_errorMessage = tr("MIME type must be specified!");
- emit errorMessageChanged();
- return;
- }
-
- if (!m_uri.isEmpty())
- request.setUri(m_uri);
-
- if (!m_data.isEmpty())
- request.setData(m_data.toUtf8());
-
- if (!m_target.isEmpty())
- request.setTarget(m_target);
-
- // Start the invocation
- const InvokeReply *reply = m_invokeManager->invoke(request);
- if (reply) {
- // Ensure that processInvokeReply() is called when the invocation has finished
- QObject::connect(reply, SIGNAL(finished()), this, SLOT(processInvokeReply()));
- } else {
- m_errorMessage = tr("Invoke Failed! InvokeReply is empty.");
- emit errorMessageChanged();
- return;
- }
+void App::invoke() {
+ // Create a new invocation request
+ InvokeRequest request;
+
+ // Setup the request properties according to the current configuration
+ if (m_action.length() > 0) {
+ request.setAction(m_action);
+ }
+
+ if (m_mimeType.length() > 0) {
+ request.setMimeType(m_mimeType);
+ }
+
+ if (m_uri.length() > 0) {
+ request.setUri(m_uri);
+ }
+
+ if (m_data.length() > 0) {
+ request.setData(m_data.toUtf8());
+ }
+
+ if (m_target.length() > 0) {
+ request.setTarget(m_target);
+ }
+
+ // Start the invocation
+ const InvokeReply *reply = m_invokeManager->invoke(request);
+ if (reply) {
+ // Ensure that processInvokeReply() is called when the invocation has finished
+ QObject::connect(reply, SIGNAL(finished()), this, SLOT(processInvokeReply()));
+ } else {
+ m_errorMessage = tr("Invoke Failed! Reply object is empty.");
+ showErrorDialog();
+ return;
+ }
}
//! [1]
+void App::platformInvoke() {
+ // Create a new Invocation
+ m_invocation = Invocation::create(InvokeQuery::create().parent(this).invokeActionId(m_action).mimeType(m_mimeType).uri(m_uri).data(m_data.toUtf8()).invokeTargetId(m_target));
+ // connect armed() to trigger the invocation onArmed()
+ QObject::connect(m_invocation, SIGNAL(armed()), this, SLOT(onArmed()));
+ // cleanup later
+ QObject::connect(m_invocation, SIGNAL(finished()), m_invocation, SLOT(deleteLater()));
+}
+
+void App::onArmed(){
+ m_invocation->trigger(m_action);
+}
+
//! [2]
-void App::query()
-{
- // Create a new query targets request
- InvokeQueryTargetsRequest request;
-
- // Setup the request properties according to the current configuration
- if (m_targetType == 0)
- request.setTargetTypes(InvokeTarget::Application | InvokeTarget::Card | InvokeTarget::Viewer | InvokeTarget::Service);
- else if (m_targetType == 1)
- request.setTargetTypes(InvokeTarget::Application);
- else if (m_targetType == 2)
- request.setTargetTypes(InvokeTarget::Viewer);
- else if (m_targetType == 3)
- request.setTargetTypes(InvokeTarget::Service);
- else if (m_targetType == 4)
- request.setTargetTypes(InvokeTarget::Card);
-
- if (!m_action.isEmpty()) {
- if (m_action == QLatin1String("__All"))
- request.setActionType(InvokeAction::All);
- else if (m_action == QLatin1String("__MenuActions"))
- request.setActionType(InvokeAction::Menu);
- else
- request.setAction(m_action);
- }
-
- if (m_mimeType.isEmpty() && m_uri.isEmpty()) {
- m_errorMessage = tr("MIME type OR URI must be specified!");
- emit errorMessageChanged();
- return;
- }
-
- if (!m_mimeType.isEmpty())
- request.setMimeType(m_mimeType);
-
- if (!m_uri.isEmpty())
- request.setUri(m_uri);
-
- // Start the query
- const InvokeReply *reply = m_invokeManager->queryTargets(request);
-
- // Ensure that processQueryReply() is called when the query has finished
- QObject::connect(reply, SIGNAL(finished()), this, SLOT(processQueryReply()));
+void App::query() {
+// Create a new query targets request
+ InvokeQueryTargetsRequest request;
+
+// Setup the request properties according to the current configuration
+ if (m_targetType == 0)
+ request.setTargetTypes(InvokeTarget::Application | InvokeTarget::Card | InvokeTarget::Viewer | InvokeTarget::Service);
+ else if (m_targetType == 1)
+ request.setTargetTypes(InvokeTarget::Application);
+ else if (m_targetType == 2)
+ request.setTargetTypes(InvokeTarget::Viewer);
+ else if (m_targetType == 3)
+ request.setTargetTypes(InvokeTarget::Service);
+ else if (m_targetType == 4)
+ request.setTargetTypes(InvokeTarget::Card);
+
+ if (!m_action.isEmpty()) {
+ if (m_action == QLatin1String("__All"))
+ request.setActionType(InvokeAction::All);
+ else if (m_action == QLatin1String("__MenuActions"))
+ request.setActionType(InvokeAction::Menu);
+ else
+ request.setAction(m_action);
+ }
+
+ if (!m_mimeType.isEmpty())
+ request.setMimeType(m_mimeType);
+
+ if (!m_uri.isEmpty())
+ request.setUri(m_uri);
+
+// Start the query
+ const InvokeReply *reply = m_invokeManager->queryTargets(request);
+
+// Ensure that processQueryReply() is called when the query has finished
+ QObject::connect(reply, SIGNAL(finished()), this, SLOT(processQueryReply()));
}
//! [2]
//! [3]
-void App::invokeTarget(const QString &target)
-{
- // Setup the configuration to invoke the given target
- m_targetType = 0;
- m_target = target;
+void App::invokeTarget(const QString &target) {
+// Setup the configuration to invoke the given target
+ m_targetType = 0;
+ m_target = target;
- emit closeQueryResults();
+ emit closeQueryResults();
- // Trigger the invocation
- invoke();
+// Trigger the invocation
+ invoke();
}
//! [3]
-void App::clearError()
-{
- m_errorMessage.clear();
- emit errorMessageChanged();
+void App::clearError() {
+ m_errorMessage.clear();
+ showErrorDialog();
}
//! [4]
-void App::processInvokeReply()
-{
- // Get the reply from the sender object
- InvokeReply *reply = qobject_cast<InvokeReply*>(sender());
-
- // Check for errors during invocation
- switch (reply->error()) {
- case InvokeReplyError::BadRequest:
- m_errorMessage = tr("[ErrorBadRequest] Invoke Failed!");
- emit errorMessageChanged();
- break;
- case InvokeReplyError::Internal:
- m_errorMessage = tr("[ErrorInternal] Invoke Failed!");
- emit errorMessageChanged();
- break;
- case InvokeReplyError::NoTarget:
- m_errorMessage = tr("[ErrorNoTarget] Invoke Failed!");
- emit errorMessageChanged();
- break;
- case InvokeReplyError::TargetNotOwned:
- m_errorMessage = tr("[ErrorTargetNotOwned] Invoke Failed.");
- emit errorMessageChanged();
- break;
- default:
- break;
- }
-
- // Delete the reply later on
- reply->deleteLater();
+void App::processInvokeReply() {
+// Get the reply from the sender object
+ InvokeReply *reply = qobject_cast<InvokeReply*>(sender());
+
+// Check for errors during invocation
+ switch (reply->error()) {
+ case InvokeReplyError::BadRequest:
+ m_errorMessage = tr("[ErrorBadRequest] Invoke Failed!");
+ showErrorDialog();
+ break;
+ case InvokeReplyError::Internal:
+ m_errorMessage = tr("[ErrorInternal] Invoke Failed!");
+ showErrorDialog();
+ break;
+ case InvokeReplyError::NoTarget:
+ m_errorMessage = tr("[ErrorNoTarget] Invoke Failed!");
+ showErrorDialog();
+ break;
+ case InvokeReplyError::TargetNotOwned:
+ m_errorMessage = tr("[ErrorTargetNotOwned] Invoke Failed.");
+ showErrorDialog();
+ break;
+ default:
+ break;
+ }
+
+// Delete the reply later on
+ reply->deleteLater();
}
//! [4]
//! [5]
-void App::processQueryReply()
-{
- // Get the reply from the sender object
- InvokeQueryTargetsReply *reply = qobject_cast<InvokeQueryTargetsReply*>(sender());
-
- if (reply->error() == InvokeReplyError::None) { // If no error occurred ...
- // Clear the target result model
- m_model->clear();
-
- // Iterate over the reported actions and targets
- foreach (const InvokeAction &action, reply->actions()) {
- foreach (const InvokeTarget &target, action.targets()) {
- // Add one entry to the model for each target
- QVariantMap entry;
- entry["label"] = target.label();
- entry["name"] = target.name();
- entry["imageSource"] = target.icon();
-
- m_model->insert(entry);
- }
- }
-
- // Signal that the query was successful
- emit queryFinished();
- }
-
- // Check for errors during invocation
- switch (reply->error()) {
- case InvokeReplyError::BadRequest:
- m_errorMessage = tr("[ErrorBadRequest] Query Failed!");
- emit errorMessageChanged();
- break;
- case InvokeReplyError::Internal:
- m_errorMessage = tr("[ErrorInternal] Query Failed!");
- emit errorMessageChanged();
- break;
- case InvokeReplyError::NoTarget:
- m_errorMessage = tr("[ErrorNoTarget] Query Failed!");
- emit errorMessageChanged();
- break;
- case InvokeReplyError::TargetNotOwned:
- m_errorMessage = tr("[ErrorTargetNotOwned] Query Failed.");
- emit errorMessageChanged();
- break;
- default:
- break;
- }
-
- // Delete the reply later on
- reply->deleteLater();
+void App::processQueryReply() {
+// Get the reply from the sender object
+ InvokeQueryTargetsReply *reply = qobject_cast<InvokeQueryTargetsReply*>(sender());
+
+ if (reply->error() == InvokeReplyError::None) { // If no error occurred ...
+ // Clear the target result model
+ m_model->clear();
+
+ // Iterate over the reported actions and targets
+ foreach (const InvokeAction &action, reply->actions()){
+ foreach (const InvokeTarget &target, action.targets()) {
+ // Add one entry to the model for each target
+ QVariantMap entry;
+ entry["label"] = target.label();
+ entry["name"] = target.name();
+ entry["imageSource"] = target.icon();
+
+ m_model->insert(entry);
+ }
+ }
+
+// Signal that the query was successful
+ emit
+ queryFinished();
+ }
+
+// Check for errors during invocation
+ switch (reply->error()) {
+ case InvokeReplyError::BadRequest:
+ m_errorMessage = tr("[ErrorBadRequest] Query Failed!");
+ showErrorDialog();
+ break;
+ case InvokeReplyError::Internal:
+ m_errorMessage = tr("[ErrorInternal] Query Failed!");
+ showErrorDialog();
+ break;
+ case InvokeReplyError::NoTarget:
+ m_errorMessage = tr("[ErrorNoTarget] Query Failed!");
+ showErrorDialog();
+ break;
+ case InvokeReplyError::TargetNotOwned:
+ m_errorMessage = tr("[ErrorTargetNotOwned] Query Failed.");
+ showErrorDialog();
+ break;
+ default:
+ break;
+ }
+
+// Delete the reply later on
+ reply->deleteLater();
}
//! [5]
-void App::peekStarted(bb::system::CardPeek::Type)
-{
- m_statusMessage = tr("Peek Status: Started");
- emit statusMessageChanged();
+void App::peekStarted(bb::system::CardPeek::Type) {
+ m_statusMessage = tr("Peek Status: Started");
+ emit statusMessageChanged();
+}
+
+void App::peekEnded() {
+ m_statusMessage = tr("Peek Status: Ended");
+ emit statusMessageChanged();
}
-void App::peekEnded()
-{
- m_statusMessage = tr("Peek Status: Ended");
- emit statusMessageChanged();
+void App::childCardDone(const bb::system::CardDoneMessage &message) {
+ if (!message.data().isEmpty()) {
+ m_statusMessage = message.data();
+ emit statusMessageChanged();
+ }
}
-void App::childCardDone(const bb::system::CardDoneMessage &message)
-{
- if (!message.data().isEmpty()) {
- m_statusMessage = message.data();
- emit statusMessageChanged();
- }
+void App::showErrorDialog() {
+ m_dialog->setTitle("Error");
+ m_dialog->setBody(m_errorMessage);
+ m_dialog->show();
}
-int App::targetType() const
-{
- return m_targetType;
+int App::targetType() const {
+ return m_targetType;
}
-void App::setTargetType(int targetType)
-{
- if (m_targetType == targetType)
- return;
+void App::setTargetType(int targetType) {
+ if (m_targetType == targetType)
+ return;
- m_targetType = targetType;
- emit targetTypeChanged();
+ m_targetType = targetType;
+ emit targetTypeChanged();
}
-QString App::action() const
-{
- return m_action;
+QString App::action() const {
+ return m_action;
}
-void App::setAction(const QString &action)
-{
- if (m_action == action)
- return;
+void App::setAction(const QString &action) {
+ if (m_action == action)
+ return;
- m_action = action;
- emit actionChanged();
+ m_action = action;
+ emit actionChanged();
}
-QString App::mimeType() const
-{
- return m_mimeType;
+QString App::mimeType() const {
+ return m_mimeType;
}
-void App::setMimeType(const QString &mimeType)
-{
- if (m_mimeType == mimeType)
- return;
+void App::setMimeType(const QString &mimeType) {
+ if (m_mimeType == mimeType)
+ return;
- m_mimeType = mimeType;
- emit mimeTypeChanged();
+ m_mimeType = mimeType;
+ emit mimeTypeChanged();
}
-QString App::uri() const
-{
- return m_uri;
+QString App::uri() const {
+ return m_uri;
}
-void App::setUri(const QString &uri)
-{
- if (m_uri == uri)
- return;
+void App::setUri(const QString &uri) {
+ if (m_uri == uri)
+ return;
- m_uri = uri;
- emit uriChanged();
+ m_uri = uri;
+ emit uriChanged();
}
-QString App::data() const
-{
- return m_data;
+QString App::data() const {
+ return m_data;
}
-void App::setData(const QString &data)
-{
- if (m_data == data)
- return;
+void App::setData(const QString &data) {
+ if (m_data == data)
+ return;
- m_data = data;
- emit dataChanged();
+ m_data = data;
+ emit dataChanged();
}
-QString App::target() const
-{
- return m_target;
+QString App::target() const {
+ return m_target;
}
-void App::setTarget(const QString &target)
-{
- if (m_target == target)
- return;
+void App::setTarget(const QString &target) {
+ if (m_target == target)
+ return;
- m_target = target;
- emit targetChanged();
+ m_target = target;
+ emit targetChanged();
}
-bb::cascades::GroupDataModel* App::model() const
-{
- return m_model;
+bb::cascades::GroupDataModel* App::model() const {
+ return m_model;
}
-QString App::errorMessage() const
-{
- return m_errorMessage;
+QString App::errorMessage() const {
+ return m_errorMessage;
}
-QString App::statusMessage() const
-{
- return m_statusMessage;
+QString App::statusMessage() const {
+ return m_statusMessage;
}
View
21 invokeclient/src/app.hpp
@@ -19,13 +19,16 @@
#include <bb/cascades/GroupDataModel>
#include <bb/system/CardDoneMessage>
#include <bb/system/InvokeManager>
-
+#include <bb/system/SystemDialog.hpp>
+#include <bb/cascades/Invocation>
+#include <bb/cascades/InvokeQuery>
#include <QObject>
/*!
* @brief Application GUI object
*/
//! [0]
+
class App : public QObject
{
Q_OBJECT
@@ -50,19 +53,26 @@ class App : public QObject
public:
App(QObject *parent = 0);
+
public Q_SLOTS:
// This method is called to invoke another application with the current configuration
void invoke();
// This method is called to query for all applications that can be invoked with the current configuration
void query();
+ // This method invokes the menu service with the Invoke Request. Only works with platform actions such as SET, SHARE, OPEN etc.
+ void platformInvoke();
+
// This method is called to invoke a specific application with the given @p target id
void invokeTarget(const QString &target);
// This method clears the current error message
void clearError();
+ // This method shows an error dialog with he current error message
+ void showErrorDialog();
+
Q_SIGNALS:
// The change notification signals of the properties
void targetTypeChanged();
@@ -96,6 +106,9 @@ private Q_SLOTS:
// This slot updates the status message when the invocation of a card is done
void childCardDone(const bb::system::CardDoneMessage&);
+ // This slot triggers the platform invocation via m_invocation
+ void onArmed();
+
private:
// The accessor methods of the properties
int targetType() const;
@@ -125,8 +138,14 @@ private Q_SLOTS:
QString m_errorMessage;
QString m_statusMessage;
+ // The error dialog
+ bb::system::SystemDialog* m_dialog;
+
// The central object to manage invocations
bb::system::InvokeManager* m_invokeManager;
+
+ // The Invocation object for platform ivnocations
+ bb::cascades::Invocation* m_invocation;
};
//! [0]
View
212 invokeclient/translations/invokeclient.ts
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>App</name>
+ <message>
+ <location filename="../src/app.cpp" line="84"/>
+ <source>Invoke Failed! Reply object is empty.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="170"/>
+ <source>[ErrorBadRequest] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="174"/>
+ <source>[ErrorInternal] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="178"/>
+ <source>[ErrorNoTarget] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="182"/>
+ <source>[ErrorTargetNotOwned] Invoke Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="224"/>
+ <source>[ErrorBadRequest] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="228"/>
+ <source>[ErrorInternal] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="232"/>
+ <source>[ErrorNoTarget] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="236"/>
+ <source>[ErrorTargetNotOwned] Query Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="249"/>
+ <source>Peek Status: Started</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="254"/>
+ <source>Peek Status: Ended</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>main</name>
+ <message>
+ <location filename="../assets/main.qml" line="21"/>
+ <source>Invoke (best-fit)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="29"/>
+ <source>Query</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="38"/>
+ <source>Platform Invoke</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="70"/>
+ <source>Invocation Type:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="73"/>
+ <location filename="../assets/main.qml" line="109"/>
+ <source>All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="74"/>
+ <source>All types of invocation targets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="78"/>
+ <source>Application</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="79"/>
+ <source>Targets that launch in a new window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="83"/>
+ <source>Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="84"/>
+ <source>Targets that launch in background.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="88"/>
+ <source>Card</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="89"/>
+ <source>Targets that embeds as Card.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="107"/>
+ <source>Action:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="110"/>
+ <location filename="../assets/main.qml" line="115"/>
+ <source>Valid for queries only.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="114"/>
+ <source>Menu Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="119"/>
+ <source>bb.action.OPEN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="120"/>
+ <source>A menu action for opening content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="124"/>
+ <source>bb.action.SET</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="125"/>
+ <source>A menu action for setting content as</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="130"/>
+ <source>bb.action.SHARE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="131"/>
+ <source>A menu action for sharing content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="135"/>
+ <source>Custom</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="136"/>
+ <source>Specify a custom action.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="149"/>
+ <source>E.g. com.example.BEBOLD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="162"/>
+ <source>E.g. image/png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="176"/>
+ <source>E.g. file:///path/to/my/file.png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="188"/>
+ <source>E.g. anything!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="189"/>
+ <source>Test data..</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="201"/>
+ <source>E.g. com.example.app</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
View
212 invokeclient/translations/invokeclient_de.ts
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="de_DE">
+<context>
+ <name>App</name>
+ <message>
+ <location filename="../src/app.cpp" line="84"/>
+ <source>Invoke Failed! Reply object is empty.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="170"/>
+ <source>[ErrorBadRequest] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="174"/>
+ <source>[ErrorInternal] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="178"/>
+ <source>[ErrorNoTarget] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="182"/>
+ <source>[ErrorTargetNotOwned] Invoke Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="224"/>
+ <source>[ErrorBadRequest] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="228"/>
+ <source>[ErrorInternal] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="232"/>
+ <source>[ErrorNoTarget] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="236"/>
+ <source>[ErrorTargetNotOwned] Query Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="249"/>
+ <source>Peek Status: Started</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="254"/>
+ <source>Peek Status: Ended</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>main</name>
+ <message>
+ <location filename="../assets/main.qml" line="21"/>
+ <source>Invoke (best-fit)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="29"/>
+ <source>Query</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="38"/>
+ <source>Platform Invoke</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="70"/>
+ <source>Invocation Type:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="73"/>
+ <location filename="../assets/main.qml" line="109"/>
+ <source>All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="74"/>
+ <source>All types of invocation targets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="78"/>
+ <source>Application</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="79"/>
+ <source>Targets that launch in a new window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="83"/>
+ <source>Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="84"/>
+ <source>Targets that launch in background.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="88"/>
+ <source>Card</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="89"/>
+ <source>Targets that embeds as Card.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="107"/>
+ <source>Action:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="110"/>
+ <location filename="../assets/main.qml" line="115"/>
+ <source>Valid for queries only.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="114"/>
+ <source>Menu Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="119"/>
+ <source>bb.action.OPEN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="120"/>
+ <source>A menu action for opening content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="124"/>
+ <source>bb.action.SET</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="125"/>
+ <source>A menu action for setting content as</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="130"/>
+ <source>bb.action.SHARE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="131"/>
+ <source>A menu action for sharing content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="135"/>
+ <source>Custom</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="136"/>
+ <source>Specify a custom action.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="149"/>
+ <source>E.g. com.example.BEBOLD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="162"/>
+ <source>E.g. image/png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="176"/>
+ <source>E.g. file:///path/to/my/file.png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="188"/>
+ <source>E.g. anything!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="189"/>
+ <source>Test data..</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="201"/>
+ <source>E.g. com.example.app</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
View
212 invokeclient/translations/invokeclient_en_GB.ts
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_GB">
+<context>
+ <name>App</name>
+ <message>
+ <location filename="../src/app.cpp" line="84"/>
+ <source>Invoke Failed! Reply object is empty.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="170"/>
+ <source>[ErrorBadRequest] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="174"/>
+ <source>[ErrorInternal] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="178"/>
+ <source>[ErrorNoTarget] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="182"/>
+ <source>[ErrorTargetNotOwned] Invoke Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="224"/>
+ <source>[ErrorBadRequest] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="228"/>
+ <source>[ErrorInternal] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="232"/>
+ <source>[ErrorNoTarget] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="236"/>
+ <source>[ErrorTargetNotOwned] Query Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="249"/>
+ <source>Peek Status: Started</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="254"/>
+ <source>Peek Status: Ended</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>main</name>
+ <message>
+ <location filename="../assets/main.qml" line="21"/>
+ <source>Invoke (best-fit)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="29"/>
+ <source>Query</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="38"/>
+ <source>Platform Invoke</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="70"/>
+ <source>Invocation Type:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="73"/>
+ <location filename="../assets/main.qml" line="109"/>
+ <source>All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="74"/>
+ <source>All types of invocation targets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="78"/>
+ <source>Application</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="79"/>
+ <source>Targets that launch in a new window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="83"/>
+ <source>Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="84"/>
+ <source>Targets that launch in background.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="88"/>
+ <source>Card</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="89"/>
+ <source>Targets that embeds as Card.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="107"/>
+ <source>Action:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="110"/>
+ <location filename="../assets/main.qml" line="115"/>
+ <source>Valid for queries only.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="114"/>
+ <source>Menu Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="119"/>
+ <source>bb.action.OPEN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="120"/>
+ <source>A menu action for opening content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="124"/>
+ <source>bb.action.SET</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="125"/>
+ <source>A menu action for setting content as</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="130"/>
+ <source>bb.action.SHARE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="131"/>
+ <source>A menu action for sharing content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="135"/>
+ <source>Custom</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="136"/>
+ <source>Specify a custom action.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="149"/>
+ <source>E.g. com.example.BEBOLD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="162"/>
+ <source>E.g. image/png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="176"/>
+ <source>E.g. file:///path/to/my/file.png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="188"/>
+ <source>E.g. anything!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="189"/>
+ <source>Test data..</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="201"/>
+ <source>E.g. com.example.app</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
View
212 invokeclient/translations/invokeclient_es.ts
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="es_ES">
+<context>
+ <name>App</name>
+ <message>
+ <location filename="../src/app.cpp" line="84"/>
+ <source>Invoke Failed! Reply object is empty.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="170"/>
+ <source>[ErrorBadRequest] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="174"/>
+ <source>[ErrorInternal] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="178"/>
+ <source>[ErrorNoTarget] Invoke Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="182"/>
+ <source>[ErrorTargetNotOwned] Invoke Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="224"/>
+ <source>[ErrorBadRequest] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="228"/>
+ <source>[ErrorInternal] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="232"/>
+ <source>[ErrorNoTarget] Query Failed!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="236"/>
+ <source>[ErrorTargetNotOwned] Query Failed.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="249"/>
+ <source>Peek Status: Started</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="254"/>
+ <source>Peek Status: Ended</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>main</name>
+ <message>
+ <location filename="../assets/main.qml" line="21"/>
+ <source>Invoke (best-fit)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="29"/>
+ <source>Query</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="38"/>
+ <source>Platform Invoke</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="70"/>
+ <source>Invocation Type:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="73"/>
+ <location filename="../assets/main.qml" line="109"/>
+ <source>All</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="74"/>
+ <source>All types of invocation targets.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="78"/>
+ <source>Application</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="79"/>
+ <source>Targets that launch in a new window.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="83"/>
+ <source>Service</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="84"/>
+ <source>Targets that launch in background.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="88"/>
+ <source>Card</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="89"/>
+ <source>Targets that embeds as Card.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="107"/>
+ <source>Action:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="110"/>
+ <location filename="../assets/main.qml" line="115"/>
+ <source>Valid for queries only.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="114"/>
+ <source>Menu Actions</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="119"/>
+ <source>bb.action.OPEN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="120"/>
+ <source>A menu action for opening content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="124"/>
+ <source>bb.action.SET</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="125"/>
+ <source>A menu action for setting content as</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="130"/>
+ <source>bb.action.SHARE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="131"/>
+ <source>A menu action for sharing content.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="135"/>
+ <source>Custom</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="136"/>
+ <source>Specify a custom action.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="149"/>
+ <source>E.g. com.example.BEBOLD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="162"/>
+ <source>E.g. image/png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="176"/>
+ <source>E.g. file:///path/to/my/file.png</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="188"/>
+ <source>E.g. anything!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="189"/>
+ <source>Test data..</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../assets/main.qml" line="201"/>
+ <source>E.g. com.example.app</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
View
212 invokeclient/translations/invokeclient_fr.ts
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>App</name>
+ <message>
+ <location filename="../src/app.cpp" line="84"/>
+ <source>Invoke Failed! Reply object is empty.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/app.cpp" line="170"/>
+ <source>[ErrorBadRequest] Invoke Failed!</source>
+ <translation type="unfinished"></translation>