Merge remote-tracking branch 'origin/KDE/4.9'

This commit is contained in:
Pino Toscano 2012-10-13 09:27:54 +02:00
commit 59eee05a15
6 changed files with 43 additions and 17 deletions

View file

@ -7,7 +7,7 @@
<!ENTITY % English "INCLUDE"><!-- change language only here -->
]>
<book lang="&language;">
<book id="dolphin" lang="&language;">
<bookinfo>
<title>The &dolphin; Handbook</title>

View file

@ -4,7 +4,7 @@
<!ENTITY % addindex "IGNORE">
<!ENTITY % English "INCLUDE">
]>
<article lang="&language;">
<article id="kdepasswd" lang="&language;">
<title>Password &amp; User Account</title>
<articleinfo>
<authorgroup>

View file

@ -22,7 +22,7 @@
<!ENTITY % addindex "IGNORE">
]>
<book lang="&language;">
<book id="konqueror" lang="&language;">
<bookinfo>
<title>The &konqueror; Handbook</title>

View file

@ -137,7 +137,7 @@ void DolphinViewActionHandler::createActions()
// Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :)
propertiesAction->setText( i18nc("@action:inmenu File", "Properties") );
propertiesAction->setIcon(KIcon("document-properties"));
propertiesAction->setShortcut(Qt::ALT | Qt::Key_Return);
propertiesAction->setShortcuts(QList<QKeySequence>() << Qt::ALT + Qt::Key_Return << Qt::ALT + Qt::Key_Enter);
connect(propertiesAction, SIGNAL(triggered()), SLOT(slotProperties()));
// View menu

View file

@ -26,6 +26,7 @@
#include <QMenu>
#include <QDrag>
#include <QToolButton>
#include <QStyle>
#include <kapplication.h>
#include <kcolorscheme.h>
@ -43,9 +44,7 @@
#include <kacceleratormanager.h>
#include <konqpixmapprovider.h>
#include <kstandardshortcut.h>
#include <QTabBar>
#include <QStyle>
#include <ktabbar.h>
//###################################################################
@ -134,7 +133,10 @@ KonqFrameTabs::KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentCont
connect( this, SIGNAL(initiateDrag(QWidget*)),
SLOT(slotInitiateDrag(QWidget*)) );
#ifdef QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#pragma message("KF5: revert the commit that introduced this line")
#endif
tabBar()->installEventFilter(this);
initPopupMenu();
}
@ -382,15 +384,11 @@ void KonqFrameTabs::slotMouseMiddleClick()
void KonqFrameTabs::slotMouseMiddleClick(QWidget *w)
{
if (KonqSettings::mouseMiddleClickClosesTab()) {
slotCloseRequest(w);
} else {
KUrl filteredURL(KonqMisc::konqFilteredURL(m_pViewManager->mainWindow(), QApplication::clipboard()->text(QClipboard::Selection)));
if (filteredURL.isValid() && filteredURL.protocol() != QLatin1String("error")) {
KonqFrameBase* frame = dynamic_cast<KonqFrameBase*>(w);
if (frame) {
m_pViewManager->mainWindow()->openUrl(frame->activeChildView(), filteredURL);
}
KUrl filteredURL(KonqMisc::konqFilteredURL(m_pViewManager->mainWindow(), QApplication::clipboard()->text(QClipboard::Selection)));
if (filteredURL.isValid() && filteredURL.protocol() != QLatin1String("error")) {
KonqFrameBase* frame = dynamic_cast<KonqFrameBase*>(w);
if (frame) {
m_pViewManager->mainWindow()->openUrl(frame->activeChildView(), filteredURL);
}
}
}
@ -601,4 +599,25 @@ KonqFrameBase* KonqFrameTabs::currentTab() const
return tabAt(currentIndex());
}
bool KonqFrameTabs::eventFilter(QObject* watched, QEvent* event)
{
if (KonqSettings::mouseMiddleClickClosesTab()) {
KTabBar* bar = qobject_cast<KTabBar*>(tabBar());
if (watched == bar &&
(event->type() == QEvent::MouseButtonPress ||
event->type() == QEvent::MouseButtonRelease)) {
QMouseEvent* e = static_cast<QMouseEvent*>(event);
if (e->button() == Qt::MidButton) {
if (event->type() == QEvent::MouseButtonRelease) {
const int index = bar->selectTab(e->pos());
slotCloseRequest(widget(index));
}
e->accept();
return true;
}
}
}
return KTabWidget::eventFilter(watched, event);
}
#include "konqtabs.moc"

View file

@ -100,6 +100,13 @@ public:
*/
int tabIndexContaining(KonqFrameBase* frame) const;
/**
* Implemented to catch MMB click when KonqSettings::mouseMiddleClickClosesTab()
* returns true so that the tab can be properly closed without being activated
* first.
*/
virtual bool eventFilter(QObject*, QEvent*);
public Q_SLOTS:
void slotCurrentChanged( int index );
void setAlwaysTabbedMode( bool );