+void DolphinPart::slotSelectItemsMatchingPattern()
+{
+ openSelectionDialog(i18nc("@title:window", "Select"),
+ i18n("Select all items matching this pattern:"),
+ true);
+}
+
+void DolphinPart::slotUnselectItemsMatchingPattern()
+{
+ openSelectionDialog(i18nc("@title:window", "Unselect"),
+ i18n("Unselect all items matching this pattern:"),
+ false);
+}
+
+void DolphinPart::openSelectionDialog(const QString& title, const QString& text, bool selectItems)
+{
+ bool okClicked;
+ QString pattern = KInputDialog::getText(title, text, "*", &okClicked, m_view);
+
+ if (okClicked && !pattern.isEmpty()) {
+ QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard);
+ m_view->selectItems(patternRegExp, selectItems);
+ }
+}
+
+void DolphinPart::setCurrentViewMode(const QString& viewModeName)
+{
+ QAction* action = actionCollection()->action(viewModeName);
+ Q_ASSERT(action);
+ action->trigger();
+}
+
+QString DolphinPart::currentViewMode() const
+{
+ return m_actionHandler->currentViewModeActionName();
+}
+
+void DolphinPart::setNameFilter(const QString& nameFilter)
+{
+ // This is the "/home/dfaure/*.diff" kind of name filter (KDirLister::setNameFilter)
+ // which is unrelated to DolphinView::setNameFilter which is substring filtering in a proxy.
+ m_nameFilter = nameFilter;
+ // TODO save/restore name filter in saveState/restoreState like KonqDirPart did in kde3?
+}
+
+void DolphinPart::slotOpenTerminal()
+{
+ QString dir(QDir::homePath());
+
+ KUrl u(url());
+
+ // If the given directory is not local, it can still be the URL of an
+ // ioslave using UDS_LOCAL_PATH which to be converted first.
+ u = KIO::NetAccess::mostLocalUrl(u, widget());
+
+ //If the URL is local after the above conversion, set the directory.
+ if (u.isLocalFile()) {
+ dir = u.toLocalFile();
+ }
+
+ KToolInvocation::invokeTerminal(QString(), dir);
+}
+
+void DolphinPart::slotFindFile()
+{
+ KRun::run("kfind", url(), widget());
+}
+
+void DolphinPart::updateNewMenu()
+{
+ // As requested by KNewFileMenu :
+ m_newFileMenu->checkUpToDate();
+ m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown());
+ // And set the files that the menu apply on :
+ m_newFileMenu->setPopupFiles(url());
+}
+
+void DolphinPart::updateStatusBar()
+{
+ emit ReadOnlyPart::setStatusBarText(m_view->statusBarText());
+}
+
+void DolphinPart::updateProgress(int percent)
+{
+ m_extension->loadingProgress(percent);
+}
+
+void DolphinPart::createDirectory()
+{
+ m_newFileMenu->setViewShowsHiddenFiles(m_view->hiddenFilesShown());
+ m_newFileMenu->setPopupFiles(url());
+ m_newFileMenu->createDirectory();
+}
+
+void DolphinPart::setFilesToSelect(const KUrl::List& files)
+{
+ m_view->markUrlsAsSelected(files);
+}
+