]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinpart.cpp
Fix forward declation
[dolphin.git] / src / dolphinpart.cpp
1 /* This file is part of the KDE project
2 Copyright (c) 2007 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18 */
19
20 #include "dolphinpart.h"
21 #include "dolphinviewactionhandler.h"
22 #include "dolphinsortfilterproxymodel.h"
23 #include "dolphinview.h"
24 #include "dolphinmodel.h"
25 #include "dolphinnewmenuobserver.h"
26 #include "dolphinremoteencoding.h"
27
28 #include <kfileitemlistproperties.h>
29 #include <konq_operations.h>
30
31 #include <kaboutdata.h>
32 #include <kactioncollection.h>
33 #include <kconfiggroup.h>
34 #include <kdebug.h>
35 #include <kdirlister.h>
36 #include <kglobalsettings.h>
37 #include <kiconloader.h>
38 #include <klocale.h>
39 #include <kmessagebox.h>
40 #include <kpluginfactory.h>
41 #include <ktoggleaction.h>
42 #include <kio/netaccess.h>
43 #include <ktoolinvocation.h>
44 #include <kauthorized.h>
45 #include <knewfilemenu.h>
46 #include <kmenu.h>
47 #include <kinputdialog.h>
48
49 #include "settings/dolphinsettings.h"
50
51 #include <QActionGroup>
52 #include <QApplication>
53 #include <QClipboard>
54
55 K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin<DolphinPart>();)
56 K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin"))
57
58 DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args)
59 : KParts::ReadOnlyPart(parent)
60 {
61 Q_UNUSED(args)
62 setComponentData(DolphinPartFactory::componentData(), false);
63 m_extension = new DolphinPartBrowserExtension(this);
64
65 // make sure that other apps using this part find Dolphin's view-file-columns icons
66 KIconLoader::global()->addAppDir("dolphin");
67
68 m_dirLister = new KDirLister;
69 m_dirLister->setAutoUpdate(true);
70 if (parentWidget) {
71 m_dirLister->setMainWindow(parentWidget->window());
72 }
73 m_dirLister->setDelayedMimeTypes(true);
74
75 connect(m_dirLister, SIGNAL(completed(KUrl)), this, SLOT(slotCompleted(KUrl)));
76 connect(m_dirLister, SIGNAL(canceled(KUrl)), this, SLOT(slotCanceled(KUrl)));
77 connect(m_dirLister, SIGNAL(percent(int)), this, SLOT(updateProgress(int)));
78
79 m_dolphinModel = new DolphinModel(this);
80 m_dolphinModel->setDirLister(m_dirLister);
81
82 m_proxyModel = new DolphinSortFilterProxyModel(this);
83 m_proxyModel->setSourceModel(m_dolphinModel);
84
85 m_view = new DolphinView(parentWidget, KUrl(), m_proxyModel);
86 m_view->setTabsForFilesEnabled(true);
87 setWidget(m_view);
88
89 setXMLFile("dolphinpart.rc");
90
91 connect(m_view, SIGNAL(infoMessage(QString)),
92 this, SLOT(slotMessage(QString)));
93 connect(m_view, SIGNAL(operationCompletedMessage(QString)),
94 this, SLOT(slotMessage(QString)));
95 connect(m_view, SIGNAL(errorMessage(QString)),
96 this, SLOT(slotErrorMessage(QString)));
97 connect(m_view, SIGNAL(itemTriggered(KFileItem)),
98 this, SLOT(slotItemTriggered(KFileItem)));
99 connect(m_view, SIGNAL(tabRequested(KUrl)),
100 this, SLOT(createNewWindow(KUrl)));
101 connect(m_view, SIGNAL(requestContextMenu(KFileItem,KUrl,QList<QAction*>)),
102 this, SLOT(slotOpenContextMenu(KFileItem,KUrl,QList<QAction*>)));
103 connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
104 m_extension, SIGNAL(selectionInfo(KFileItemList)));
105 connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
106 this, SLOT(slotSelectionChanged(KFileItemList)));
107 connect(m_view, SIGNAL(requestItemInfo(KFileItem)),
108 this, SLOT(slotRequestItemInfo(KFileItem)));
109 connect(m_view, SIGNAL(modeChanged()),
110 this, SIGNAL(viewModeChanged())); // relay signal
111 connect(m_view, SIGNAL(redirection(KUrl, KUrl)),
112 this, SLOT(slotRedirection(KUrl, KUrl)));
113
114 // Watch for changes that should result in updates to the
115 // status bar text.
116 connect(m_dirLister, SIGNAL(itemsDeleted(const KFileItemList&)),
117 this, SLOT(updateStatusBar()));
118 connect(m_dirLister, SIGNAL(clear()),
119 this, SLOT(updateStatusBar()));
120 connect(m_view, SIGNAL(selectionChanged(const KFileItemList)),
121 this, SLOT(updateStatusBar()));
122
123 m_actionHandler = new DolphinViewActionHandler(actionCollection(), this);
124 m_actionHandler->setCurrentView(m_view);
125 connect(m_actionHandler, SIGNAL(createDirectory()), SLOT(createDirectory()));
126
127 m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
128 connect(this, SIGNAL(aboutToOpenURL()),
129 m_remoteEncoding, SLOT(slotAboutToOpenUrl()));
130
131 QClipboard* clipboard = QApplication::clipboard();
132 connect(clipboard, SIGNAL(dataChanged()),
133 this, SLOT(updatePasteAction()));
134
135 createActions();
136 m_actionHandler->updateViewActions();
137 slotSelectionChanged(KFileItemList()); // initially disable selection-dependent actions
138
139 // TODO there was a "always open a new window" (when clicking on a directory) setting in konqueror
140 // (sort of spacial navigation)
141
142 loadPlugins(this, this, componentData());
143
144 }
145
146 DolphinPart::~DolphinPart()
147 {
148 DolphinSettings::instance().save();
149 DolphinNewMenuObserver::instance().detach(m_newMenu);
150 delete m_dirLister;
151 }
152
153 void DolphinPart::createActions()
154 {
155 // Edit menu
156
157 m_newMenu = new KNewFileMenu(actionCollection(), "new_menu", this);
158 m_newMenu->setParentWidget(widget());
159 DolphinNewMenuObserver::instance().attach(m_newMenu);
160 connect(m_newMenu->menu(), SIGNAL(aboutToShow()),
161 this, SLOT(updateNewMenu()));
162
163 KAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" );
164 editMimeTypeAction->setText( i18nc("@action:inmenu Edit", "&Edit File Type..." ) );
165 connect(editMimeTypeAction, SIGNAL(triggered()), SLOT(slotEditMimeType()));
166
167 KAction* selectItemsMatching = actionCollection()->addAction("select_items_matching");
168 selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching..."));
169 selectItemsMatching->setShortcut(Qt::CTRL | Qt::Key_S);
170 connect(selectItemsMatching, SIGNAL(triggered()), this, SLOT(slotSelectItemsMatchingPattern()));
171
172 KAction* unselectItemsMatching = actionCollection()->addAction("unselect_items_matching");
173 unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching..."));
174 connect(unselectItemsMatching, SIGNAL(triggered()), this, SLOT(slotUnselectItemsMatchingPattern()));
175
176 actionCollection()->addAction(KStandardAction::SelectAll, "select_all", m_view, SLOT(selectAll()));
177
178 KAction* unselectAll = actionCollection()->addAction("unselect_all");
179 unselectAll->setText(i18nc("@action:inmenu Edit", "Unselect All"));
180 connect(unselectAll, SIGNAL(triggered()), m_view, SLOT(clearSelection()));
181
182 KAction* invertSelection = actionCollection()->addAction("invert_selection");
183 invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
184 invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
185 connect(invertSelection, SIGNAL(triggered()), m_view, SLOT(invertSelection()));
186
187 // View menu: all done by DolphinViewActionHandler
188
189 // Go menu
190
191 QActionGroup* goActionGroup = new QActionGroup(this);
192 connect(goActionGroup, SIGNAL(triggered(QAction*)),
193 this, SLOT(slotGoTriggered(QAction*)));
194
195 createGoAction("go_applications", "start-here-kde",
196 i18nc("@action:inmenu Go", "App&lications"), QString("programs:/"),
197 goActionGroup);
198 createGoAction("go_network_folders", "folder-remote",
199 i18nc("@action:inmenu Go", "&Network Folders"), QString("remote:/"),
200 goActionGroup);
201 createGoAction("go_settings", "preferences-system",
202 i18nc("@action:inmenu Go", "Sett&ings"), QString("settings:/"),
203 goActionGroup);
204 createGoAction("go_trash", "user-trash",
205 i18nc("@action:inmenu Go", "Trash"), QString("trash:/"),
206 goActionGroup);
207 createGoAction("go_autostart", "",
208 i18nc("@action:inmenu Go", "Autostart"), KGlobalSettings::autostartPath(),
209 goActionGroup);
210
211 // Tools menu
212 if (KAuthorized::authorizeKAction("shell_access")) {
213 KAction* action = actionCollection()->addAction("open_terminal");
214 action->setIcon(KIcon("utilities-terminal"));
215 action->setText(i18nc("@action:inmenu Tools", "Open &Terminal"));
216 connect(action, SIGNAL(triggered()), SLOT(slotOpenTerminal()));
217 action->setShortcut(Qt::Key_F4);
218 }
219
220 }
221
222 void DolphinPart::createGoAction(const char* name, const char* iconName,
223 const QString& text, const QString& url,
224 QActionGroup* actionGroup)
225 {
226 KAction* action = actionCollection()->addAction(name);
227 action->setIcon(KIcon(iconName));
228 action->setText(text);
229 action->setData(url);
230 action->setActionGroup(actionGroup);
231 }
232
233 void DolphinPart::slotGoTriggered(QAction* action)
234 {
235 const QString url = action->data().toString();
236 emit m_extension->openUrlRequest(KUrl(url));
237 }
238
239 void DolphinPart::slotSelectionChanged(const KFileItemList& selection)
240 {
241 const bool hasSelection = !selection.isEmpty();
242
243 QAction* renameAction = actionCollection()->action("rename");
244 QAction* moveToTrashAction = actionCollection()->action("move_to_trash");
245 QAction* deleteAction = actionCollection()->action("delete");
246 QAction* editMimeTypeAction = actionCollection()->action("editMimeType");
247 QAction* propertiesAction = actionCollection()->action("properties");
248 QAction* deleteWithTrashShortcut = actionCollection()->action("delete_shortcut"); // see DolphinViewActionHandler
249
250 if (!hasSelection) {
251 stateChanged("has_no_selection");
252
253 emit m_extension->enableAction("cut", false);
254 emit m_extension->enableAction("copy", false);
255 deleteWithTrashShortcut->setEnabled(false);
256 editMimeTypeAction->setEnabled(false);
257 } else {
258 stateChanged("has_selection");
259
260 // TODO share this code with DolphinMainWindow::updateEditActions (and the desktop code)
261 // in libkonq
262 KFileItemListProperties capabilities(selection);
263 const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving();
264
265 renameAction->setEnabled(capabilities.supportsMoving());
266 moveToTrashAction->setEnabled(enableMoveToTrash);
267 deleteAction->setEnabled(capabilities.supportsDeleting());
268 deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash);
269 editMimeTypeAction->setEnabled(true);
270 propertiesAction->setEnabled(true);
271 emit m_extension->enableAction("cut", capabilities.supportsMoving());
272 emit m_extension->enableAction("copy", true);
273 }
274 }
275
276 void DolphinPart::updatePasteAction()
277 {
278 QPair<bool, QString> pasteInfo = m_view->pasteInfo();
279 emit m_extension->enableAction( "paste", pasteInfo.first );
280 emit m_extension->setActionText( "paste", pasteInfo.second );
281 }
282
283 KAboutData* DolphinPart::createAboutData()
284 {
285 return new KAboutData("dolphinpart", "dolphin", ki18nc("@title", "Dolphin Part"), "0.1");
286 }
287
288 bool DolphinPart::openUrl(const KUrl& url)
289 {
290 bool reload = arguments().reload();
291 // A bit of a workaround so that changing the namefilter works: force reload.
292 // Otherwise DolphinView wouldn't relist the URL, so nothing would happen.
293 if (m_nameFilter != m_dirLister->nameFilter())
294 reload = true;
295 if (m_view->url() == url && !reload) { // DolphinView won't do anything in that case, so don't emit started
296 return true;
297 }
298 setUrl(url); // remember it at the KParts level
299 KUrl visibleUrl(url);
300 if (!m_nameFilter.isEmpty()) {
301 visibleUrl.addPath(m_nameFilter);
302 }
303 QString prettyUrl = visibleUrl.pathOrUrl();
304 emit setWindowCaption(prettyUrl);
305 emit m_extension->setLocationBarUrl(prettyUrl);
306 emit started(0); // get the wheel to spin
307 m_dirLister->setNameFilter(m_nameFilter);
308 m_view->setUrl(url);
309 updatePasteAction();
310 emit aboutToOpenURL();
311 if (reload)
312 m_view->reload();
313 return true;
314 }
315
316 void DolphinPart::slotCompleted(const KUrl& url)
317 {
318 Q_UNUSED(url)
319 emit completed();
320 }
321
322 void DolphinPart::slotCanceled(const KUrl& url)
323 {
324 slotCompleted(url);
325 }
326
327 void DolphinPart::slotMessage(const QString& msg)
328 {
329 emit setStatusBarText(msg);
330 }
331
332 void DolphinPart::slotErrorMessage(const QString& msg)
333 {
334 KMessageBox::error(m_view, msg);
335 }
336
337 void DolphinPart::slotRequestItemInfo(const KFileItem& item)
338 {
339 emit m_extension->mouseOverInfo(item);
340 if (item.isNull()) {
341 updateStatusBar();
342 } else {
343 ReadOnlyPart::setStatusBarText(item.getStatusBarInfo());
344 }
345 }
346
347 void DolphinPart::slotItemTriggered(const KFileItem& item)
348 {
349 KParts::OpenUrlArguments args;
350 // Forget about the known mimetype if a target URL is used.
351 // Testcase: network:/ with a item (mimetype "inode/some-foo-service") pointing to a http URL (html)
352 if (item.targetUrl() == item.url()) {
353 args.setMimeType(item.mimetype());
354 }
355
356 // Ideally, konqueror should be changed to not require trustedSource for directory views,
357 // since the idea was not to need BrowserArguments for non-browser stuff...
358 KParts::BrowserArguments browserArgs;
359 browserArgs.trustedSource = true;
360 emit m_extension->openUrlRequest(item.targetUrl(), args, browserArgs);
361 }
362
363 void DolphinPart::createNewWindow(const KUrl& url)
364 {
365 // TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code
366 // should be moved into DolphinPart::slotItemTriggered()
367 emit m_extension->createNewWindow(url);
368 }
369
370 void DolphinPart::slotOpenContextMenu(const KFileItem& _item,
371 const KUrl&,
372 const QList<QAction*>& customActions)
373 {
374 KParts::BrowserExtension::PopupFlags popupFlags = KParts::BrowserExtension::DefaultPopupItems
375 | KParts::BrowserExtension::ShowProperties
376 | KParts::BrowserExtension::ShowUrlOperations;
377
378 KFileItem item(_item);
379
380 if (item.isNull()) { // viewport context menu
381 popupFlags |= KParts::BrowserExtension::ShowNavigationItems | KParts::BrowserExtension::ShowUp;
382 item = m_dirLister->rootItem();
383 if (item.isNull())
384 item = KFileItem( S_IFDIR, (mode_t)-1, url() );
385 else
386 item.setUrl(url()); // ensure we use the view url, not the canonical path (#213799)
387 }
388
389 // TODO: We should change the signature of the slots (and signals) for being able
390 // to tell for which items we want a popup.
391 KFileItemList items;
392 if (m_view->selectedItems().isEmpty()) {
393 items.append(item);
394 } else {
395 items = m_view->selectedItems();
396 }
397
398 KFileItemListProperties capabilities(items);
399
400 KParts::BrowserExtension::ActionGroupMap actionGroups;
401 QList<QAction *> editActions;
402 editActions += m_view->versionControlActions(m_view->selectedItems());
403 editActions += customActions;
404
405 if (!_item.isNull()) { // only for context menu on one or more items
406 bool supportsDeleting = capabilities.supportsDeleting();
407 bool supportsMoving = capabilities.supportsMoving();
408
409 if (!supportsDeleting) {
410 popupFlags |= KParts::BrowserExtension::NoDeletion;
411 }
412
413 if (supportsMoving) {
414 editActions.append(actionCollection()->action("rename"));
415 }
416
417 bool addTrash = capabilities.isLocal() && supportsMoving;
418 bool addDel = false;
419 if (supportsDeleting) {
420 if ( !item.isLocalFile() )
421 addDel = true;
422 else if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
423 addTrash = false;
424 addDel = true;
425 }
426 else {
427 KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
428 KConfigGroup configGroup(globalConfig, "KDE");
429 addDel = configGroup.readEntry("ShowDeleteCommand", false);
430 }
431 }
432
433 if (addTrash)
434 editActions.append(actionCollection()->action("move_to_trash"));
435 if (addDel)
436 editActions.append(actionCollection()->action("delete"));
437
438 // Normally KonqPopupMenu only shows the "Create new" submenu in the current view
439 // since otherwise the created file would not be visible.
440 // But in treeview mode we should allow it.
441 if (m_view->itemsExpandable())
442 popupFlags |= KParts::BrowserExtension::ShowCreateDirectory;
443
444 }
445
446 actionGroups.insert("editactions", editActions);
447
448 emit m_extension->popupMenu(QCursor::pos(),
449 items,
450 KParts::OpenUrlArguments(),
451 KParts::BrowserArguments(),
452 popupFlags,
453 actionGroups);
454 }
455
456 void DolphinPart::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
457 {
458 //kDebug() << oldUrl << newUrl << "currentUrl=" << url();
459 if (oldUrl.equals(url(), KUrl::CompareWithoutTrailingSlash /* #207572 */)) {
460 KParts::ReadOnlyPart::setUrl(newUrl);
461 const QString prettyUrl = newUrl.pathOrUrl();
462 emit m_extension->setLocationBarUrl(prettyUrl);
463 }
464 }
465
466 ////
467
468 void DolphinPartBrowserExtension::restoreState(QDataStream &stream)
469 {
470 KParts::BrowserExtension::restoreState(stream);
471 m_part->view()->restoreState(stream);
472 }
473
474 void DolphinPartBrowserExtension::saveState(QDataStream &stream)
475 {
476 KParts::BrowserExtension::saveState(stream);
477 m_part->view()->saveState(stream);
478 }
479
480 void DolphinPartBrowserExtension::cut()
481 {
482 m_part->view()->cutSelectedItems();
483 }
484
485 void DolphinPartBrowserExtension::copy()
486 {
487 m_part->view()->copySelectedItems();
488 }
489
490 void DolphinPartBrowserExtension::paste()
491 {
492 m_part->view()->paste();
493 }
494
495 void DolphinPartBrowserExtension::pasteTo(const KUrl&)
496 {
497 m_part->view()->pasteIntoFolder();
498 }
499
500 void DolphinPartBrowserExtension::reparseConfiguration()
501 {
502 m_part->view()->refresh();
503 }
504
505 ////
506
507 void DolphinPart::slotEditMimeType()
508 {
509 const KFileItemList items = m_view->selectedItems();
510 if (!items.isEmpty()) {
511 KonqOperations::editMimeType(items.first().mimetype(), m_view);
512 }
513 }
514
515 void DolphinPart::slotSelectItemsMatchingPattern()
516 {
517 openSelectionDialog(i18nc("@title:window", "Select"),
518 i18n("Select all items matching this pattern:"),
519 QItemSelectionModel::Select);
520 }
521
522 void DolphinPart::slotUnselectItemsMatchingPattern()
523 {
524 openSelectionDialog(i18nc("@title:window", "Unselect"),
525 i18n("Unselect all items matching this pattern:"),
526 QItemSelectionModel::Deselect);
527 }
528
529 void DolphinPart::openSelectionDialog(const QString& title, const QString& text, QItemSelectionModel::SelectionFlags command)
530 {
531 bool okClicked;
532 QString pattern = KInputDialog::getText(title, text, "*", &okClicked, m_view);
533
534 if (okClicked && !pattern.isEmpty()) {
535 QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard);
536 QItemSelection matchingIndexes = childrenMatchingPattern(QModelIndex(), patternRegExp);
537 m_view->selectionModel()->select(matchingIndexes, command);
538 }
539 }
540
541 QItemSelection DolphinPart::childrenMatchingPattern(const QModelIndex& parent, const QRegExp& patternRegExp)
542 {
543 QItemSelection matchingIndexes;
544 int numRows = m_proxyModel->rowCount(parent);
545
546 for (int row = 0; row < numRows; row++) {
547 QModelIndex index = m_proxyModel->index(row, 0, parent);
548 QModelIndex sourceIndex = m_proxyModel->mapToSource(index);
549
550 if (sourceIndex.isValid() && patternRegExp.exactMatch(m_dolphinModel->data(sourceIndex).toString())) {
551 matchingIndexes += QItemSelectionRange(index);
552 }
553
554 if (m_proxyModel->hasChildren(index)) {
555 matchingIndexes += childrenMatchingPattern(index, patternRegExp);
556 }
557 }
558
559 return matchingIndexes;
560 }
561
562 void DolphinPart::setCurrentViewMode(const QString& viewModeName)
563 {
564 QAction* action = actionCollection()->action(viewModeName);
565 Q_ASSERT(action);
566 action->trigger();
567 }
568
569 QString DolphinPart::currentViewMode() const
570 {
571 return m_actionHandler->currentViewModeActionName();
572 }
573
574 void DolphinPart::setNameFilter(const QString& nameFilter)
575 {
576 // This is the "/home/dfaure/*.diff" kind of name filter (KDirLister::setNameFilter)
577 // which is unrelated to DolphinView::setNameFilter which is substring filtering in a proxy.
578 m_nameFilter = nameFilter;
579 // TODO save/restore name filter in saveState/restoreState like KonqDirPart did in kde3?
580 }
581
582 void DolphinPart::slotOpenTerminal()
583 {
584 QString dir(QDir::homePath());
585
586 KUrl u(url());
587
588 // If the given directory is not local, it can still be the URL of an
589 // ioslave using UDS_LOCAL_PATH which to be converted first.
590 u = KIO::NetAccess::mostLocalUrl(u, widget());
591
592 //If the URL is local after the above conversion, set the directory.
593 if (u.isLocalFile()) {
594 dir = u.toLocalFile();
595 }
596
597 KToolInvocation::invokeTerminal(QString(), dir);
598 }
599
600 void DolphinPart::updateNewMenu()
601 {
602 // As requested by KNewFileMenu :
603 m_newMenu->checkUpToDate();
604 m_newMenu->setViewShowsHiddenFiles(m_view->showHiddenFiles());
605 // And set the files that the menu apply on :
606 m_newMenu->setPopupFiles(url());
607 }
608
609 void DolphinPart::updateStatusBar()
610 {
611 emit ReadOnlyPart::setStatusBarText(m_view->statusBarText());
612 }
613
614 void DolphinPart::updateProgress(int percent)
615 {
616 m_extension->loadingProgress(percent);
617 }
618
619 void DolphinPart::createDirectory()
620 {
621 m_newMenu->setViewShowsHiddenFiles(m_view->showHiddenFiles());
622 m_newMenu->setPopupFiles(url());
623 m_newMenu->createDirectory();
624 }
625
626 void DolphinPart::setFilesToSelect(const KUrl::List& files)
627 {
628 m_view->markUrlsAsSelected(files);
629 }
630
631 #include "dolphinpart.moc"