From cc966de2e9f6781e2073ee9538bf97609a4aa20f Mon Sep 17 00:00:00 2001 From: nils Date: Sun, 19 Feb 2012 17:28:06 +0000 Subject: show/hide steganography menu after closing settings git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@813 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- mainwindow.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'mainwindow.cpp') diff --git a/mainwindow.cpp b/mainwindow.cpp index 63a1a16..84da541 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -455,10 +455,13 @@ void MainWindow::createMenus() importKeyMenu->addAction(keyMgmt->importKeyFromKeyServerAct); keyMenu->addAction(openKeyManagementAct); - if(settings.value("advanced/steganography").toBool()) { - steganoMenu = menuBar()->addMenu(tr("&Steganography")); - steganoMenu->addAction(cutPgpHeaderAct); - steganoMenu->addAction(addPgpHeaderAct); + steganoMenu = menuBar()->addMenu(tr("&Steganography")); + steganoMenu->addAction(cutPgpHeaderAct); + steganoMenu->addAction(addPgpHeaderAct); + + // Hide menu, when steganography menu is disabled in settings + if(!settings.value("advanced/steganography").toBool()) { + this->menuBar()->removeAction(steganoMenu->menuAction()); } viewMenu = menuBar()->addMenu(tr("&View")); @@ -927,6 +930,7 @@ void MainWindow::openSettingsDialog() importButton->setToolButtonStyle(buttonStyle); fileEncButton->setToolButtonStyle(buttonStyle); + // Mime-settings if(settings.value("mime/parseMime").toBool()) { createAttachmentDock(); } else if(attachmentDockCreated) { @@ -940,6 +944,14 @@ void MainWindow::openSettingsDialog() qApp->exit(RESTART_CODE); } } + + // steganography hide/show + if(!settings.value("advanced/steganography").toBool()) { + this->menuBar()->removeAction(steganoMenu->menuAction()); + } else { + this->menuBar()->insertAction(viewMenu->menuAction(), steganoMenu->menuAction()); + } + } void MainWindow::cleanDoubleLinebreaks() -- cgit v1.2.3