┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/filterbar/filterbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/filterbar/filterbar.cpp')
-rw-r--r--src/filterbar/filterbar.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/filterbar/filterbar.cpp b/src/filterbar/filterbar.cpp
index 7a8951743..3fa9cc147 100644
--- a/src/filterbar/filterbar.cpp
+++ b/src/filterbar/filterbar.cpp
@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2006-2010 by Peter Penz <[email protected]> *
* Copyright (C) 2006 by Gregor Kališnik <[email protected]> *
+ * Copyright (C) 2012 by Stuart Citrin <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -39,6 +40,13 @@ FilterBar::FilterBar(QWidget* parent) :
closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar"));
connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeRequest()));
+ // Create button to lock text when changing folders
+ m_lockButton = new QToolButton(this);
+ m_lockButton->setCheckable(true);
+ m_lockButton->setIcon(KIcon("system-lock-screen.png"));
+ m_lockButton->setToolTip(i18nc("@info:tooltip", "Keep Filter When Changing Folders"));
+ connect(m_lockButton, SIGNAL(toggled(bool)), this, SLOT(slotToggleLockButton(bool)));
+
// Create label
QLabel* filterLabel = new QLabel(i18nc("@label:textbox", "Filter:"), this);
@@ -56,6 +64,7 @@ FilterBar::FilterBar(QWidget* parent) :
hLayout->addWidget(closeButton);
hLayout->addWidget(filterLabel);
hLayout->addWidget(m_filterInput);
+ hLayout->addWidget(m_lockButton);
filterLabel->setBuddy(m_filterInput);
}
@@ -64,6 +73,15 @@ FilterBar::~FilterBar()
{
}
+void FilterBar::closeFilterBar()
+{
+ hide();
+ clear();
+ if (m_lockButton) {
+ m_lockButton->setChecked(false);
+ }
+}
+
void FilterBar::selectAll()
{
m_filterInput->selectAll();
@@ -74,6 +92,20 @@ void FilterBar::clear()
m_filterInput->clear();
}
+void FilterBar::slotUrlChanged()
+{
+ if (!m_lockButton || !(m_lockButton->isChecked())) {
+ clear();
+ }
+}
+
+void FilterBar::slotToggleLockButton(bool checked)
+{
+ if (!checked) {
+ clear();
+ }
+}
+
void FilterBar::showEvent(QShowEvent* event)
{
if (!event->spontaneous()) {