setupGUI(Keys | Save | Create | ToolBar);
stateChanged(QStringLiteral("new_file"));
- toolBar()->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
- toolBar()->setFloatable(false);
- if (!toolBar()->actions().contains(navigatorsWidgetAction)) {
- navigatorsWidgetAction->addToToolbarAndSave(this);
- }
QClipboard* clipboard = QApplication::clipboard();
connect(clipboard, &QClipboard::dataChanged,
this, &DolphinMainWindow::updatePasteAction);
createControlButton();
}
+ updateAllowedToolbarAreas();
+
// enable middle-click on back/forward/up to open in a new tab
auto *middleClickEventFilter = new MiddleClickActionEventFilter(this);
connect(middleClickEventFilter, &MiddleClickActionEventFilter::actionMiddleClicked, this, &DolphinMainWindow::slotToolBarActionMiddleClicked);
bool DolphinMainWindow::isInformationPanelEnabled() const
{
+#ifdef HAVE_BALOO
return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked();
+#else
+ return false;
+#endif
}
void DolphinMainWindow::openFiles(const QStringList& files, bool splitView)
} else {
m_lastHandleUrlOpenJob = new KIO::OpenUrlJob(url);
m_lastHandleUrlOpenJob->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
- m_lastHandleUrlOpenJob->setRunExecutables(true);
+ m_lastHandleUrlOpenJob->setShowOpenOrExecuteDialog(true);
connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::mimeTypeFound, this,
[this, url](const QString &mimetype) {
}
}
+void DolphinMainWindow::updateAllowedToolbarAreas()
+{
+ auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
+ (actionCollection()->action(QStringLiteral("url_navigators")));
+ if (toolBar()->actions().contains(navigators)) {
+ toolBar()->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
+ if (toolBarArea(toolBar()) == Qt::LeftToolBarArea ||
+ toolBarArea(toolBar()) == Qt::RightToolBarArea) {
+ addToolBar(Qt::TopToolBarArea, toolBar());
+ }
+ } else {
+ toolBar()->setAllowedAreas(Qt::AllToolBarAreas);
+ }
+}
+
bool DolphinMainWindow::isKompareInstalled() const
{
static bool initialized = false;
return false;
}
+void DolphinMainWindow::saveNewToolbarConfig()
+{
+ KXmlGuiWindow::saveNewToolbarConfig(); // Applies the new config. This has to be called first
+ // because the rest of this method decides things
+ // based on the new config.
+ auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
+ (actionCollection()->action(QStringLiteral("url_navigators")));
+ if (!toolBar()->actions().contains(navigators)) {
+ m_tabWidget->currentTabPage()->insertNavigatorsWidget(navigators);
+ }
+ updateAllowedToolbarAreas();
+}
+
void DolphinMainWindow::focusTerminalPanel()
{
if (m_terminalPanel->isVisible()) {