1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 03:53:23 +02:00

contextmenu: clear the context menus before opening

Change-Id: I793be4f3752223f772fe953ffc1aba8cd0682941
This commit is contained in:
Andreas Traczyk 2020-10-09 16:08:25 -04:00 committed by Ming Rui Zhang
parent d6efe2e506
commit cc3336277a
4 changed files with 10 additions and 0 deletions

View file

@ -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) {

View file

@ -43,6 +43,7 @@ Item {
signal transferCallButtonClicked
function openMenu(){
ContextMenuGenerator.initMenu()
if (isSIP){
ContextMenuGenerator.addMenuItem(isPaused ? JamiStrings.resume : JamiStrings.hold,
isPaused ?

View file

@ -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"),

View file

@ -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",