#include "infosidebarpage.h"
#include "metadatawidget.h"
#include "mainwindowadaptor.h"
-#include "terminalsidebarpage.h"
#include "treeviewsidebarpage.h"
#include "viewpropertiesdialog.h"
#include "viewproperties.h"
+#ifndef Q_OS_WIN
+#include "terminalsidebarpage.h"
+#endif
+
#include "dolphin_generalsettings.h"
#include "dolphin_iconsmodesettings.h"
emit requestItemInfo(item);
}
-void DolphinMainWindow::slotHistoryChanged()
+void DolphinMainWindow::updateHistory()
{
- updateHistory();
+ const KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
+ const int index = urlNavigator->historyIndex();
+
+ QAction* backAction = actionCollection()->action("go_back");
+ if (backAction != 0) {
+ backAction->setEnabled(index < urlNavigator->historySize() - 1);
+ }
+
+ QAction* forwardAction = actionCollection()->action("go_forward");
+ if (forwardAction != 0) {
+ forwardAction->setEnabled(index > 0);
+ }
}
void DolphinMainWindow::updateFilterBarAction(bool show)
setActiveViewContainer(m_viewContainer[PrimaryView]);
updateViewActions();
- emit activeViewChanged(); // TODO unused; remove?
}
void DolphinMainWindow::reloadView()
KUrlNavigator* navigator = m_activeViewContainer->urlNavigator();
navigator->setUrlEditable(true);
navigator->setFocus();
+
+ // select the whole text of the combo box editor
+ QLineEdit* lineEdit = navigator->editor()->lineEdit();
+ const QString text = lineEdit->text();
+ lineEdit->setSelection(0, text.length());
}
void DolphinMainWindow::adjustViewProperties()
const bool firstRun = generalSettings->firstRun();
if (firstRun) {
generalSettings->setViewPropsTimestamp(QDateTime::currentDateTime());
- Q_ASSERT(generalSettings->homeUrl().isEmpty());
- const KUrl homeUrl(QDir::homePath());
- generalSettings->setHomeUrl(homeUrl.prettyUrl());
}
setAcceptDrops(true);
m_activeViewContainer = viewContainer;
m_activeViewContainer->setActive(true);
+ m_actionHandler->setCurrentView(viewContainer->view());
+
updateHistory();
updateEditActions();
updateViewActions();
const KUrl& url = m_activeViewContainer->url();
setCaption(url.fileName());
- m_actionHandler->setCurrentView(viewContainer->view());
-
- emit activeViewChanged(); // TODO unused; remove?
emit urlChanged(url);
}
this, SLOT(dropUrls(KUrl::List, KUrl)));
// setup "Terminal"
+#ifndef Q_OS_WIN
QDockWidget* terminalDock = new QDockWidget(i18nc("@title:window", "Terminal"));
terminalDock->setObjectName("terminalDock");
terminalDock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
addDockWidget(Qt::BottomDockWidgetArea, terminalDock);
connect(this, SIGNAL(urlChanged(KUrl)),
terminalWidget, SLOT(setUrl(KUrl)));
+#endif
const bool firstRun = DolphinSettings::instance().generalSettings()->firstRun();
if (firstRun) {
infoDock->hide();
treeViewDock->hide();
+#ifndef Q_OS_WIN
terminalDock->hide();
+#endif
}
QDockWidget* placesDock = new QDockWidget(i18nc("@title:window", "Places"));
placesView, SLOT(setUrl(KUrl)));
}
-void DolphinMainWindow::updateHistory()
-{
- const KUrlNavigator* urlNavigator = m_activeViewContainer->urlNavigator();
- const int index = urlNavigator->historyIndex();
-
- QAction* backAction = actionCollection()->action("go_back");
- if (backAction != 0) {
- backAction->setEnabled(index < urlNavigator->historySize() - 1);
- }
-
- QAction* forwardAction = actionCollection()->action("go_forward");
- if (forwardAction != 0) {
- forwardAction->setEnabled(index > 0);
- }
-}
-
void DolphinMainWindow::updateEditActions()
{
const KFileItemList list = m_activeViewContainer->view()->selectedItems();
connect(navigator, SIGNAL(urlChanged(const KUrl&)),
this, SLOT(changeUrl(const KUrl&)));
connect(navigator, SIGNAL(historyChanged()),
- this, SLOT(slotHistoryChanged()));
+ this, SLOT(updateHistory()));
connect(navigator, SIGNAL(editableStateChanged(bool)),
this, SLOT(slotEditableStateChanged(bool)));
}