X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/c00478bbc1001d10dcfc04e9b0ea251620837e85..eca778ce68dcff65962edba88cd9f61d36824ee0:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 2c4c1eaa3..f144109cb 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -93,6 +93,10 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QStringLi this, SLOT(slotUrlChanged(KUrl))); connect(m_view, SIGNAL(modeChanged()), this, SLOT(updateViewActions())); + connect(m_view, SIGNAL(sortOrderChanged(Qt::SortOrder)), + this, SLOT(slotSortOrderChanged(Qt::SortOrder))); + connect(m_view, SIGNAL(additionalInfoChanged()), + this, SLOT(slotAdditionalInfoChanged())); QClipboard* clipboard = QApplication::clipboard(); connect(clipboard, SIGNAL(dataChanged()), @@ -144,6 +148,16 @@ void DolphinPart::createActions() propertiesAction->setShortcut(Qt::ALT+Qt::Key_Return); connect(propertiesAction, SIGNAL(triggered()), SLOT(slotProperties())); + // View menu + + // TODO sort_by_* + + KAction* sortDescending = DolphinView::createSortDescendingAction(actionCollection()); + connect(sortDescending, SIGNAL(triggered()), m_view, SLOT(toggleSortOrder())); + + QActionGroup* showInformationActionGroup = DolphinView::createAdditionalInformationActionGroup(actionCollection()); + connect(showInformationActionGroup, SIGNAL(triggered(QAction*)), m_view, SLOT(toggleAdditionalInfo(QAction*))); + // Go menu KAction* newDirAction = DolphinView::createNewDirAction(actionCollection()); @@ -431,4 +445,16 @@ void DolphinPart::createDir() KonqOperations::newDir(m_view, url()); } +void DolphinPart::slotSortOrderChanged(Qt::SortOrder order) +{ + KToggleAction* descending = static_cast(actionCollection()->action("descending")); + const bool sortDescending = (order == Qt::DescendingOrder); + descending->setChecked(sortDescending); +} + +void DolphinPart::slotAdditionalInfoChanged() +{ + m_view->updateAdditionalInfoActions(actionCollection()); +} + #include "dolphinpart.moc"