Skip to content

Commit

Permalink
Rename topic filtering button in left panel
Browse files Browse the repository at this point in the history
Signed-off-by: Carlosespicur <[email protected]>
  • Loading branch information
Carlosespicur committed Nov 13, 2024
1 parent 7f0ef09 commit 3930e38
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions qml/DomainGraphLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Item
// Public signals
signal update_tab_name(string new_name, string new_icon, string stack_id) // Update tab name based on selected domain id
signal openEntitiesMenu(string domainEntityId, string entityId, string currentAlias, string entityKind)
signal openTopicMenu(string domainEntityId, string domainId, string entityId, string currentAlias, string entityKind)
signal openTopicMenu(string domainEntityId, string domainId, string entityId, string currentAlias, string entityKind, int caller)
signal openLoadingGraphDialog() //l et tab layout know that graph is about to be generated
signal initialized() // let tab layout know that graph has been generated

Expand Down Expand Up @@ -246,7 +246,7 @@ Item
onClicked:
{
if(mouse.button & Qt.RightButton) {
openTopicMenu(domain_entity_id, domain_id, modelData["id"], modelData["alias"], modelData["kind"])
openTopicMenu(domain_entity_id, domain_id, modelData["id"], modelData["alias"], modelData["kind"], panels.openTopicMenuCaller.domainGraph)
} else {
controller.topic_click(modelData["id"])
}
Expand Down
15 changes: 14 additions & 1 deletion qml/LeftPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ RowLayout {
Issues
}

readonly property var openTopicMenuCaller: ({
logicalPanel: 0,
domainGraph: 1
})

property variant panelItem: [monitoringPanel, statusPanel, issuesPanel]

property variant visiblePanel: panelItem[LeftPanel.LeftSubPanel.Explorer]
Expand Down Expand Up @@ -95,12 +100,20 @@ RowLayout {
entitiesMenu.popup()
}

function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind) {
function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller) {
topicMenu.domainEntityId = domainEntityId
topicMenu.domainId = domainId
topicMenu.entityId = entityId
topicMenu.currentAlias = currentAlias
topicMenu.entityKind = entityKind

if (caller === openTopicMenuCaller.logicalPanel) {
topicMenu.showGraphButtonName = "Show topic graph"
}
else {
topicMenu.showGraphButtonName = "Filter topic graph"
}

topicMenu.popup()
}

Expand Down
2 changes: 1 addition & 1 deletion qml/LogicalView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Rectangle {

onClicked: {
if(mouse.button & Qt.RightButton) {
openTopicMenu(domainId, domainName, id, name, kind)
openTopicMenu(domainId, domainName, id, name, kind, openTopicMenuCaller.logicalPanel)
} else {
controller.topic_click(id)
}
Expand Down
9 changes: 6 additions & 3 deletions qml/Panels.qml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ RowLayout {
panels.openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind)
}
onOpenTopicMenu: {
panels.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind)
panels.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller)
}
}
StatusLayout {
Expand Down Expand Up @@ -164,6 +164,9 @@ RowLayout {
}
}

// Expose LeftPanel openTopicMenuCaller enum to be used in other children components (e.g: DomainGraphView.qml)
property alias openTopicMenuCaller: leftPanel.openTopicMenuCaller

function createHistoricChart(dataKind){
tabs.chartsLayout_createHistoricChart(dataKind)
}
Expand Down Expand Up @@ -200,7 +203,7 @@ RowLayout {
leftPanel.openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind)
}

function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind) {
leftPanel.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind)
function openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller) {
leftPanel.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller)
}
}
4 changes: 2 additions & 2 deletions qml/TabLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Item {

// Public signals
signal openEntitiesMenu(string domainEntityId, string entityId, string currentAlias, string entityKind)
signal openTopicMenu(string domainEntityId, string domainId, string entityId, string currentAlias, string entityKind)
signal openTopicMenu(string domainEntityId, string domainId, string entityId, string currentAlias, string entityKind, int caller)

// Private properties
property int current_: 0 // current tab displayed
Expand Down Expand Up @@ -256,7 +256,7 @@ Item {
tabLayout.openEntitiesMenu(domainEntityId, entityId, currentAlias, entityKind)
}
onOpenTopicMenu: {
tabLayout.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind)
tabLayout.openTopicMenu(domainEntityId, domainId, entityId, currentAlias, entityKind, caller)
}

onOpenLoadingGraphDialog: {
Expand Down
3 changes: 2 additions & 1 deletion qml/TopicMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Menu {
property string entityId: ""
property string currentAlias: ""
property string entityKind: ""
property string showGraphButtonName: ""

MenuItem {
text: "Change alias"
Expand All @@ -39,7 +40,7 @@ Menu {
onTriggered: filterEntityStatusLog(menu.entityId)
}
MenuItem {
text: "Filter graph view"
text: menu.showGraphButtonName
onTriggered: openTopicView(menu.domainEntityId, menu.domainId, menu.entityId)
}
MenuItem {
Expand Down

0 comments on commit 3930e38

Please sign in to comment.