2006-11-21 06:02:05 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
|
|
|
|
* Copyright (C) 2006 by Stefan Monov <logixoul@gmail.com> *
|
|
|
|
* Copyright (C) 2006 by Cvetoslav Ludmiloff <ludmiloff@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
2006-12-08 21:24:08 +00:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
2006-11-21 06:02:05 +00:00
|
|
|
***************************************************************************/
|
|
|
|
|
2007-03-15 19:51:48 +00:00
|
|
|
#ifndef DOLPHIN_MAINWINDOW_H
|
|
|
|
#define DOLPHIN_MAINWINDOW_H
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2007-01-18 06:32:21 +00:00
|
|
|
#include "dolphinview.h"
|
2007-03-25 06:44:28 +00:00
|
|
|
#include "sidebarpage.h"
|
2007-01-18 06:32:21 +00:00
|
|
|
|
2007-06-22 10:18:46 +00:00
|
|
|
#include <config-nepomuk.h>
|
|
|
|
|
2007-10-02 22:04:36 +00:00
|
|
|
#include <kfileitemdelegate.h>
|
2008-04-30 23:32:33 +00:00
|
|
|
#include <kio/fileundomanager.h>
|
2007-10-02 22:04:36 +00:00
|
|
|
#include <ksortablelist.h>
|
|
|
|
#include <kxmlguiwindow.h>
|
2006-12-08 23:41:08 +00:00
|
|
|
|
2007-05-09 22:23:52 +00:00
|
|
|
#include <QtCore/QList>
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2008-02-13 18:45:20 +00:00
|
|
|
class KAction;
|
2008-02-11 12:34:48 +00:00
|
|
|
class DolphinViewActionHandler;
|
2007-03-15 19:51:48 +00:00
|
|
|
class DolphinApplication;
|
2007-06-07 21:10:48 +00:00
|
|
|
class DolphinViewContainer;
|
2007-01-25 16:56:52 +00:00
|
|
|
class KNewMenu;
|
2008-04-12 15:09:46 +00:00
|
|
|
class KTabBar;
|
2006-11-21 06:02:05 +00:00
|
|
|
class KUrl;
|
|
|
|
class QSplitter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @short Main window for Dolphin.
|
|
|
|
*
|
|
|
|
* Handles the menus, toolbars and Dolphin views.
|
2007-02-18 17:01:36 +00:00
|
|
|
*/
|
2007-04-16 20:44:36 +00:00
|
|
|
class DolphinMainWindow: public KXmlGuiWindow
|
2006-11-21 06:02:05 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2007-02-18 17:01:36 +00:00
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.dolphin.MainWindow")
|
|
|
|
Q_PROPERTY(int id READ getId SCRIPTABLE true)
|
2006-11-29 00:02:19 +00:00
|
|
|
friend class DolphinApplication;
|
2007-02-18 17:01:36 +00:00
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
public:
|
2006-11-29 00:02:19 +00:00
|
|
|
virtual ~DolphinMainWindow();
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2007-04-09 19:12:54 +00:00
|
|
|
/**
|
2007-06-12 21:45:22 +00:00
|
|
|
* Returns the currently active view.
|
|
|
|
* All menu actions are applied to this view. When
|
|
|
|
* having a split view setup, the nonactive view
|
2007-06-07 21:10:48 +00:00
|
|
|
* is usually shown in darker colors.
|
|
|
|
*/
|
2007-09-27 12:44:14 +00:00
|
|
|
DolphinViewContainer* activeViewContainer() const;
|
2006-11-21 06:02:05 +00:00
|
|
|
|
|
|
|
/**
|
2007-06-12 21:45:22 +00:00
|
|
|
* Returns true, if the main window contains two instances
|
|
|
|
* of a view container. The active view constainer can be
|
|
|
|
* accessed by DolphinMainWindow::activeViewContainer().
|
2006-11-21 06:02:05 +00:00
|
|
|
*/
|
2007-09-27 12:44:14 +00:00
|
|
|
bool isSplit() const;
|
2007-06-12 21:45:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If the main window contains two instances of a view container
|
|
|
|
* (DolphinMainWindow::isSplit() returns true), then the
|
|
|
|
* two views get toggled (the right view is on the left, the left
|
|
|
|
* view on the right).
|
|
|
|
*/
|
|
|
|
void toggleViews();
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2007-03-13 17:31:54 +00:00
|
|
|
/** Renames the item represented by \a oldUrl to \a newUrl. */
|
|
|
|
void rename(const KUrl& oldUrl, const KUrl& newUrl);
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
/**
|
2007-09-01 08:00:48 +00:00
|
|
|
* Refreshes the views of the main window by recreating them dependent from
|
2006-11-21 06:02:05 +00:00
|
|
|
* the given Dolphin settings.
|
|
|
|
*/
|
|
|
|
void refreshViews();
|
|
|
|
|
2007-01-25 16:56:52 +00:00
|
|
|
/**
|
|
|
|
* Returns the 'Create New...' sub menu which also can be shared
|
|
|
|
* with other menus (e. g. a context menu).
|
|
|
|
*/
|
2007-09-27 12:44:14 +00:00
|
|
|
KNewMenu* newMenu() const;
|
2007-01-25 16:56:52 +00:00
|
|
|
|
2007-11-18 14:37:57 +00:00
|
|
|
/**
|
|
|
|
* Returns the 'Show Menubar' action which can be shared with
|
|
|
|
* other menus (e. g. a context menu).
|
|
|
|
*/
|
|
|
|
KAction* showMenuBarAction() const;
|
|
|
|
|
2007-02-18 17:01:36 +00:00
|
|
|
public slots:
|
2007-03-25 06:44:28 +00:00
|
|
|
/**
|
|
|
|
* Handles the dropping of URLs to the given
|
2007-12-14 15:53:40 +00:00
|
|
|
* destination. This is only called by the TreeViewSidebarPage.
|
2007-03-25 06:44:28 +00:00
|
|
|
*/
|
|
|
|
void dropUrls(const KUrl::List& urls,
|
|
|
|
const KUrl& destination);
|
|
|
|
|
2008-03-29 14:54:56 +00:00
|
|
|
/**
|
|
|
|
* Pastes the clipboard data into the currently selected folder
|
|
|
|
* of the active view. If not exactly one folder is selected,
|
|
|
|
* no pasting is done at all.
|
|
|
|
*/
|
|
|
|
void pasteIntoFolder();
|
|
|
|
|
2007-02-18 17:01:36 +00:00
|
|
|
/**
|
2007-03-17 20:39:15 +00:00
|
|
|
* Returns the main window ID used through DBus.
|
2007-02-18 17:01:36 +00:00
|
|
|
*/
|
2007-09-27 12:44:14 +00:00
|
|
|
int getId() const;
|
2007-02-18 17:01:36 +00:00
|
|
|
|
|
|
|
/**
|
2007-03-25 06:44:28 +00:00
|
|
|
* Inform all affected dolphin components (sidebars, views) of an URL
|
|
|
|
* change.
|
|
|
|
*/
|
|
|
|
void changeUrl(const KUrl& url);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inform all affected dolphin components that a selection change is
|
|
|
|
* requested.
|
2007-02-18 17:01:36 +00:00
|
|
|
*/
|
2007-10-02 19:03:03 +00:00
|
|
|
void changeSelection(const KFileItemList& selection);
|
2007-02-18 17:01:36 +00:00
|
|
|
|
|
|
|
/** Stores all settings and quits Dolphin. */
|
|
|
|
void quit();
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
signals:
|
|
|
|
/**
|
2007-03-25 06:44:28 +00:00
|
|
|
* Is sent if the selection of the currently active view has
|
2006-11-21 06:02:05 +00:00
|
|
|
* been changed.
|
|
|
|
*/
|
2007-10-02 19:03:03 +00:00
|
|
|
void selectionChanged(const KFileItemList& selection);
|
2007-03-25 06:44:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Is sent if the url of the currently active view has
|
|
|
|
* been changed.
|
|
|
|
*/
|
|
|
|
void urlChanged(const KUrl& url);
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2007-05-17 14:51:54 +00:00
|
|
|
/**
|
|
|
|
* Is emitted if information of an item is requested to be shown e. g. in the sidebar.
|
2007-07-02 17:24:54 +00:00
|
|
|
* If item is null, no item information request is pending.
|
2007-05-17 14:51:54 +00:00
|
|
|
*/
|
2007-07-02 17:24:54 +00:00
|
|
|
void requestItemInfo(const KFileItem& item);
|
2007-05-17 14:51:54 +00:00
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
protected:
|
2007-11-30 18:42:17 +00:00
|
|
|
/** @see QMainWindow::closeEvent() */
|
2006-11-21 06:02:05 +00:00
|
|
|
virtual void closeEvent(QCloseEvent* event);
|
|
|
|
|
2007-11-30 18:42:17 +00:00
|
|
|
/** @see KMainWindow::saveProperties() */
|
|
|
|
virtual void saveProperties(KConfigGroup& group);
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2007-11-30 18:42:17 +00:00
|
|
|
/** @see KMainWindow::readProperties() */
|
|
|
|
virtual void readProperties(const KConfigGroup& group);
|
2006-11-21 06:02:05 +00:00
|
|
|
|
|
|
|
private slots:
|
2008-02-11 12:34:48 +00:00
|
|
|
void clearStatusBar();
|
2008-01-21 19:31:07 +00:00
|
|
|
|
2007-01-25 16:56:52 +00:00
|
|
|
/** Updates the 'Create New...' sub menu. */
|
|
|
|
void updateNewMenu();
|
2006-11-21 06:02:05 +00:00
|
|
|
|
|
|
|
/**
|
2007-06-15 00:52:25 +00:00
|
|
|
* Shows the error information from the places model
|
|
|
|
* in the status bar.
|
|
|
|
*/
|
|
|
|
void slotHandlePlacesError(const QString &message);
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
/**
|
|
|
|
* Updates the state of the 'Undo' menu action dependent
|
|
|
|
* from the parameter \a available.
|
|
|
|
*/
|
|
|
|
void slotUndoAvailable(bool available);
|
|
|
|
|
|
|
|
/** Sets the text of the 'Undo' menu action to \a text. */
|
|
|
|
void slotUndoTextChanged(const QString& text);
|
|
|
|
|
2007-01-31 22:14:46 +00:00
|
|
|
/** Performs the current undo operation. */
|
|
|
|
void undo();
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
/**
|
|
|
|
* Copies all selected items to the clipboard and marks
|
|
|
|
* the items as cutted.
|
|
|
|
*/
|
|
|
|
void cut();
|
|
|
|
|
|
|
|
/** Copies all selected items to the clipboard. */
|
|
|
|
void copy();
|
|
|
|
|
|
|
|
/** Pastes the clipboard data to the active view. */
|
|
|
|
void paste();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the text of the paste action dependent from
|
|
|
|
* the number of items which are in the clipboard.
|
|
|
|
*/
|
|
|
|
void updatePasteAction();
|
|
|
|
|
|
|
|
/** Selects all items from the active view. */
|
|
|
|
void selectAll();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inverts the selection of all items of the active view:
|
|
|
|
* Selected items get nonselected and nonselected items get
|
|
|
|
* selected.
|
|
|
|
*/
|
|
|
|
void invertSelection();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Switches between one and two views:
|
|
|
|
* If one view is visible, it will get split into two views.
|
|
|
|
* If already two views are visible, the nonactivated view gets closed.
|
|
|
|
*/
|
|
|
|
void toggleSplitView();
|
|
|
|
|
|
|
|
/** Reloads the current active view. */
|
|
|
|
void reloadView();
|
|
|
|
|
|
|
|
/** Stops the loading process for the current active view. */
|
|
|
|
void stopLoading();
|
|
|
|
|
|
|
|
/**
|
2008-01-28 11:37:08 +00:00
|
|
|
* Toggles between showing and hiding of the filter bar
|
2006-11-21 06:02:05 +00:00
|
|
|
*/
|
2008-01-28 11:37:08 +00:00
|
|
|
void toggleFilterBarVisibility(bool show);
|
2006-11-21 06:02:05 +00:00
|
|
|
|
|
|
|
/**
|
2008-02-07 07:27:06 +00:00
|
|
|
* Toggles between edit and browse mode of the navigation bar.
|
2006-11-21 06:02:05 +00:00
|
|
|
*/
|
|
|
|
void toggleEditLocation();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Switches to the edit mode of the navigation bar. If the edit mode is
|
|
|
|
* already active, it is assured that the navigation bar get focused.
|
|
|
|
*/
|
|
|
|
void editLocation();
|
|
|
|
|
2007-03-13 17:31:54 +00:00
|
|
|
/** Goes back on step of the URL history. */
|
2006-11-21 06:02:05 +00:00
|
|
|
void goBack();
|
|
|
|
|
2007-03-13 17:31:54 +00:00
|
|
|
/** Goes forward one step of the URL history. */
|
2006-11-21 06:02:05 +00:00
|
|
|
void goForward();
|
|
|
|
|
2007-03-13 17:31:54 +00:00
|
|
|
/** Goes up one hierarchy of the current URL. */
|
2006-11-21 06:02:05 +00:00
|
|
|
void goUp();
|
|
|
|
|
2007-03-13 17:31:54 +00:00
|
|
|
/** Goes to the home URL. */
|
2006-11-21 06:02:05 +00:00
|
|
|
void goHome();
|
|
|
|
|
|
|
|
/** Opens Kompare for 2 selected files. */
|
|
|
|
void compareFiles();
|
|
|
|
|
2008-07-26 13:49:50 +00:00
|
|
|
/**
|
|
|
|
* Initiates a preview of the selected files
|
|
|
|
* on the desktop by the Previewer plasmoid.
|
|
|
|
*/
|
|
|
|
void quickView();
|
|
|
|
|
2007-11-18 14:37:57 +00:00
|
|
|
/**
|
|
|
|
* Hides the menu bar if it is visible, makes the menu bar
|
|
|
|
* visible if it is hidden.
|
|
|
|
*/
|
|
|
|
void toggleShowMenuBar();
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
/** Opens the settings dialog for Dolphin. */
|
|
|
|
void editSettings();
|
|
|
|
|
2008-02-07 07:27:06 +00:00
|
|
|
/** Updates the state of the 'Show Full Location' action. */
|
|
|
|
void slotEditableStateChanged(bool editable);
|
|
|
|
|
2007-05-17 14:51:54 +00:00
|
|
|
/**
|
|
|
|
* Updates the state of the 'Edit' menu actions and emits
|
|
|
|
* the signal selectionChanged().
|
|
|
|
*/
|
2007-10-02 19:03:03 +00:00
|
|
|
void slotSelectionChanged(const KFileItemList& selection);
|
2006-12-08 23:41:08 +00:00
|
|
|
|
2007-05-17 14:51:54 +00:00
|
|
|
/** Emits the signal requestItemInfo(). */
|
2007-07-02 17:24:54 +00:00
|
|
|
void slotRequestItemInfo(const KFileItem&);
|
2007-05-17 14:51:54 +00:00
|
|
|
|
2006-12-08 23:41:08 +00:00
|
|
|
/**
|
|
|
|
* Updates the state of the 'Back' and 'Forward' menu
|
2008-09-25 15:05:22 +00:00
|
|
|
* actions corresponding to the current history.
|
2006-12-08 23:41:08 +00:00
|
|
|
*/
|
2008-02-23 15:48:56 +00:00
|
|
|
void updateHistory();
|
2006-12-08 23:41:08 +00:00
|
|
|
|
|
|
|
/** Updates the state of the 'Show filter bar' menu action. */
|
|
|
|
void updateFilterBarAction(bool show);
|
|
|
|
|
|
|
|
/** Open a new main window. */
|
|
|
|
void openNewMainWindow();
|
2006-11-21 06:02:05 +00:00
|
|
|
|
2008-04-12 16:12:57 +00:00
|
|
|
/** Opens a new view with the current URL that is part of a tab. */
|
2008-04-12 15:09:46 +00:00
|
|
|
void openNewTab();
|
|
|
|
|
2008-04-12 16:12:57 +00:00
|
|
|
/**
|
|
|
|
* Opens a new tab showing the URL \a url.
|
|
|
|
*/
|
|
|
|
void openNewTab(const KUrl& url);
|
|
|
|
|
2007-06-07 21:10:48 +00:00
|
|
|
/** Toggles the active view if two views are shown within the main window. */
|
|
|
|
void toggleActiveView();
|
|
|
|
|
2007-11-15 20:04:05 +00:00
|
|
|
/** Called when the view is doing a file operation, like renaming, copying, moving etc. */
|
2008-04-30 23:32:33 +00:00
|
|
|
void slotDoingOperation(KIO::FileUndoManager::CommandType type);
|
2007-11-15 14:59:02 +00:00
|
|
|
|
2008-04-12 15:09:46 +00:00
|
|
|
/**
|
|
|
|
* Activates the tab with the index \a index, which means that the current view
|
|
|
|
* is replaced by the view of the given tab.
|
|
|
|
*/
|
|
|
|
void setActiveTab(int index);
|
|
|
|
|
2008-04-16 20:03:05 +00:00
|
|
|
/** Closes the currently active tab. */
|
|
|
|
void closeTab();
|
|
|
|
|
2008-04-13 20:20:30 +00:00
|
|
|
/**
|
|
|
|
* Closes the tab with the index \index and activates the tab with index - 1.
|
|
|
|
*/
|
|
|
|
void closeTab(int index);
|
|
|
|
|
2008-04-16 20:03:05 +00:00
|
|
|
/**
|
|
|
|
* Opens a context menu for the tab with the index \a index
|
|
|
|
* on the position \a pos.
|
|
|
|
*/
|
|
|
|
void openTabContextMenu(int index, const QPoint& pos);
|
|
|
|
|
2008-05-11 20:14:50 +00:00
|
|
|
/**
|
|
|
|
* Handles a click on a places item: if the middle mouse button is
|
|
|
|
* clicked, a new tab is opened for \a url, otherwise the current
|
|
|
|
* view is replaced by \a url.
|
|
|
|
*/
|
|
|
|
void handlePlacesClick(const KUrl& url, Qt::MouseButtons buttons);
|
2008-08-12 19:22:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Is connected to the KTabBar signal testCanDecode() and adjusts
|
|
|
|
* the output parameter \a accept.
|
|
|
|
*/
|
|
|
|
void slotTestCanDecode(const QDragMoveEvent* event, bool& accept);
|
2008-05-11 20:14:50 +00:00
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
private:
|
2007-02-18 17:01:36 +00:00
|
|
|
DolphinMainWindow(int id);
|
2006-11-21 06:02:05 +00:00
|
|
|
void init();
|
|
|
|
|
2007-06-12 21:45:22 +00:00
|
|
|
/**
|
|
|
|
* Activates the given view, which means that
|
|
|
|
* all menu actions are applied to this view. When
|
|
|
|
* having a split view setup, the nonactive view
|
|
|
|
* is usually shown in darker colors.
|
|
|
|
*/
|
|
|
|
void setActiveViewContainer(DolphinViewContainer* view);
|
|
|
|
|
2006-11-21 06:02:05 +00:00
|
|
|
void setupActions();
|
2006-11-29 18:09:26 +00:00
|
|
|
void setupDockWidgets();
|
2006-11-21 06:02:05 +00:00
|
|
|
void updateEditActions();
|
|
|
|
void updateViewActions();
|
|
|
|
void updateGoActions();
|
|
|
|
|
2006-12-08 23:41:08 +00:00
|
|
|
/**
|
|
|
|
* Connects the signals from the created DolphinView with
|
2008-04-12 15:09:46 +00:00
|
|
|
* the DolphinViewContainer \a container with the corresponding slots of
|
2006-12-08 23:41:08 +00:00
|
|
|
* the DolphinMainWindow. This method must be invoked each
|
|
|
|
* time a DolphinView has been created.
|
|
|
|
*/
|
2008-04-12 15:09:46 +00:00
|
|
|
void connectViewSignals(DolphinViewContainer* container);
|
2007-03-25 06:44:28 +00:00
|
|
|
|
2007-06-03 14:07:45 +00:00
|
|
|
/**
|
|
|
|
* Updates the text of the split action:
|
2007-08-12 17:48:29 +00:00
|
|
|
* If two views are shown, the text is set to "Split",
|
2007-06-03 14:07:45 +00:00
|
|
|
* otherwise the text is set to "Join". The icon
|
2007-08-12 17:48:29 +00:00
|
|
|
* is updated to match with the text and the currently active view.
|
2007-06-03 14:07:45 +00:00
|
|
|
*/
|
2007-08-12 17:48:29 +00:00
|
|
|
void updateSplitAction();
|
2007-06-03 14:07:45 +00:00
|
|
|
|
2008-04-16 20:03:05 +00:00
|
|
|
/** Returns the name of the tab for the URL \a url. */
|
|
|
|
QString tabName(const KUrl& url) const;
|
|
|
|
|
2008-06-28 18:42:51 +00:00
|
|
|
bool isKompareInstalled() const;
|
|
|
|
|
2008-04-12 15:09:46 +00:00
|
|
|
private:
|
2007-01-25 19:37:19 +00:00
|
|
|
/**
|
|
|
|
* Implements a custom error handling for the undo manager. This
|
|
|
|
* assures that all errors are shown in the status bar of Dolphin
|
|
|
|
* instead as modal error dialog with an OK button.
|
|
|
|
*/
|
2008-04-30 23:32:33 +00:00
|
|
|
class UndoUiInterface : public KIO::FileUndoManager::UiInterface
|
2007-01-26 00:55:49 +00:00
|
|
|
{
|
2007-01-25 19:37:19 +00:00
|
|
|
public:
|
2008-04-20 22:07:44 +00:00
|
|
|
UndoUiInterface();
|
2007-01-25 19:37:19 +00:00
|
|
|
virtual ~UndoUiInterface();
|
|
|
|
virtual void jobError(KIO::Job* job);
|
2006-11-21 06:02:05 +00:00
|
|
|
};
|
2007-01-26 00:55:49 +00:00
|
|
|
|
|
|
|
KNewMenu* m_newMenu;
|
2007-11-18 14:37:57 +00:00
|
|
|
KAction* m_showMenuBar;
|
2008-04-12 15:09:46 +00:00
|
|
|
KTabBar* m_tabBar;
|
2007-06-07 21:10:48 +00:00
|
|
|
DolphinViewContainer* m_activeViewContainer;
|
2008-04-12 15:09:46 +00:00
|
|
|
QVBoxLayout* m_centralWidgetLayout;
|
2007-02-18 17:01:36 +00:00
|
|
|
int m_id;
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2008-04-12 15:09:46 +00:00
|
|
|
struct ViewTab
|
|
|
|
{
|
2008-04-13 19:12:52 +00:00
|
|
|
ViewTab() : isPrimaryViewActive(true), primaryView(0), secondaryView(0), splitter(0) {}
|
|
|
|
bool isPrimaryViewActive;
|
2008-04-12 15:09:46 +00:00
|
|
|
DolphinViewContainer* primaryView;
|
|
|
|
DolphinViewContainer* secondaryView;
|
|
|
|
QSplitter* splitter;
|
|
|
|
};
|
|
|
|
|
|
|
|
int m_tabIndex;
|
|
|
|
QList<ViewTab> m_viewTab;
|
2007-01-26 00:55:49 +00:00
|
|
|
|
2008-02-11 12:34:48 +00:00
|
|
|
DolphinViewActionHandler* m_actionHandler;
|
|
|
|
|
2007-01-26 00:55:49 +00:00
|
|
|
/// remember pending undo operations until they are finished
|
2008-04-30 23:32:33 +00:00
|
|
|
QList<KIO::FileUndoManager::CommandType> m_undoCommandTypes;
|
2006-11-21 06:02:05 +00:00
|
|
|
};
|
|
|
|
|
2007-09-27 12:44:14 +00:00
|
|
|
inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const
|
2007-06-12 21:45:22 +00:00
|
|
|
{
|
|
|
|
return m_activeViewContainer;
|
|
|
|
}
|
|
|
|
|
2007-09-27 12:44:14 +00:00
|
|
|
inline bool DolphinMainWindow::isSplit() const
|
2007-06-12 21:45:22 +00:00
|
|
|
{
|
2008-04-12 15:09:46 +00:00
|
|
|
return m_viewTab[m_tabIndex].secondaryView != 0;
|
2007-06-12 21:45:22 +00:00
|
|
|
}
|
|
|
|
|
2007-09-27 12:44:14 +00:00
|
|
|
inline KNewMenu* DolphinMainWindow::newMenu() const
|
2007-06-12 21:45:22 +00:00
|
|
|
{
|
|
|
|
return m_newMenu;
|
|
|
|
}
|
|
|
|
|
2007-11-18 14:37:57 +00:00
|
|
|
inline KAction* DolphinMainWindow::showMenuBarAction() const
|
|
|
|
{
|
|
|
|
return m_showMenuBar;
|
|
|
|
}
|
|
|
|
|
2007-09-27 12:44:14 +00:00
|
|
|
inline int DolphinMainWindow::getId() const
|
2007-06-12 21:45:22 +00:00
|
|
|
{
|
|
|
|
return m_id;
|
|
|
|
}
|
|
|
|
|
2007-03-15 19:51:48 +00:00
|
|
|
#endif // DOLPHIN_MAINWINDOW_H
|
2006-11-21 06:02:05 +00:00
|
|
|
|