typedef KIO::FileUndoManager::CommandType CommandType;
-class KAction;
class DolphinViewActionHandler;
class DolphinApplication;
class DolphinSettingsDialog;
class DolphinViewContainer;
class DolphinRemoteEncoding;
+class KAction;
+class KJob;
class KNewFileMenu;
class KTabBar;
class KUrl;
class QSplitter;
-class KJob;
+class QToolButton;
/**
* @short Main window for Dolphin.
*/
KNewFileMenu* newFileMenu() const;
- /**
- * Returns the 'Show Menubar' action which can be shared with
- * other menus (e. g. a context menu).
- */
- KAction* showMenuBarAction() const;
-
public slots:
/**
* Pastes the clipboard data into the currently selected folder
*/
void togglePanelLockState();
+ /**
+ * Is invoked if the Places panel got visible/invisible and takes care
+ * that the places-selector of all views is only shown if the Places panel
+ * is invisible.
+ */
+ void slotPlacesPanelVisibilityChanged(bool visible);
+
/** Goes back one step of the URL history. */
void goBack();
*/
void goUp(Qt::MouseButtons buttons);
- /** Goes to the home URL. */
- void goHome();
-
/** Opens Kompare for 2 selected files. */
void compareFiles();
const KUrl& url,
const QList<QAction*>& customActions);
+ void openToolBarMenu();
+ void updateToolBarMenu();
+ void updateToolBar();
+ void slotToolBarSpacerDeleted();
+ void slotToolBarMenuButtonDeleted();
+ void slotToolBarIconSizeChanged(const QSize& iconSize);
+
private:
DolphinMainWindow(int id);
void init();
*/
void setActiveViewContainer(DolphinViewContainer* view);
+ /**
+ * Creates a view container and does a default initialization.
+ */
+ DolphinViewContainer* createViewContainer(const KUrl& url, QWidget* parent);
+
void setupActions();
void setupDockWidgets();
void updateEditActions();
void updateViewActions();
void updateGoActions();
+ void createToolBarMenuButton();
+ void deleteToolBarMenuButton();
+
+ /**
+ * Adds the action \p action to the menu \p menu in
+ * case if it has not added already to the toolbar.
+ * @return True if the action has been added to the menu.
+ */
+ bool addActionToMenu(QAction* action, KMenu* menu);
+
/**
* Adds the tab[\a index] to the closed tab menu's list of actions.
*/
KNewFileMenu* m_newFileMenu;
KActionMenu* m_recentTabsMenu;
- KAction* m_showMenuBar;
KTabBar* m_tabBar;
DolphinViewContainer* m_activeViewContainer;
QVBoxLayout* m_centralWidgetLayout;
int m_id;
+ // Members for the tab-handling:
struct ViewTab
{
ViewTab() : isPrimaryViewActive(true), primaryView(0), secondaryView(0), splitter(0) {}
DolphinViewContainer* secondaryView;
QSplitter* splitter;
};
-
int m_tabIndex;
QList<ViewTab> m_viewTab;
DolphinRemoteEncoding* m_remoteEncoding;
QPointer<DolphinSettingsDialog> m_settingsDialog;
+ // Members for the toolbar menu that is shown when the menubar is hidden:
+ QWidget* m_toolBarSpacer;
+ QToolButton* m_openToolBarMenuButton;
+ QWeakPointer<KMenu> m_toolBarMenu;
+ QTimer* m_updateToolBarTimer;
+
KJob* m_lastHandleUrlStatJob;
/**
return m_newFileMenu;
}
-inline KAction* DolphinMainWindow::showMenuBarAction() const
-{
- return m_showMenuBar;
-}
-
inline int DolphinMainWindow::getId() const
{
return m_id;