diff --git a/plasmoid/contents/ui/RecipeDelegate.qml b/plasmoid/contents/ui/RecipeDelegate.qml --- a/plasmoid/contents/ui/RecipeDelegate.qml +++ b/plasmoid/contents/ui/RecipeDelegate.qml @@ -32,6 +32,7 @@ anchors.left: parent.left anchors.right: parent.right width: cbwidth + property alias viewbtnClickItem: recipeViewBtn Column { id: contentdlgtitem diff --git a/plasmoid/contents/ui/RecipeType.qml b/plasmoid/contents/ui/RecipeType.qml --- a/plasmoid/contents/ui/RecipeType.qml +++ b/plasmoid/contents/ui/RecipeType.qml @@ -31,6 +31,22 @@ width: cbwidth color: theme.backgroundColor property alias recipeReadLVModel: recipeReadListView.model + + Connections { + target: main2 + ignoreUnknownSignals: true + + onRecipeMethod: { + var getRecipeTitle = msgRecipeMethod + for (var i = 0; i < recipeLmodel.count; i++) { + var recipemodelLables = recipeLmodel.get(i).recipeLabel.toLowerCase(); + recipemodelLables.replace(/\W/g, ''); + if (recipemodelLables == getRecipeTitle) { + recipesmodelview.contentItem.children[i].viewbtnClickItem.clicked() + } + } + } + } ListView { id: recipesmodelview diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -81,6 +81,8 @@ Connections { target: main2 + ignoreUnknownSignals: true + onSendShowMycroft: { plasmoid.expanded = !plasmoid.expanded tabBar.currentTab = mycroftTab @@ -91,7 +93,7 @@ plasmoid.expanded } } - onSendShowSkillsInstaller: { + onInstallList: { tabBar.currentTab = mycroftMSMinstTab if(plasmoid.expanded = !plasmoid.expanded){ plasmoid.expanded diff --git a/plugin/mycroftplasmoid_dbus.h b/plugin/mycroftplasmoid_dbus.h --- a/plugin/mycroftplasmoid_dbus.h +++ b/plugin/mycroftplasmoid_dbus.h @@ -45,12 +45,18 @@ " \n" " \n" " \n" -" \n" +" \n" " \n" " \n" +" \n" +" \n" +" \n" " \n" " \n" " \n" +" \n" +" \n" +" \n" " \n" "") public: @@ -63,10 +69,12 @@ void showMycroft(); void showSkills(); void showSkillsInstaller(); + void showRecipeMethod(const QString &recipeName); Q_SIGNALS: // SIGNALS - void sendShowInstallSkills(const QString &msgShowInstallSkills); void sendShowMycroft(const QString &msgShowMycroft); void sendShowSkills(const QString &msgShowSkills); + void installList(const QString &msgShowInstallSkills); + void recipeMethod(const QString &msgRecipeMethod); }; #endif diff --git a/plugin/mycroftplasmoid_dbus.cpp b/plugin/mycroftplasmoid_dbus.cpp --- a/plugin/mycroftplasmoid_dbus.cpp +++ b/plugin/mycroftplasmoid_dbus.cpp @@ -57,14 +57,21 @@ { // handle method call org.kde.mycroft.showSkills emit sendShowSkills("ShowSkills"); - //QMetaObject::invokeMethod(this, "showSkills"); + QMetaObject::invokeMethod(this, "getMethod", Qt::DirectConnection, Q_ARG(QString, "ShowSkills")); } void MycroftDbusAdapterInterface::showSkillsInstaller() { // handle method call org.kde.mycroft.showSkillsInstaller - emit sendShowInstallSkills("ShowInstallSkills"); - //QMetaObject::invokeMethod(this, "showSkillsInstaller"); + emit installList("ShowInstallSkills"); + QMetaObject::invokeMethod(this, "getMethod", Qt::DirectConnection, Q_ARG(QString, "ShowInstallSkills")); +} + +void MycroftDbusAdapterInterface::showRecipeMethod(const QString &recipeName) +{ + // handle method call org.kde.mycroft.showRecipeMethod + emit recipeMethod(recipeName); + QMetaObject::invokeMethod(this, "getMethod", Qt::DirectConnection, Q_ARG(QString, recipeName)); } Q_INVOKABLE QString MycroftDbusAdapterInterface::getMethod(const QString &method)