Commit cbf3ddde authored by Patrick Brunschwig's avatar Patrick Brunschwig

adapt Appmenu for TB 68

parent c4ff80bd
Pipeline #66527014 passed with stage
in 4 minutes and 1 second
......@@ -9,7 +9,7 @@
/* globals from Thunderbird: */
/* global ReloadMessage: false, gDBView: false, gSignatureStatus: false, gEncryptionStatus: false, showMessageReadSecurityInfo: false */
/* global gFolderDisplay: false, messenger: false, currentAttachments: false, msgWindow: false */
/* global gFolderDisplay: false, messenger: false, currentAttachments: false, msgWindow: false, PanelUI: false */
/* global currentHeaderData: false, gViewAllHeaders: false, gExpandedHeaderList: false, goDoCommand: false, HandleSelectedAttachments: false */
/* global statusFeedback: false, global displayAttachmentsForExpandedView: false, global gMessageListeners: false, global gExpandedHeaderView */
......@@ -144,6 +144,7 @@ Enigmail.msg = {
"Enigmail.msg.msgPrint('", "');");
//Enigmail.msg.overrideLayoutChange();
Enigmail.msg.prepareAppMenu();
Enigmail.msg.setMainMenuLabel();
Enigmail.msg.juniorModeObserver = EnigmailPEPAdapter.registerJuniorModeObserver(Enigmail.msg.setMainMenuLabel);
......@@ -406,32 +407,47 @@ Enigmail.msg = {
setMainMenuLabel: function() {
let usePep = EnigmailPEPAdapter.usingPep();
let o = ["menu_Enigmail", "menu_Enigmail2ndPane"];
let o = ["menu_Enigmail", "appmenu-Enigmail"];
let m0 = document.getElementById(o[0]);
let m1 = document.getElementById(o[1]);
m1.setAttribute("enigmaillabel", m0.getAttribute("enigmaillabel"));
m1.setAttribute("peplabel", m0.getAttribute("peplabel"));
for (let menuId of o) {
let menu = document.getElementById(menuId);
let lbl = menu.getAttribute(usePep ? "peplabel" : "enigmaillabel");
menu.setAttribute("label", lbl);
if (menu) {
let lbl = menu.getAttribute(usePep ? "peplabel" : "enigmaillabel");
menu.setAttribute("label", lbl);
}
}
},
displayMainMenu: function(menuPopup) {
prepareAppMenu: function() {
let menu = document.querySelector("#appMenu-mainView > vbox");
if (!menu) return;
let tsk = document.getElementById("appmenu_tasksMenu");
let e = document.createXULElement("toolbarbutton");
e.setAttribute("label", "xxEnigmail");
e.id = "appmenu-Enigmail";
e.setAttribute("class", "subviewbutton subviewbutton-nav subviewbutton-iconic");
e.setAttribute("closemenu", "none");
e.setAttribute("oncommand", "Enigmail.msg.displayAppmenu('appMenu-enigmailView', this)");
menu.insertBefore(e, tsk);
},
let usePep = EnigmailPEPAdapter.usingPep();
let obj = menuPopup.firstChild;
displayAppmenu: function(targetId, targetObj) {
let menuElem = document.getElementById("appmenu_enigmailMenuPlaceholder");
this.displayMainMenu(menuElem);
PanelUI.showSubView(targetId, targetObj);
},
while (obj) {
if (obj.getAttribute("enigmailtype") == "enigmail" || obj.getAttribute("advanced") == "true") {
if (usePep) {
obj.setAttribute("hidden", "true");
} else {
obj.removeAttribute("hidden");
}
}
displayMainMenu: function(menuPopup) {
obj = obj.nextSibling;
}
let usePep = EnigmailPEPAdapter.usingPep();
if (!usePep) {
EnigmailFuncs.collapseAdvanced(menuPopup, 'hidden', Enigmail.msg.updateOptionsDisplay());
......@@ -439,42 +455,6 @@ Enigmail.msg = {
},
setupMainMenu: function(menuPopup) {
function traverseTree(currentElement, func) {
if (currentElement) {
func(currentElement);
if (currentElement.id) {
EnigmailLog.DEBUG("traverseTree: " + currentElement.id + "\n");
}
// Traverse the tree
var i = 0;
var currentElementChild = currentElement.childNodes[i];
while (currentElementChild) {
// Recursively traverse the tree structure of the child node
traverseTree(currentElementChild, func);
i++;
currentElementChild = currentElement.childNodes[i];
}
}
}
var p = menuPopup.parentNode;
var a = document.getElementById("menu_EnigmailPopup");
var c = a.cloneNode(true);
p.removeChild(menuPopup);
traverseTree(c, function _updNode(node) {
if (node.id && node.id.length > 0) {
node.id += "2";
}
});
p.appendChild(c);
},
toggleAttribute: function(attrName) {
EnigmailLog.DEBUG("enigmailMsgessengerOverlay.js: toggleAttribute('" + attrName + "')\n");
......
......@@ -32,17 +32,228 @@
</broadcasterset>
<!-- Thunderbird secondary pane -->
<popup id="appmenuSecondaryPane">
<splitmenu id="menu_Enigmail2ndPane"
label="&enigmail.label;"
enigmaillabel="&enigmail.label;"
peplabel="&enigmail.pEp.label;"
accesskey="&enigmail.messengermenu.accesskey;"
insertafter="appmenu_customize">
<menupopup id="enigmail_2ndPanePopup" onpopupshowing="Enigmail.msg.setupMainMenu(this)"/>
</splitmenu>
</popup>
<panelmultiview id="appMenu-multiView">
<panelview id="appMenu-enigmailView" class="PanelUI-subView"
title="&enigmail.label;"
enigmaillabel="&enigmail.label;"
peplabel="&enigmail.pEp.label;"
insertbefore="appMenu-editView">
<vbox class="panel-subview-body" id="appmenu_enigmailMenuPlaceholder">
<toolbarbutton id="enigmail_wizard_basic2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.setupWiz.label;"
advanced="reverse"
enigmailtype="enigmail"
oncommand="EnigmailWindows.openSetupWizard(window, true);" />
<toolbarbutton id="enigmail_decryptverify2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.decryptverify.label;"
advanced="true"
hidden="false"
oncommand="Enigmail.msg.messageDecrypt(null, false);" />
<toolbarseparator
advanced="true"
hidden="false"/>
<toolbarbutton id="enigmail_autoDecrypt2"
class="subviewbutton subviewbutton-iconic"
type="checkbox"
checked="false"
advanced="true"
hidden="false"
label="&enigmail.autoDecrypt.label;"
oncommand="Enigmail.msg.toggleAttribute('autoDecrypt');" />
<toolbarseparator
advanced="true"
hidden="false"/>
<toolbarbutton id="enigmail_clearPassphrase2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.clearPassphrase.label;"
accesskey="&enigmail.clearPassphrase.accesskey;"
advanced="true"
hidden="false"
oncommand="EnigmailPassword.clearPassphrase(window);" />
<toolbarbutton id="enigmail_reload_msg2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.reload.label;"
accesskey="&enigmail.reload.accesskey;"
advanced="true"
hidden="false"
oncommand="Enigmail.msg.reloadCompleteMsg();" />
<toolbarbutton id="enigmail_sendersKeyMenu2"
label="&enigmail.sendersKeyMenu.label;"
closemenu="none"
class="subviewbutton subviewbutton-nav"
advanced="true"
hidden="false"
oncommand="Enigmail.hdrView.updateSendersKeyMenu(); PanelUI.showSubView('appMenu-enigmailSendersKeyMenuView', this)"/>
<toolbarbutton id="enigmailDecryptToFolder2"
label="&enigmail.decryptToFolder.label;"
closemenu="none"
class="subviewbutton subviewbutton-nav"
advanced="true"
hidden="false"
oncommand="PanelUI.showSubView('appMenu-enigmailDecryptToFolderView', this)"/>
<toolbarseparator enigmailtype="enigmail"/>
<toolbarbutton id="enigmail_keymgmt2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.keyManWindow.label;"
accesskey="&enigmail.keyManWindow.accesskey;"
oncommand="EnigmailWindows.openKeyManager(window);" />
<toolbarbutton label="&enigmail.adminSmartCard.label;"
class="subviewbutton subviewbutton-iconic"
id="enigmail_smartCard2"
accesskey="&enigmail.adminSmartCard.accesskey;"
advanced="true"
hidden="false"
oncommand="EnigmailWindows.openCardDetails();"/>
<toolbarbutton id="enigmail_RulesEditor2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.editRules.label;"
accesskey="&enigmail.editRules.accesskey;"
enigmailtype="enigmail"
oncommand="EnigmailWindows.openRulesEditor();"/>
<toolbarseparator enigmailtype="enigmail"/>
<toolbarbutton id="enigmail_prefs2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.prefs.label;"
accesskey="&enigmail.prefs.accesskey;"
oncommand="EnigmailWindows.openPrefWindow(window, true, null);" />
<toolbarbutton id="enigmail_help2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.help.label;"
accesskey="&enigmail.help.accesskey;"
enigmailtype="enigmail"
oncommand="EnigmailWindows.openHelpWindow('messenger');" />
<toolbarbutton id="enigmail_debugMenu2"
label="&enigmail.debugMenu.label;"
closemenu="none"
class="subviewbutton subviewbutton-nav"
advanced="true"
hidden="false"
oncommand="PanelUI.showSubView('appMenu-enigmailDebugView', this)"/>
<toolbarbutton id="enigmail_wizard_advanced2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.setupWiz.label;"
advanced="true"
accesskey="&enigmail.setupWiz.accesskey;"
oncommand="EnigmailWindows.openSetupWizard(window, true);" />
<toolbarbutton id="enigmail_about2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.about.label;"
accesskey="&enigmail.about.accesskey;"
enigmailtype="enigmail"
oncommand="EnigmailWindows.openAboutWindow();" />
</vbox>
</panelview>
</panelmultiview>
<!-- submenu Debugging -->
<panelmultiview id="appMenu-multiView">
<panelview id="appMenu-enigmailDebugView" class="PanelUI-subView"
title="&enigmail.decryptToFolder.label;"
insertbefore="appMenu-editView">
<vbox class="panel-subview-body" id="appmenu_enigmailDebugMenu">
<toolbarbutton id="enigmail_console2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.viewconsole.label;"
accesskey="&enigmail.viewconsole.accesskey;"
oncommand="EnigmailWindows.openConsoleWindow();" />
<toolbarbutton id="enigmail_debug_log2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.viewlog.label;"
accesskey="&enigmail.viewlog.accesskey;"
oncommand="EnigmailWindows.openDebugLog(window);" />
</vbox>
</panelview>
</panelmultiview>
<!-- submenu Decrypt to Folder -->
<panelmultiview id="appMenu-multiView">
<panelview id="appMenu-enigmailDecryptToFolderView" class="PanelUI-subView"
title="&enigmail.decryptToFolder.label;"
insertbefore="appMenu-editView">
<vbox class="panel-subview-body" id="appmenu_enigmailDecryptToFolderMenu">
<menu id="menu_enigmailDecryptToFolder2"
label="&enigmail.decryptToFolder.label;"
accesskey="&enigmail.decryptToFolder.accesskey;"
enigmailtype="enigmail"
oncommand="Enigmail.msg.decryptToFolder(event.target._folder)">
<menupopup id="enigmailDecryptfileHereMenu2"
is="folder-menupopup"
mode="filing"
showFileHereLabel="true"
showRecent="true"
recentLabel="&enigmail.recent.label;"
recentAccessKey="&enigmail.recent.accesskey;"
showFavorites="true"
favoritesLabel="&contextMoveCopyMsgFavoritesMenu.label;"
favoritesAccessKey="&contextMoveCopyMsgFavoritesMenu.accesskey;"
hasbeenopened="false" />
</menu>
</vbox>
</panelview>
</panelmultiview>
<!-- submenu Senders Key -->
<panelmultiview id="appMenu-multiView">
<panelview id="appMenu-enigmailSendersKeyMenuView" class="PanelUI-subView"
title="&enigmail.sendersKeyMenu.label;"
insertbefore="appMenu-editView">
<vbox class="panel-subview-body" id="appmenu_enigmailSendersKeyMenu">
<toolbarbutton id="enigmail_importpublickey2"
class="subviewbutton subviewbutton-iconic"
label="&enigmail.importpublickey.label;"
accesskey="&enigmail.importpublickey.accesskey;"
disabled="true"
oncommand="Enigmail.msg.messageImport();" />
<toolbarseparator/>
<toolbarbutton label="&enigmail.displayKeyProperties.label;"
class="subviewbutton subviewbutton-iconic"
id="enigmail_keyMgmtDispKeyDetails2"
oncommand="Enigmail.hdrView.dispKeyDetails();"/>
<toolbarbutton label="&enigmail.signSenderKey.label;"
class="subviewbutton subviewbutton-iconic"
id="enigmail_keyMgmtSignKey2"
oncommand="Enigmail.hdrView.signKey();"/>
<toolbarbutton label="&enigmail.trustSenderKey.label;"
class="subviewbutton subviewbutton-iconic"
id="enigmail_keyMgmtKeyTrust2"
oncommand="Enigmail.hdrView.editKeyTrust();"/>
<toolbarbutton label="&enigmail.showPhoto.label;"
class="subviewbutton subviewbutton-iconic"
id="enigmail_keyMgmtShowPhoto2"
oncommand="Enigmail.hdrView.showPhoto();"/>
</vbox>
</panelview>
</panelmultiview>
<!-- Menu content for all apps -->
<menubar id="mail-menubar">
<menu id="menu_Enigmail"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment