From 896ab6bac994bf4377a7e4ab891c289955a17f68 Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 12 Feb 2014 11:16:57 +0100 Subject: [PATCH] [Shortcuts] Ctrl+W shortcut no longer closes a pinned tab Pinned tab can now only be closed from tab context menu --- src/lib/app/qupzilla.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 931ed6815..5943bb884 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -417,7 +417,6 @@ void QupZilla::setupMenu() m_menuFile->addAction(QIcon::fromTheme("window-new"), tr("&New Window"), MENU_RECEIVER, SLOT(newWindow()))->setShortcut(QKeySequence("Ctrl+N")); m_menuFile->addAction(QIcon::fromTheme("document-open-remote"), tr("Open Location"), MENU_RECEIVER, SLOT(openLocation()))->setShortcut(QKeySequence("Ctrl+L")); m_menuFile->addAction(QIcon::fromTheme("document-open"), tr("Open &File..."), MENU_RECEIVER, SLOT(openFile()))->setShortcut(QKeySequence("Ctrl+O")); - m_menuFile->addAction(tr("Close Tab"), MENU_RECEIVER, SLOT(closeTab()))->setShortcut(QKeySequence("Ctrl+W")); m_actionCloseWindow = m_menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close Window"), MENU_RECEIVER, SLOT(closeWindow())); m_actionCloseWindow->setShortcut(QKeySequence("Ctrl+Shift+W")); m_menuFile->addSeparator(); @@ -693,8 +692,10 @@ void QupZilla::setupOtherActions() QShortcut* openLocationAction = new QShortcut(QKeySequence("Alt+D"), this); connect(openLocationAction, SIGNAL(activated()), MENU_RECEIVER, SLOT(openLocation())); - QShortcut* closeTabAction = new QShortcut(QKeySequence("Ctrl+F4"), this); + QShortcut* closeTabAction = new QShortcut(QKeySequence("Ctrl+W"), this); + QShortcut* closeTabAction2 = new QShortcut(QKeySequence("Ctrl+F4"), this); connect(closeTabAction, SIGNAL(activated()), MENU_RECEIVER, SLOT(closeTab())); + connect(closeTabAction2, SIGNAL(activated()), MENU_RECEIVER, SLOT(closeTab())); // Make shortcuts available even in fullscreen (menu hidden) QList actions = menuBar()->actions(); @@ -2187,7 +2188,10 @@ bool QupZilla::quitApp() void QupZilla::closeTab() { - m_tabWidget->closeTab(); + // Don't close pinned tabs with keyboard shortcuts (Ctrl+W, Ctrl+F4) + if (weView() && !weView()->webTab()->isPinned()) { + m_tabWidget->closeTab(); + } } void QupZilla::restoreClosedTab(QObject* obj)