Skip to content
Snippets Groups Projects
Commit cc333627 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Ming Rui Zhang
Browse files

contextmenu: clear the context menus before opening

Change-Id: I793be4f3752223f772fe953ffc1aba8cd0682941
parent d6efe2e5
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,13 @@ function createBaseContextMenuObjects(parent) {
baseContextMenuComponent.errorString())
}
function initMenu() {
// Clear any existing items in the menu.
for (var i = 0; i < menuItemList.length; i++) {
baseContextMenuObject.removeItem(menuItemList[i])
}
}
function finishCreation(parent) {
baseContextMenuObject = baseContextMenuComponent.createObject(parent)
if (baseContextMenuObject === null) {
......
......@@ -43,6 +43,7 @@ Item {
signal transferCallButtonClicked
function openMenu(){
ContextMenuGenerator.initMenu()
if (isSIP){
ContextMenuGenerator.addMenuItem(isPaused ? JamiStrings.resume : JamiStrings.hold,
isPaused ?
......
......@@ -34,6 +34,7 @@ Item {
property int contactType: Profile.Type.INVALID
function openMenu() {
ContextMenuGenerator.initMenu()
var hasCall = UtilsAdapter.getCallId(responsibleAccountId, responsibleConvUid) !== ""
if (!hasCall) {
ContextMenuGenerator.addMenuItem(qsTr("Start video call"),
......
......@@ -37,6 +37,7 @@ Item {
property var showMinimize: false
function openMenu(){
ContextMenuGenerator.initMenu()
if (showHangup)
ContextMenuGenerator.addMenuItem(JamiStrings.hangup,
"qrc:/images/icons/ic_call_end_white_24px.svg",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment