#include <kiconloader.h>
#include <kio/netaccess.h>
#include <kio/deletejob.h>
-#include <kio/renamedialog.h>
#include <kinputdialog.h>
#include <klocale.h>
#include <kmenu.h>
new MainWindowAdaptor(this);
QDBusConnection::sessionBus().registerObject(QString("/dolphin/MainWindow%1").arg(m_id), this);
- KonqUndoManager::incRef();
+ KonqFileUndoManager::incRef();
- KonqUndoManager* undoManager = KonqUndoManager::self();
+ KonqFileUndoManager* undoManager = KonqFileUndoManager::self();
undoManager->setUiInterface(new UndoUiInterface(this));
connect(undoManager, SIGNAL(undoAvailable(bool)),
DolphinMainWindow::~DolphinMainWindow()
{
- KonqUndoManager::decRef();
+ KonqFileUndoManager::decRef();
DolphinApplication::app()->removeMainWindow(this);
}
m_viewContainer[SecondaryView] = container;
}
-void DolphinMainWindow::rename(const KUrl& oldUrl, const KUrl& newUrl)
+void DolphinMainWindow::slotRenaming()
{
clearStatusBar();
- KonqOperations::rename(this, oldUrl, newUrl);
- m_undoCommandTypes.append(KonqUndoManager::RENAME);
+ m_undoCommandTypes.append(KonqFileUndoManager::RENAME);
}
void DolphinMainWindow::refreshViews()
QString seq = QKeySequence(Qt::ShiftModifier).toString();
seq.chop(1); // chop superfluous '+'
- QAction* moveAction = popup.addAction(KIcon("goto-page"),
+ QAction* moveAction = popup.addAction(KIcon("go-jump"),
i18nc("@action:inmenu",
"&Move Here\t<shortcut>%1</shortcut>", seq));
seq = QKeySequence(Qt::ControlModifier + Qt::ShiftModifier).toString();
seq.chop(1);
- QAction* linkAction = popup.addAction(KIcon("www"),
+ QAction* linkAction = popup.addAction(KIcon("insert-link"),
i18nc("@action:inmenu",
"&Link Here\t<shortcut>%1</shortcut>", seq));
}
}
-void DolphinMainWindow::changeSelection(const QList<KFileItem>& selection)
+void DolphinMainWindow::changeSelection(const KFileItemList& selection)
{
activeViewContainer()->view()->changeSelection(selection);
}
void DolphinMainWindow::slotAdditionalInfoChanged(KFileItemDelegate::InformationList list)
{
- QAction* action = 0;
- KFileItemDelegate::Information info = list.isEmpty() ? KFileItemDelegate::NoInformation : list.first();
+ QAction* showSizeInfo = actionCollection()->action("show_size_info");
+ QAction* showDateInfo = actionCollection()->action("show_date_info");
+ QAction* showPermissionsInfo = actionCollection()->action("show_permissions_info");
+ QAction* showOwnerInfo = actionCollection()->action("show_owner_info");
+ QAction* showGroupInfo = actionCollection()->action("show_group_info");
+ QAction* showMimeInfo = actionCollection()->action("show_mime_info");
- switch (info) {
- case KFileItemDelegate::FriendlyMimeType:
- action = actionCollection()->action("show_mime_info");
- break;
- case KFileItemDelegate::Size:
- action = actionCollection()->action("show_size_info");
- break;
- case KFileItemDelegate::ModificationTime:
- action = actionCollection()->action("show_date_info");
- break;
- case KFileItemDelegate::NoInformation:
- default:
- action = actionCollection()->action("clear_info");
- break;
- }
+ showSizeInfo->setChecked(false);
+ showDateInfo->setChecked(false);
+ showPermissionsInfo->setChecked(false);
+ showOwnerInfo->setChecked(false);
+ showGroupInfo->setChecked(false);
+ showMimeInfo->setChecked(false);
- if (action != 0) {
- KToggleAction* toggleAction = static_cast<KToggleAction*>(action);
- toggleAction->setChecked(true);
+ const DolphinView* view = m_activeViewContainer->view();
- QActionGroup* group = toggleAction->actionGroup();
- Q_ASSERT(group != 0);
- const DolphinView* view = m_activeViewContainer->view();
- group->setEnabled(view->mode() == DolphinView::IconsView);
+ // currently the column view does not support additional information
+ const bool enable = (view->mode() != DolphinView::ColumnView);
+ showSizeInfo->setEnabled(enable);
+ showDateInfo->setEnabled(enable);
+ showPermissionsInfo->setEnabled(enable);
+ showOwnerInfo->setEnabled(enable);
+ showGroupInfo->setEnabled(enable);
+ showMimeInfo->setEnabled(enable);
+
+ foreach (KFileItemDelegate::Information info, list) {
+ switch (info) {
+ case KFileItemDelegate::Size:
+ showSizeInfo->setChecked(true);
+ break;
+ case KFileItemDelegate::ModificationTime:
+ showDateInfo->setChecked(true);
+ break;
+ case KFileItemDelegate::Permissions:
+ showPermissionsInfo->setChecked(true);
+ break;
+ case KFileItemDelegate::Owner:
+ showOwnerInfo->setChecked(true);
+ break;
+ case KFileItemDelegate::OwnerAndGroup:
+ showGroupInfo->setChecked(true);
+ break;
+ case KFileItemDelegate::FriendlyMimeType:
+ showMimeInfo->setChecked(true);
+ break;
+ default:
+ break;
+ }
}
}
-void DolphinMainWindow::slotSelectionChanged(const QList<KFileItem>& selection)
+void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
{
updateEditActions();
void DolphinMainWindow::rename()
{
clearStatusBar();
- m_activeViewContainer->renameSelectedItems();
+ m_activeViewContainer->view()->renameSelectedItems();
}
void DolphinMainWindow::moveToTrash()
clearStatusBar();
const KUrl::List selectedUrls = m_activeViewContainer->view()->selectedUrls();
KonqOperations::del(this, KonqOperations::TRASH, selectedUrls);
- m_undoCommandTypes.append(KonqUndoManager::TRASH);
+ m_undoCommandTypes.append(KonqFileUndoManager::TRASH);
}
void DolphinMainWindow::deleteItems()
}
if (available && (m_undoCommandTypes.count() > 0)) {
- const KonqUndoManager::CommandType command = m_undoCommandTypes.takeFirst();
+ const KonqFileUndoManager::CommandType command = m_undoCommandTypes.takeFirst();
DolphinStatusBar* statusBar = m_activeViewContainer->statusBar();
switch (command) {
- case KonqUndoManager::COPY:
+ case KonqFileUndoManager::COPY:
statusBar->setMessage(i18nc("@info:status", "Copy operation completed."),
DolphinStatusBar::OperationCompleted);
break;
- case KonqUndoManager::MOVE:
+ case KonqFileUndoManager::MOVE:
statusBar->setMessage(i18nc("@info:status", "Move operation completed."),
DolphinStatusBar::OperationCompleted);
break;
- case KonqUndoManager::LINK:
+ case KonqFileUndoManager::LINK:
statusBar->setMessage(i18nc("@info:status", "Link operation completed."),
DolphinStatusBar::OperationCompleted);
break;
- case KonqUndoManager::TRASH:
+ case KonqFileUndoManager::TRASH:
statusBar->setMessage(i18nc("@info:status", "Move to trash operation completed."),
DolphinStatusBar::OperationCompleted);
break;
- case KonqUndoManager::RENAME:
+ case KonqFileUndoManager::RENAME:
statusBar->setMessage(i18nc("@info:status", "Renaming operation completed."),
DolphinStatusBar::OperationCompleted);
break;
- case KonqUndoManager::MKDIR:
+ case KonqFileUndoManager::MKDIR:
statusBar->setMessage(i18nc("@info:status", "Created folder."),
DolphinStatusBar::OperationCompleted);
break;
void DolphinMainWindow::undo()
{
clearStatusBar();
- KonqUndoManager::self()->undo();
+ KonqFileUndoManager::self()->undo();
}
void DolphinMainWindow::cut()
clearStatusBar();
m_activeViewContainer->view()->invertSelection();
}
-void DolphinMainWindow::setIconsView()
-{
- m_activeViewContainer->view()->setMode(DolphinView::IconsView);
-}
-
-void DolphinMainWindow::setDetailsView()
-{
- m_activeViewContainer->view()->setMode(DolphinView::DetailsView);
-}
-void DolphinMainWindow::setColumnView()
+void DolphinMainWindow::setViewMode(QAction* action)
{
- m_activeViewContainer->view()->setMode(DolphinView::ColumnView);
+ const DolphinView::Mode mode = action->data().value<DolphinView::Mode>();
+ m_activeViewContainer->view()->setMode(mode);
}
void DolphinMainWindow::sortByName()
view->setCategorizedSorting(!categorizedSorting);
}
-void DolphinMainWindow::clearInfo()
+void DolphinMainWindow::toggleSizeInfo()
{
- m_activeViewContainer->view()->setAdditionalInfo(KFileItemDelegate::NoInformation);
+ toggleAdditionalInfo("show_size_info", KFileItemDelegate::Size);
}
-void DolphinMainWindow::showMimeInfo()
+void DolphinMainWindow::toggleDateInfo()
{
- clearStatusBar();
- m_activeViewContainer->view()->setAdditionalInfo(KFileItemDelegate::FriendlyMimeType);
+ toggleAdditionalInfo("show_date_info", KFileItemDelegate::ModificationTime);
}
-void DolphinMainWindow::showSizeInfo()
+void DolphinMainWindow::togglePermissionsInfo()
{
- clearStatusBar();
- m_activeViewContainer->view()->setAdditionalInfo(KFileItemDelegate::Size);
+ toggleAdditionalInfo("show_permissions_info", KFileItemDelegate::Permissions);
}
-void DolphinMainWindow::showDateInfo()
+void DolphinMainWindow::toggleOwnerInfo()
{
- clearStatusBar();
- m_activeViewContainer->view()->setAdditionalInfo(KFileItemDelegate::ModificationTime);
+ toggleAdditionalInfo("show_owner_info", KFileItemDelegate::Owner);
+}
+
+void DolphinMainWindow::toggleGroupInfo()
+{
+ toggleAdditionalInfo("show_group_info", KFileItemDelegate::OwnerAndGroup);
+}
+
+void DolphinMainWindow::toggleMimeInfo()
+{
+ toggleAdditionalInfo("show_mime_info", KFileItemDelegate::FriendlyMimeType);
}
void DolphinMainWindow::toggleSplitView()
void DolphinMainWindow::editLocation()
{
- m_activeViewContainer->urlNavigator()->setUrlEditable(true);
+ KUrlNavigator* navigator = m_activeViewContainer->urlNavigator();
+ navigator->setUrlEditable(true);
+ navigator->setFocus();
}
void DolphinMainWindow::adjustViewProperties()
// assure a proper default size if Dolphin runs the first time
resize(700, 500);
}
-#ifdef HAVE_NEPOMUK
- if (!MetaDataWidget::metaDataAvailable()) {
- DolphinStatusBar* statusBar = activeViewContainer()->statusBar();
- statusBar->setMessage(i18nc("@info:status",
- "Failed to contact Nepomuk service, annotation and tagging are disabled."),
- DolphinStatusBar::Error);
- }
-#endif
emit urlChanged(homeUrl);
}
connect(menu, SIGNAL(aboutToShow()),
this, SLOT(updateNewMenu()));
- QAction* newWindow = actionCollection()->addAction("new_window");
+ KAction* newWindow = actionCollection()->addAction("new_window");
newWindow->setIcon(KIcon("window-new"));
newWindow->setText(i18nc("@action:inmenu File", "New &Window"));
newWindow->setShortcut(Qt::CTRL | Qt::Key_N);
connect(newWindow, SIGNAL(triggered()), this, SLOT(openNewMainWindow()));
- QAction* rename = actionCollection()->addAction("rename");
+ KAction* rename = actionCollection()->addAction("rename");
rename->setText(i18nc("@action:inmenu File", "Rename..."));
rename->setShortcut(Qt::Key_F2);
connect(rename, SIGNAL(triggered()), this, SLOT(rename()));
- QAction* moveToTrash = actionCollection()->addAction("move_to_trash");
+ KAction* moveToTrash = actionCollection()->addAction("move_to_trash");
moveToTrash->setText(i18nc("@action:inmenu File", "Move to Trash"));
- moveToTrash->setIcon(KIcon("edit-trash"));
+ moveToTrash->setIcon(KIcon("user-trash"));
moveToTrash->setShortcut(QKeySequence::Delete);
connect(moveToTrash, SIGNAL(triggered()), this, SLOT(moveToTrash()));
- QAction* deleteAction = actionCollection()->addAction("delete");
+ KAction* deleteAction = actionCollection()->addAction("delete");
deleteAction->setText(i18nc("@action:inmenu File", "Delete"));
deleteAction->setShortcut(Qt::SHIFT | Qt::Key_Delete);
deleteAction->setIcon(KIcon("edit-delete"));
connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItems()));
- QAction* properties = actionCollection()->addAction("properties");
+ KAction* properties = actionCollection()->addAction("properties");
properties->setText(i18nc("@action:inmenu File", "Properties"));
properties->setShortcut(Qt::ALT | Qt::Key_Return);
connect(properties, SIGNAL(triggered()), this, SLOT(properties()));
SLOT(undo()),
actionCollection());
- KStandardAction::cut(this, SLOT(cut()), actionCollection());
+ //Need to remove shift+del from cut action, else the shortcut for deletejob
+ //doesn't work
+ KAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
+ KShortcut cutShortcut = cut->shortcut();
+ cutShortcut.remove(Qt::SHIFT + Qt::Key_Delete, KShortcut::KeepEmpty);
+ cut->setShortcut(cutShortcut);
KStandardAction::copy(this, SLOT(copy()), actionCollection());
KStandardAction::paste(this, SLOT(paste()), actionCollection());
- QAction* selectAll = actionCollection()->addAction("select_all");
+ KAction* selectAll = actionCollection()->addAction("select_all");
selectAll->setText(i18nc("@action:inmenu Edit", "Select All"));
selectAll->setShortcut(Qt::CTRL + Qt::Key_A);
connect(selectAll, SIGNAL(triggered()), this, SLOT(selectAll()));
- QAction* invertSelection = actionCollection()->addAction("invert_selection");
+ KAction* invertSelection = actionCollection()->addAction("invert_selection");
invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
connect(invertSelection, SIGNAL(triggered()), this, SLOT(invertSelection()));
SLOT(zoomOut()),
actionCollection());
- KToggleAction* iconsView = actionCollection()->add<KToggleAction>("icons");
- iconsView->setText(i18nc("@action:inmenu View Mode", "Icons"));
- iconsView->setShortcut(Qt::CTRL | Qt::Key_1);
- iconsView->setIcon(KIcon("fileview-icon"));
- connect(iconsView, SIGNAL(triggered()), this, SLOT(setIconsView()));
-
- KToggleAction* detailsView = actionCollection()->add<KToggleAction>("details");
- detailsView->setText(i18nc("@action:inmenu View Mode", "Details"));
- detailsView->setShortcut(Qt::CTRL | Qt::Key_2);
- detailsView->setIcon(KIcon("fileview-detailed"));
- connect(detailsView, SIGNAL(triggered()), this, SLOT(setDetailsView()));
- KToggleAction* columnView = actionCollection()->add<KToggleAction>("columns");
- columnView->setText(i18nc("@action:inmenu View Mode", "Columns"));
- columnView->setShortcut(Qt::CTRL | Qt::Key_3);
- columnView->setIcon(KIcon("fileview-column"));
- connect(columnView, SIGNAL(triggered()), this, SLOT(setColumnView()));
+ KToggleAction* iconsView = DolphinView::iconsModeAction(actionCollection());
+ KToggleAction* detailsView = DolphinView::detailsModeAction(actionCollection());
+ KToggleAction* columnView = DolphinView::columnsModeAction(actionCollection());
QActionGroup* viewModeGroup = new QActionGroup(this);
viewModeGroup->addAction(iconsView);
viewModeGroup->addAction(detailsView);
viewModeGroup->addAction(columnView);
+ connect(viewModeGroup, SIGNAL(triggered(QAction*)), this, SLOT(setViewMode(QAction*)));
KToggleAction* sortByName = actionCollection()->add<KToggleAction>("sort_by_name");
sortByName->setText(i18nc("@action:inmenu Sort By", "Name"));
showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups"));
connect(showInGroups, SIGNAL(triggered()), this, SLOT(toggleSortCategorization()));
- KToggleAction* clearInfo = actionCollection()->add<KToggleAction>("clear_info");
- clearInfo->setText(i18nc("@action:inmenu Additional information", "No Information"));
- connect(clearInfo, SIGNAL(triggered()), this, SLOT(clearInfo()));
-
- KToggleAction* showMimeInfo = actionCollection()->add<KToggleAction>("show_mime_info");
- showMimeInfo->setText(i18nc("@action:inmenu Additional information", "Type"));
- connect(showMimeInfo, SIGNAL(triggered()), this, SLOT(showMimeInfo()));
-
KToggleAction* showSizeInfo = actionCollection()->add<KToggleAction>("show_size_info");
showSizeInfo->setText(i18nc("@action:inmenu Additional information", "Size"));
- connect(showSizeInfo, SIGNAL(triggered()), this, SLOT(showSizeInfo()));
+ connect(showSizeInfo, SIGNAL(triggered()), this, SLOT(toggleSizeInfo()));
KToggleAction* showDateInfo = actionCollection()->add<KToggleAction>("show_date_info");
showDateInfo->setText(i18nc("@action:inmenu Additional information", "Date"));
- connect(showDateInfo, SIGNAL(triggered()), this, SLOT(showDateInfo()));
+ connect(showDateInfo, SIGNAL(triggered()), this, SLOT(toggleDateInfo()));
+
+ KToggleAction* showPermissionsInfo = actionCollection()->add<KToggleAction>("show_permissions_info");
+ showPermissionsInfo->setText(i18nc("@action:inmenu Additional information", "Permissions"));
+ connect(showPermissionsInfo, SIGNAL(triggered()), this, SLOT(togglePermissionsInfo()));
+
+ KToggleAction* showOwnerInfo = actionCollection()->add<KToggleAction>("show_owner_info");
+ showOwnerInfo->setText(i18nc("@action:inmenu Additional information", "Owner"));
+ connect(showOwnerInfo, SIGNAL(triggered()), this, SLOT(toggleOwnerInfo()));
- QActionGroup* infoGroup = new QActionGroup(this);
- infoGroup->addAction(clearInfo);
- infoGroup->addAction(showMimeInfo);
- infoGroup->addAction(showSizeInfo);
- infoGroup->addAction(showDateInfo);
+ KToggleAction* showGroupInfo = actionCollection()->add<KToggleAction>("show_group_info");
+ showGroupInfo->setText(i18nc("@action:inmenu Additional information", "Group"));
+ connect(showGroupInfo, SIGNAL(triggered()), this, SLOT(toggleGroupInfo()));
+
+ KToggleAction* showMimeInfo = actionCollection()->add<KToggleAction>("show_mime_info");
+ showMimeInfo->setText(i18nc("@action:inmenu Additional information", "Type"));
+ connect(showMimeInfo, SIGNAL(triggered()), this, SLOT(toggleMimeInfo()));
KToggleAction* showPreview = actionCollection()->add<KToggleAction>("show_preview");
showPreview->setText(i18nc("@action:intoolbar", "Preview"));
showHiddenFiles->setShortcut(Qt::ALT | Qt::Key_Period);
connect(showHiddenFiles, SIGNAL(triggered()), this, SLOT(toggleShowHiddenFiles()));
- QAction* split = actionCollection()->addAction("split_view");
+ KAction* split = actionCollection()->addAction("split_view");
split->setShortcut(Qt::Key_F10);
updateSplitAction();
connect(split, SIGNAL(triggered()), this, SLOT(toggleSplitView()));
- QAction* reload = actionCollection()->addAction("reload");
+ KAction* reload = actionCollection()->addAction("reload");
reload->setText(i18nc("@action:inmenu View", "Reload"));
reload->setShortcut(Qt::Key_F5);
reload->setIcon(KIcon("view-refresh"));
connect(reload, SIGNAL(triggered()), this, SLOT(reloadView()));
- QAction* stop = actionCollection()->addAction("stop");
+ KAction* stop = actionCollection()->addAction("stop");
stop->setText(i18nc("@action:inmenu View", "Stop"));
stop->setIcon(KIcon("process-stop"));
connect(stop, SIGNAL(triggered()), this, SLOT(stopLoading()));
showFullLocation->setShortcut(Qt::CTRL | Qt::Key_L);
connect(showFullLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation()));
- QAction* editLocation = actionCollection()->addAction("edit_location");
+ KAction* editLocation = actionCollection()->addAction("edit_location");
editLocation->setText(i18nc("@action:inmenu Navigation Bar", "Edit Location"));
editLocation->setShortcut(Qt::Key_F6);
connect(editLocation, SIGNAL(triggered()), this, SLOT(editLocation()));
- QAction* adjustViewProps = actionCollection()->addAction("view_properties");
+ KAction* adjustViewProps = actionCollection()->addAction("view_properties");
adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties..."));
connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(adjustViewProperties()));
QAction* findFile = actionCollection()->addAction("find_file");
findFile->setText(i18nc("@action:inmenu Tools", "Find File..."));
findFile->setShortcut(Qt::CTRL | Qt::Key_F);
- findFile->setIcon(KIcon("file-find"));
+ findFile->setIcon(KIcon("edit-find"));
connect(findFile, SIGNAL(triggered()), this, SLOT(findFile()));
KToggleAction* showFilterBar = actionCollection()->add<KToggleAction>("show_filter_bar");
showFilterBar->setShortcut(Qt::CTRL | Qt::Key_I);
connect(showFilterBar, SIGNAL(triggered()), this, SLOT(toggleFilterBarVisibility()));
- QAction* compareFiles = actionCollection()->addAction("compare_files");
+ KAction* compareFiles = actionCollection()->addAction("compare_files");
compareFiles->setText(i18nc("@action:inmenu Tools", "Compare Files"));
compareFiles->setIcon(KIcon("kompare"));
compareFiles->setEnabled(false);
addDockWidget(Qt::RightDockWidgetArea, infoDock);
connect(this, SIGNAL(urlChanged(KUrl)),
infoWidget, SLOT(setUrl(KUrl)));
- connect(this, SIGNAL(selectionChanged(QList<KFileItem>)),
- infoWidget, SLOT(setSelection(QList<KFileItem>)));
+ connect(this, SIGNAL(selectionChanged(KFileItemList)),
+ infoWidget, SLOT(setSelection(KFileItemList)));
connect(this, SIGNAL(requestItemInfo(KFileItem)),
infoWidget, SLOT(requestDelayedItemInfo(KFileItem)));
treeWidget, SLOT(setUrl(KUrl)));
connect(treeWidget, SIGNAL(changeUrl(KUrl)),
this, SLOT(changeUrl(KUrl)));
- connect(treeWidget, SIGNAL(changeSelection(QList<KFileItem>)),
- this, SLOT(changeSelection(QList<KFileItem>)));
+ connect(treeWidget, SIGNAL(changeSelection(KFileItemList)),
+ this, SLOT(changeSelection(KFileItemList)));
connect(treeWidget, SIGNAL(urlsDropped(KUrl::List, KUrl)),
this, SLOT(dropUrls(KUrl::List, KUrl)));
terminalDock->hide();
}
- QDockWidget *placesDock = new QDockWidget(i18nc("@title:window", "Places"));
+ QDockWidget* placesDock = new QDockWidget(i18nc("@title:window", "Places"));
placesDock->setObjectName("placesDock");
placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
- KFilePlacesView *listView = new KFilePlacesView(placesDock);
- placesDock->setWidget(listView);
- listView->setModel(DolphinSettings::instance().placesModel());
+ KFilePlacesView* placesView = new KFilePlacesView(placesDock);
+ placesDock->setWidget(placesView);
+ placesView->setModel(DolphinSettings::instance().placesModel());
+ placesView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
placesDock->toggleViewAction()->setText(i18nc("@title:window", "Places"));
placesDock->toggleViewAction()->setShortcut(Qt::Key_F9);
actionCollection()->addAction("show_places_panel", placesDock->toggleViewAction());
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
- connect(listView, SIGNAL(urlChanged(KUrl)),
+ connect(placesView, SIGNAL(urlChanged(KUrl)),
this, SLOT(changeUrl(KUrl)));
connect(this, SIGNAL(urlChanged(KUrl)),
- listView, SLOT(setUrl(KUrl)));
+ placesView, SLOT(setUrl(KUrl)));
}
void DolphinMainWindow::updateHistory()
void DolphinMainWindow::updateEditActions()
{
- const QList<KFileItem> list = m_activeViewContainer->view()->selectedItems();
+ const KFileItemList list = m_activeViewContainer->view()->selectedItems();
if (list.isEmpty()) {
stateChanged("has_no_selection");
} else {
QAction* renameAction = actionCollection()->action("rename");
if (renameAction != 0) {
- renameAction->setEnabled(list.count() >= 1);
+ renameAction->setEnabled(true);
}
bool enableMoveToTrash = true;
- QList<KFileItem>::const_iterator it = list.begin();
- const QList<KFileItem>::const_iterator end = list.end();
+ KFileItemList::const_iterator it = list.begin();
+ const KFileItemList::const_iterator end = list.end();
while (it != end) {
const KUrl& url = (*it).url();
// only enable the 'Move to Trash' action for local files
zoomOutAction->setEnabled(view->isZoomOutPossible());
}
- QAction* action = 0;
- switch (view->mode()) {
- case DolphinView::IconsView:
- action = actionCollection()->action("icons");
- break;
- case DolphinView::DetailsView:
- action = actionCollection()->action("details");
- break;
- case DolphinView::ColumnView:
- action = actionCollection()->action("columns");
- break;
- default:
- break;
- }
-
+ QAction* action = actionCollection()->action(view->currentViewModeActionName());
if (action != 0) {
KToggleAction* toggleAction = static_cast<KToggleAction*>(action);
toggleAction->setChecked(true);
void DolphinMainWindow::copyUrls(const KUrl::List& source, const KUrl& dest)
{
KonqOperations::copy(this, KonqOperations::COPY, source, dest);
- m_undoCommandTypes.append(KonqUndoManager::COPY);
+ m_undoCommandTypes.append(KonqFileUndoManager::COPY);
}
void DolphinMainWindow::moveUrls(const KUrl::List& source, const KUrl& dest)
{
KonqOperations::copy(this, KonqOperations::MOVE, source, dest);
- m_undoCommandTypes.append(KonqUndoManager::MOVE);
+ m_undoCommandTypes.append(KonqFileUndoManager::MOVE);
}
void DolphinMainWindow::linkUrls(const KUrl::List& source, const KUrl& dest)
{
KonqOperations::copy(this, KonqOperations::LINK, source, dest);
- m_undoCommandTypes.append(KonqUndoManager::LINK);
+ m_undoCommandTypes.append(KonqFileUndoManager::LINK);
}
void DolphinMainWindow::clearStatusBar()
this, SLOT(slotSortOrderChanged(Qt::SortOrder)));
connect(view, SIGNAL(additionalInfoChanged(KFileItemDelegate::InformationList)),
this, SLOT(slotAdditionalInfoChanged(KFileItemDelegate::InformationList)));
- connect(view, SIGNAL(selectionChanged(QList<KFileItem>)),
- this, SLOT(slotSelectionChanged(QList<KFileItem>)));
+ connect(view, SIGNAL(selectionChanged(KFileItemList)),
+ this, SLOT(slotSelectionChanged(KFileItemList)));
connect(view, SIGNAL(requestItemInfo(KFileItem)),
this, SLOT(slotRequestItemInfo(KFileItem)));
connect(view, SIGNAL(activated()),
this, SLOT(toggleActiveView()));
+ connect(view, SIGNAL(renaming()),
+ this, SLOT(slotRenaming()));
const KUrlNavigator* navigator = container->urlNavigator();
connect(navigator, SIGNAL(urlChanged(const KUrl&)),
}
}
+void DolphinMainWindow::toggleAdditionalInfo(const char* actionName,
+ KFileItemDelegate::Information info)
+{
+ clearStatusBar();
+
+ DolphinView* view = m_activeViewContainer->view();
+ KFileItemDelegate::InformationList list = view->additionalInfo();
+
+ const bool show = actionCollection()->action(actionName)->isChecked();
+
+ const int index = list.indexOf(info);
+ const bool containsInfo = (index >= 0);
+ if (show && !containsInfo) {
+ list.append(info);
+ view->setAdditionalInfo(list);
+ } else if (!show && containsInfo) {
+ list.removeAt(index);
+ view->setAdditionalInfo(list);
+ Q_ASSERT(list.indexOf(info) < 0);
+ }
+}
+
DolphinMainWindow::UndoUiInterface::UndoUiInterface(DolphinMainWindow* mainWin) :
- KonqUndoManager::UiInterface(mainWin),
+ KonqFileUndoManager::UiInterface(mainWin),
m_mainWin(mainWin)
{
Q_ASSERT(m_mainWin != 0);