#define DOLPHIN_MAINWINDOW_H
#include "config-dolphin.h"
+#include "disabledactionnotifier.h"
#include "dolphintabwidget.h"
#include "selectionmode/bottombar.h"
+#include <KActionMenu>
#include <KFileItemActions>
#include <kio/fileundomanager.h>
#include <kxmlguiwindow.h>
typedef KIO::FileUndoManager::CommandType CommandType;
+class DiskSpaceUsageMenu;
class DolphinBookmarkHandler;
class DolphinViewActionHandler;
class DolphinSettingsDialog;
class KFileItemList;
class KJob;
class KNewFileMenu;
+class KRecentFilesAction;
class KToolBarPopupAction;
class QToolButton;
class PlacesPanel;
class TerminalPanel;
+/** Used to identify that a custom command should be triggered on a view background double-click.*/
+constexpr QLatin1String customCommand{"CUSTOM_COMMAND"};
+
namespace KIO
{
class OpenUrlJob;
+class CommandLauncherJob;
}
namespace SelectionMode
{
bool isInformationPanelEnabled() const;
bool isSplitViewEnabledInCurrentTab() const;
+ /**
+ * Activates a user set action when double clicking the view's background.
+ */
+ void slotDoubleClickViewBackground(Qt::MouseButton button);
+
public Q_SLOTS:
/**
* Opens each directory in \p dirs in a separate tab. If \a splitView is set,
/**
* Opens a new tab in the background showing the URL \a url.
+ * @return A pointer to the opened DolphinTabPage.
*/
- void openNewTab(const QUrl &url);
+ DolphinTabPage *openNewTab(const QUrl &url);
/**
* Opens a new tab showing the URL \a url and activate it.
void updateNewMenu();
void createDirectory();
+ void createFile();
/** Shows the error message in the status bar of the active view. */
void showErrorMessage(const QString &message);
void togglePanelLockState();
/**
- * Is invoked if the Terminal panel got visible/invisible and takes care
- * that the active view has the focus if the Terminal panel is invisible.
+ * Is invoked whenever the Terminal panel visibility is changed by the user and then moves the focus
+ * to the active view if the panel was hidden.
+ * @note The opposite action (putting focus to the Terminal) is not handled
+ * here but in TerminalPanel::showEvent().
+ * @param visible the new visibility state of the terminal panel
+ */
+ void slotTerminalPanelVisibilityChanged(bool visible);
+
+ /**
+ * Is invoked whenever the Places panel visibility is changed by the user and then either moves the focus
+ * - to the Places panel if it was made visible, or
+ * - to the active view if the panel was hidden.
+ * @param visible the new visibility state of the Places panel
*/
- void slotTerminalPanelVisibilityChanged();
+ void slotPlacesPanelVisibilityChanged(bool visible);
/** Goes back one step of the URL history. */
void goBack();
/** Opens a terminal window for the URL. */
void openTerminalJob(const QUrl &url);
- /** Focus a Terminal Panel. */
- void focusTerminalPanel();
+ /** Toggles focus to/from a Terminal Panel. */
+ void toggleTerminalPanelFocus();
+
+ /** Toggles focus to/from the Places Panel. */
+ void togglePlacesPanelFocus();
/** Opens the settings dialog for Dolphin. */
void editSettings();
*/
void updateAllowedToolbarAreas();
+ /**
+ * Sets the background of the location bar(s) on if they are inside the toolbar,
+ * or off if they are outside the toolbar.
+ */
+ void updateNavigatorsBackground();
+
bool isKompareInstalled() const;
/**
QPointer<DolphinSettingsDialog> m_settingsDialog;
DolphinBookmarkHandler *m_bookmarkHandler;
SelectionMode::ActionTextHelper *m_actionTextHelper;
+ DisabledActionNotifier *m_disabledActionNotifier;
KIO::OpenUrlJob *m_lastHandleUrlOpenJob;
KToolBarPopupAction *m_backAction;
KToolBarPopupAction *m_forwardAction;
+ KActionMenu *m_splitViewAction;
+ QAction *m_splitViewMenuAction;
+ DiskSpaceUsageMenu *m_diskSpaceUsageMenu;
QMenu m_searchTools;
KFileItemActions m_fileItemActions;
QFutureWatcher<void> *m_sessionSaveWatcher;
bool m_sessionSaveScheduled;
+ KIO::CommandLauncherJob *m_job;
+
+ KRecentFilesAction *m_recentFiles = nullptr;
+
friend class DolphinMainWindowTest;
};