panels/folders/folderspanel.cpp
panels/folders/paneltreeview.cpp
search/dolphinsearchbox.cpp
+ search/dolphinsearchoptionsconfigurator.cpp
settings/behaviorsettingspage.cpp
settings/columnviewsettingspage.cpp
settings/contextmenusettingspage.cpp
#include "dolphinapplication.h"
#include "dolphinnewmenu.h"
#include "search/dolphinsearchbox.h"
+#include "search/dolphinsearchoptionsconfigurator.h"
#include "settings/dolphinsettings.h"
#include "settings/dolphinsettingsdialog.h"
#include "dolphinviewcontainer.h"
m_activeViewContainer(0),
m_centralWidgetLayout(0),
m_searchBox(0),
+ m_searchOptionsConfigurator(0),
m_id(id),
m_tabIndex(0),
m_viewTab(),
m_tabIndex = m_tabBar->currentIndex();
}
+void DolphinMainWindow::slotSearchBoxTextChanged(const QString& text)
+{
+ m_searchOptionsConfigurator->setVisible(!text.isEmpty());
+}
+
void DolphinMainWindow::init()
{
DolphinSettings& settings = DolphinSettings::instance();
connect(this, SIGNAL(urlChanged(const KUrl&)),
m_remoteEncoding, SLOT(slotAboutToOpenUrl()));
+ m_searchOptionsConfigurator = new DolphinSearchOptionsConfigurator(this);
+ m_searchOptionsConfigurator->hide();
+
m_tabBar = new KTabBar(this);
m_tabBar->setMovable(true);
m_tabBar->setTabsClosable(true);
m_centralWidgetLayout = new QVBoxLayout(centralWidget);
m_centralWidgetLayout->setSpacing(0);
m_centralWidgetLayout->setMargin(0);
+ m_centralWidgetLayout->addWidget(m_searchOptionsConfigurator);
m_centralWidgetLayout->addWidget(m_tabBar);
- m_centralWidgetLayout->addWidget(m_viewTab[m_tabIndex].splitter);
+ m_centralWidgetLayout->addWidget(m_viewTab[m_tabIndex].splitter, 1);
setCentralWidget(centralWidget);
setupDockWidgets();
m_searchBox->setParent(toolBar("searchToolBar"));
m_searchBox->show();
+ connect(m_searchBox, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotSearchBoxTextChanged(const QString&)));
stateChanged("new_file");
class DolphinViewActionHandler;
class DolphinApplication;
class DolphinSearchBox;
+class DolphinSearchOptionsConfigurator;
class DolphinSettingsDialog;
class DolphinViewContainer;
class DolphinRemoteEncoding;
*/
void slotTabMoved(int from, int to);
+ /**
+ * Is connected to the searchbox signal 'textEdited' and
+ * takes care to make the search options configurator visible
+ * if a search text has been entered.
+ */
+ void slotSearchBoxTextChanged(const QString& text);
+
private:
DolphinMainWindow(int id);
void init();
DolphinViewContainer* m_activeViewContainer;
QVBoxLayout* m_centralWidgetLayout;
DolphinSearchBox* m_searchBox;
+ DolphinSearchOptionsConfigurator* m_searchOptionsConfigurator;
int m_id;
struct ViewTab
m_searchInput->setClickMessage(i18nc("@label:textbox", "Search..."));
m_searchInput->installEventFilter(this);
hLayout->addWidget(m_searchInput);
- connect(m_searchInput, SIGNAL(textEdited(const QString&)),
- this, SLOT(slotTextEdited(const QString&)));
+ connect(m_searchInput, SIGNAL(textChanged(const QString&)),
+ this, SIGNAL(textChanged(const QString&)));
connect(m_searchInput, SIGNAL(returnPressed()),
this, SLOT(emitSearchSignal()));
emit search(KUrl("nepomuksearch:/" + m_searchInput->text()));
}
-void DolphinSearchBox::slotTextEdited(const QString& text)
-{
-}
-
#include "dolphinsearchbox.moc"
class DolphinSearchCompleter : public QObject
{
Q_OBJECT
- public:
- DolphinSearchCompleter(KLineEdit *linedit);
-
- public slots:
- void highlighted(const QModelIndex& index);
- void activated(const QModelIndex& index);
- void slotTextEdited(const QString &text);
-
- private:
- void addCompletionItem(const QString& displayed, const QString& usedForCompletition, const QString& description = QString(), const QString& toolTip = QString(), const KIcon& icon = KIcon());
-
- void findText(int* wordStart, int* wordEnd, QString* newWord, int cursorPos, const QString &input);
-
- private:
- KLineEdit* q;
- QCompleter* m_completer;
- QStandardItemModel* m_completionModel;
- QString m_userText;
- int m_wordStart;
- int m_wordEnd;
+
+public:
+ DolphinSearchCompleter(KLineEdit *linedit);
+
+public slots:
+ void highlighted(const QModelIndex& index);
+ void activated(const QModelIndex& index);
+ void slotTextEdited(const QString &text);
+
+private:
+ void addCompletionItem(const QString& displayed, const QString& usedForCompletition, const QString& description = QString(), const QString& toolTip = QString(), const KIcon& icon = KIcon());
+
+ void findText(int* wordStart, int* wordEnd, QString* newWord, int cursorPos, const QString &input);
+
+private:
+ KLineEdit* q;
+ QCompleter* m_completer;
+ QStandardItemModel* m_completionModel;
+ QString m_userText;
+ int m_wordStart;
+ int m_wordEnd;
};
/**
*/
void search(const KUrl& url);
+ /**
+ * Is emitted if the text of the searchbox has been changed.
+ */
+ void textChanged(const QString& text);
+
private slots:
void emitSearchSignal();
- void slotTextEdited(const QString& text);
private:
KLineEdit* m_searchInput;
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
+ * *
+ * 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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#include "dolphinsearchoptionsconfigurator.h"
+
+#include <kcombobox.h>
+#include <klocale.h>
+
+#include <QButtonGroup>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QPushButton>
+#include <QVBoxLayout>
+
+DolphinSearchOptionsConfigurator::DolphinSearchOptionsConfigurator(QWidget* parent) :
+ QWidget(parent)
+{
+ QVBoxLayout* vBoxLayout = new QVBoxLayout(this);
+
+ // add "search" configuration
+ QLabel* searchLabel = new QLabel(i18nc("@label", "Search:"));
+
+ KComboBox* searchFromBox = new KComboBox();
+ searchFromBox->addItem(i18nc("label", "Everywhere"));
+ searchFromBox->addItem(i18nc("label", "From Here"));
+
+ // add "what" configuration
+ QLabel* whatLabel = new QLabel(i18nc("@label", "What:"));
+
+ KComboBox* searchWhatBox = new KComboBox();
+ searchWhatBox->addItem(i18nc("label", "All"));
+ searchWhatBox->addItem(i18nc("label", "Images"));
+ searchWhatBox->addItem(i18nc("label", "Texts"));
+ searchWhatBox->addItem(i18nc("label", "File Names"));
+
+ QWidget* filler = new QWidget();
+
+ // add button "Save"
+ QPushButton* saveButton = new QPushButton();
+ saveButton->setText(i18nc("@action:button", "Save"));
+
+ QHBoxLayout* hBoxLayout = new QHBoxLayout(this);
+ hBoxLayout->addWidget(searchLabel);
+ hBoxLayout->addWidget(searchFromBox);
+ hBoxLayout->addWidget(whatLabel);
+ hBoxLayout->addWidget(searchWhatBox);
+ hBoxLayout->addWidget(filler, 1);
+ hBoxLayout->addWidget(saveButton);
+
+ vBoxLayout->addLayout(hBoxLayout);
+}
+
+DolphinSearchOptionsConfigurator::~DolphinSearchOptionsConfigurator()
+{
+}
+
+#include "dolphinsearchoptionsconfigurator.moc"
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
+ * *
+ * 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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#ifndef DOLPHINSEARCHOPTIONSCONFIGURATOR_H
+#define DOLPHINSEARCHOPTIONSCONFIGURATOR_H
+
+#include <QWidget>
+
+class DolphinSearchOptionsConfigurator : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DolphinSearchOptionsConfigurator(QWidget* parent = 0);
+ virtual ~DolphinSearchOptionsConfigurator();
+};
+
+#endif