[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/kexi-frameworks7-staniek] kexi/main: Kexi: Limit visibility of the context menu for the 'd
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2015-06-30 20:24:25
Message-ID: E1ZA24v-0006Ps-VC () scm ! kde ! org
[Download RAW message or body]

Git commit a66810d0d85e43902c6f6236132d19edb8ae9af3 by Jaroslaw Staniek.
Committed on 30/06/2015 at 20:16.
Pushed by staniek into branch 'kexi-frameworks7-staniek'.

Kexi: Limit visibility of the context menu for the 'document' tabs

- only show the "Close All Tabs" command when there's at least one tab available
- only show the menu if there's at least one command to show

M  +7    -2    kexi/main/KexiMainWindow.cpp

http://commits.kde.org/calligra/a66810d0d85e43902c6f6236132d19edb8ae9af3

diff --git a/kexi/main/KexiMainWindow.cpp b/kexi/main/KexiMainWindow.cpp
index b6f12aa..e5d54b3 100644
--- a/kexi/main/KexiMainWindow.cpp
+++ b/kexi/main/KexiMainWindow.cpp
@@ -278,8 +278,13 @@ void KexiMainWindowTabWidget::showContextMenuForTab(int index, const QPoint& poi
     if (index >= 0) {
         menu.addAction(m_closeAction);
     }
-    menu.addAction(m_closeAllTabsAction);
-//! @todo add "&Detach Tab"
+    if (count() > 0) {
+        menu.addAction(m_closeAllTabsAction);
+    }
+    //! @todo add "&Detach Tab"
+    if (menu.actions().isEmpty()) {
+        return;
+    }
     setTabIndexFromContextMenu(index);
     menu.exec(point);
 }

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic