summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-12-20 10:16:46 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-12-20 10:16:46 +0100
commit768461ac6a457d045e676f5c3d1c25ce3ade71bf (patch)
treeea2f045246f2a5b948419bf9327c199ec24ab3c2
parentGet sure synchandler exists before calling it (diff)
downloadrekonq-768461ac6a457d045e676f5c3d1c25ce3ade71bf.tar.xz
Hide unneeded actions when there is only one tab
This patch is a small improvement of Yusuf Tezcan work as GCI student. Many thanks for, Yusuf: your contribution is really appreciate :) REVIEW: 103471
-rw-r--r--src/tabbar.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index ff293d18..1634f284 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -314,16 +314,23 @@ void TabBar::contextMenu(int tab, const QPoint &pos)
menu.addAction(mainWindow->actionByName(QL1S("new_tab")));
menu.addAction(mainWindow->actionByName(QL1S("clone_tab")));
if (count() > 1)
+ {
menu.addAction(mainWindow->actionByName(QL1S("detach_tab")));
+ }
menu.addAction(mainWindow->actionByName(QL1S("open_last_closed_tab")));
menu.addAction(mainWindow->actionByName(QL1S("closed_tab_menu")));
menu.addSeparator();
menu.addAction(mainWindow->actionByName(QL1S("close_tab")));
- menu.addAction(mainWindow->actionByName(QL1S("close_other_tabs")));
+ if (count() > 1)
+ {
+ menu.addAction(mainWindow->actionByName(QL1S("close_other_tabs")));
+ }
menu.addSeparator();
menu.addAction(mainWindow->actionByName(QL1S("reload_tab")));
- menu.addAction(mainWindow->actionByName(QL1S("reload_all_tabs")));
-
+ if (count() > 1)
+ {
+ menu.addAction(mainWindow->actionByName(QL1S("reload_all_tabs")));
+ }
menu.exec(pos);
}