diff --git a/ui/view/applications.qml b/ui/view/applications.qml index 691c2b88e..2db7a1c60 100644 --- a/ui/view/applications.qml +++ b/ui/view/applications.qml @@ -16,6 +16,7 @@ ColumnLayout { property bool hasApps: !!appsList && appsList.length > 0 property string errorMessage: "" property var activeApp: undefined + property string appCmd: "" ApplicationsViewModel { id: viewModel @@ -493,9 +494,16 @@ ColumnLayout { Component.onCompleted: { if (settings.dappsAllowed) { - loadAppsList() + if (appCmd.length && appCmd == "daocore") { + // TODO(chapati): load daocore from here + // https://github.com/BeamMW/beam-ui/issues/695 + console.log("open daocore"); + loadAppsList(); + } else { + loadAppsList(); + } } else { - appsDialog.open() + appsDialog.open(); } } } diff --git a/ui/view/assets/icon-daocore-active.svg b/ui/view/assets/icon-daocore-active.svg new file mode 100644 index 000000000..47c8cdf3c --- /dev/null +++ b/ui/view/assets/icon-daocore-active.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/ui/view/assets/icon-daocore.svg b/ui/view/assets/icon-daocore.svg new file mode 100644 index 000000000..d8da98cd0 --- /dev/null +++ b/ui/view/assets/icon-daocore.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/ui/view/main.qml b/ui/view/main.qml index 952981bd3..2efcedf23 100644 --- a/ui/view/main.qml +++ b/ui/view/main.qml @@ -153,15 +153,17 @@ Rectangle { } property var contentItems : [ - {name: "wallet"}, + {name: "wallet"}, {name: "atomic_swap"}, // {name: "dex"}, - {name: "addresses"}, + {name: "addresses"}, {name: "notifications"}, - {name: "applications", qml: function () { - return BeamGlobals.isFork3() ? "applications" : "applications_nofork" - }} - ] + {name: "applications", qml: function () { + return BeamGlobals.isFork3() ? "applications" : "applications_nofork" + } + }, + {name: "daocore"} + ] property int selectedItem @@ -358,14 +360,26 @@ Rectangle { var update = function(index) { selectedItem = index; var source = ""; + var args = Object.assign({"openSend": false}, props); if (index >= 0) { controls.itemAt(index).focus = true; - source = ["qrc:/", contentItems[index].qml ? contentItems[index].qml() : contentItems[index].name, ".qml"].join('') + function isApp(element, index, array) { + return element.qml && (contentItems[index].qml() == "applications" || contentItems[index].qml() == "applications_nofork"); + } + + var appIndex = contentItems.findIndex(isApp); + if (appIndex >= 0 && index > appIndex) { + source = "qrc:/applications.qml"; + args = Object.assign({"appCmd": contentItems[index].name}, args); + } else { + source = ["qrc:/", contentItems[index].qml ? contentItems[index].qml() : contentItems[index].name, ".qml"].join(''); + } + } else if (index == -1) { source = "qrc:/settings.qml"; } - content.setSource(source, Object.assign({"openSend": false}, props)) + content.setSource(source, args) viewModel.update(index) } diff --git a/ui/view/qml.qrc b/ui/view/qml.qrc index a65321614..f02a778b9 100644 --- a/ui/view/qml.qrc +++ b/ui/view/qml.qrc @@ -347,5 +347,7 @@ assets/bg-pic@3x.png controls/VersionFooter.qml assets/icon-go-to-app.svg + assets/icon-daocore.svg + assets/icon-daocore-active.svg