]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinpart.cpp
Remove all code that is related to DolphinController's
[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 args.setMimeType(item.mimetype());
351
352 // Ideally, konqueror should be changed to not require trustedSource for directory views,
353 // since the idea was not to need BrowserArguments for non-browser stuff...
354 KParts::BrowserArguments browserArgs;
355 browserArgs.trustedSource = true;
356 emit m_extension->openUrlRequest(item.targetUrl(), args, browserArgs);
357 }
358
359 void DolphinPart::createNewWindow(const KUrl& url)
360 {
361 // TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code
362 // should be moved into DolphinPart::slotItemTriggered()
363 emit m_extension->createNewWindow(url);
364 }
365
366 void DolphinPart::slotOpenContextMenu(const KFileItem& _item,
367 const KUrl&,
368 const QList<QAction*>& customActions)
369 {
370 KParts::BrowserExtension::PopupFlags popupFlags = KParts::BrowserExtension::DefaultPopupItems
371 | KParts::BrowserExtension::ShowProperties
372 | KParts::BrowserExtension::ShowUrlOperations;
373
374 KFileItem item(_item);
375
376 if (item.isNull()) { // viewport context menu
377 popupFlags |= KParts::BrowserExtension::ShowNavigationItems | KParts::BrowserExtension::ShowUp;
378 item = m_dirLister->rootItem();
379 if (item.isNull())
380 item = KFileItem( S_IFDIR, (mode_t)-1, url() );
381 else
382 item.setUrl(url()); // ensure we use the view url, not the canonical path (#213799)
383 }
384
385 // TODO: We should change the signature of the slots (and signals) for being able
386 // to tell for which items we want a popup.
387 const KFileItemList items = (m_view->selectedItems().count() ? m_view->selectedItems()
388 : KFileItemList() << item);
389 KFileItemListProperties capabilities(items);
390
391 KParts::BrowserExtension::ActionGroupMap actionGroups;
392 QList<QAction *> editActions;
393 editActions += m_view->versionControlActions(m_view->selectedItems());
394 editActions += customActions;
395
396 if (!_item.isNull()) { // only for context menu on one or more items
397 bool supportsDeleting = capabilities.supportsDeleting();
398 bool supportsMoving = capabilities.supportsMoving();
399
400 if (!supportsDeleting) {
401 popupFlags |= KParts::BrowserExtension::NoDeletion;
402 }
403
404 if (supportsMoving) {
405 editActions.append(actionCollection()->action("rename"));
406 }
407
408 bool addTrash = capabilities.isLocal() && supportsMoving;
409 bool addDel = false;
410 if (supportsDeleting) {
411 if ( !item.isLocalFile() )
412 addDel = true;
413 else if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
414 addTrash = false;
415 addDel = true;
416 }
417 else {
418 KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
419 KConfigGroup configGroup(globalConfig, "KDE");
420 addDel = configGroup.readEntry("ShowDeleteCommand", false);
421 }
422 }
423
424 if (addTrash)
425 editActions.append(actionCollection()->action("move_to_trash"));
426 if (addDel)
427 editActions.append(actionCollection()->action("delete"));
428
429 // Normally KonqPopupMenu only shows the "Create new" submenu in the current view
430 // since otherwise the created file would not be visible.
431 // But in treeview mode we should allow it.
432 if (m_view->itemsExpandable())
433 popupFlags |= KParts::BrowserExtension::ShowCreateDirectory;
434
435 }
436
437 actionGroups.insert("editactions", editActions);
438
439 emit m_extension->popupMenu(QCursor::pos(),
440 items,
441 KParts::OpenUrlArguments(),
442 KParts::BrowserArguments(),
443 popupFlags,
444 actionGroups);
445 }
446
447 void DolphinPart::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
448 {
449 //kDebug() << oldUrl << newUrl << "currentUrl=" << url();
450 if (oldUrl.equals(url(), KUrl::CompareWithoutTrailingSlash /* #207572 */)) {
451 KParts::ReadOnlyPart::setUrl(newUrl);
452 const QString prettyUrl = newUrl.pathOrUrl();
453 emit m_extension->setLocationBarUrl(prettyUrl);
454 }
455 }
456
457 ////
458
459 void DolphinPartBrowserExtension::restoreState(QDataStream &stream)
460 {
461 KParts::BrowserExtension::restoreState(stream);
462 m_part->view()->restoreState(stream);
463 }
464
465 void DolphinPartBrowserExtension::saveState(QDataStream &stream)
466 {
467 KParts::BrowserExtension::saveState(stream);
468 m_part->view()->saveState(stream);
469 }
470
471 void DolphinPartBrowserExtension::cut()
472 {
473 m_part->view()->cutSelectedItems();
474 }
475
476 void DolphinPartBrowserExtension::copy()
477 {
478 m_part->view()->copySelectedItems();
479 }
480
481 void DolphinPartBrowserExtension::paste()
482 {
483 m_part->view()->paste();
484 }
485
486 void DolphinPartBrowserExtension::pasteTo(const KUrl&)
487 {
488 m_part->view()->pasteIntoFolder();
489 }
490
491 void DolphinPartBrowserExtension::reparseConfiguration()
492 {
493 m_part->view()->refresh();
494 }
495
496 ////
497
498 void DolphinPart::slotEditMimeType()
499 {
500 const KFileItemList items = m_view->selectedItems();
501 if (!items.isEmpty()) {
502 KonqOperations::editMimeType(items.first().mimetype(), m_view);
503 }
504 }
505
506 void DolphinPart::slotSelectItemsMatchingPattern()
507 {
508 openSelectionDialog(i18nc("@title:window", "Select"),
509 i18n("Select all items matching this pattern:"),
510 QItemSelectionModel::Select);
511 }
512
513 void DolphinPart::slotUnselectItemsMatchingPattern()
514 {
515 openSelectionDialog(i18nc("@title:window", "Unselect"),
516 i18n("Unselect all items matching this pattern:"),
517 QItemSelectionModel::Deselect);
518 }
519
520 void DolphinPart::openSelectionDialog(const QString& title, const QString& text, QItemSelectionModel::SelectionFlags command)
521 {
522 bool okClicked;
523 QString pattern = KInputDialog::getText(title, text, "*", &okClicked, m_view);
524
525 if (okClicked && !pattern.isEmpty()) {
526 QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard);
527 QItemSelection matchingIndexes = childrenMatchingPattern(QModelIndex(), patternRegExp);
528 m_view->selectionModel()->select(matchingIndexes, command);
529 }
530 }
531
532 QItemSelection DolphinPart::childrenMatchingPattern(const QModelIndex& parent, const QRegExp& patternRegExp)
533 {
534 QItemSelection matchingIndexes;
535 int numRows = m_proxyModel->rowCount(parent);
536
537 for (int row = 0; row < numRows; row++) {
538 QModelIndex index = m_proxyModel->index(row, 0, parent);
539 QModelIndex sourceIndex = m_proxyModel->mapToSource(index);
540
541 if (sourceIndex.isValid() && patternRegExp.exactMatch(m_dolphinModel->data(sourceIndex).toString())) {
542 matchingIndexes += QItemSelectionRange(index);
543 }
544
545 if (m_proxyModel->hasChildren(index)) {
546 matchingIndexes += childrenMatchingPattern(index, patternRegExp);
547 }
548 }
549
550 return matchingIndexes;
551 }
552
553 void DolphinPart::setCurrentViewMode(const QString& viewModeName)
554 {
555 QAction* action = actionCollection()->action(viewModeName);
556 Q_ASSERT(action);
557 action->trigger();
558 }
559
560 QString DolphinPart::currentViewMode() const
561 {
562 return m_actionHandler->currentViewModeActionName();
563 }
564
565 void DolphinPart::setNameFilter(const QString& nameFilter)
566 {
567 // This is the "/home/dfaure/*.diff" kind of name filter (KDirLister::setNameFilter)
568 // which is unrelated to DolphinView::setNameFilter which is substring filtering in a proxy.
569 m_nameFilter = nameFilter;
570 // TODO save/restore name filter in saveState/restoreState like KonqDirPart did in kde3?
571 }
572
573 void DolphinPart::slotOpenTerminal()
574 {
575 QString dir(QDir::homePath());
576
577 KUrl u(url());
578
579 // If the given directory is not local, it can still be the URL of an
580 // ioslave using UDS_LOCAL_PATH which to be converted first.
581 u = KIO::NetAccess::mostLocalUrl(u, widget());
582
583 //If the URL is local after the above conversion, set the directory.
584 if (u.isLocalFile()) {
585 dir = u.toLocalFile();
586 }
587
588 KToolInvocation::invokeTerminal(QString(), dir);
589 }
590
591 void DolphinPart::updateNewMenu()
592 {
593 // As requested by KNewFileMenu :
594 m_newMenu->checkUpToDate();
595 m_newMenu->setViewShowsHiddenFiles(m_view->showHiddenFiles());
596 // And set the files that the menu apply on :
597 m_newMenu->setPopupFiles(url());
598 }
599
600 void DolphinPart::updateStatusBar()
601 {
602 emit ReadOnlyPart::setStatusBarText(m_view->statusBarText());
603 }
604
605 void DolphinPart::updateProgress(int percent)
606 {
607 m_extension->loadingProgress(percent);
608 }
609
610 void DolphinPart::createDirectory()
611 {
612 m_newMenu->setViewShowsHiddenFiles(m_view->showHiddenFiles());
613 m_newMenu->setPopupFiles(url());
614 m_newMenu->createDirectory();
615 }
616
617 void DolphinPart::setFilesToSelect(const KUrl::List& files)
618 {
619 m_view->markUrlsAsSelected(files);
620 }
621
622 #include "dolphinpart.moc"