From 8d9710c0747a68f9938c8e7d32110f67ba64cc1e Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 23 Jan 2013 12:31:22 +0100 Subject: Refactoring document handling The document handling in the qml designer was complicated source code, which was initially intended for a non creator application. To integrate new views it has to be changed and cleaned up. This is the first major step in that direction. Change-Id: Ie26f0aad7a03946d18bdb4c0759b246c5439d922 Reviewed-by: Tim Jenssen Reviewed-by: Alessandro Portale --- src/plugins/qmldesigner/shortcutmanager.h | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/plugins/qmldesigner/shortcutmanager.h (limited to 'src/plugins/qmldesigner/shortcutmanager.h') diff --git a/src/plugins/qmldesigner/shortcutmanager.h b/src/plugins/qmldesigner/shortcutmanager.h new file mode 100644 index 0000000000..03a5450eb6 --- /dev/null +++ b/src/plugins/qmldesigner/shortcutmanager.h @@ -0,0 +1,72 @@ +#ifndef QMLDESIGNER_SHORTCUTMANAGER_H +#define QMLDESIGNER_SHORTCUTMANAGER_H + +#include +#include +#include + + +namespace Core { + class IEditor; +} + +namespace QmlDesigner { + +class DesignDocument; + +class ShortCutManager : public QObject +{ + Q_OBJECT + +public: + ShortCutManager(); + + void registerActions(); + + void connectUndoActions(DesignDocument *designDocument); + void disconnectUndoActions(DesignDocument *designDocument); + void updateUndoActions(DesignDocument *designDocument); + DesignDocument *currentDesignDocument() const; + +public slots: + void updateActions(Core::IEditor* editor); + +private slots: + void undo(); + void redo(); + void deleteSelected(); + void cutSelected(); + void copySelected(); + void paste(); + void selectAll(); + void toggleSidebars(); + void toggleLeftSidebar(); + void toggleRightSidebar(); + void undoAvailable(bool isAvailable); + void redoAvailable(bool isAvailable); + void goIntoComponent(); + +private: + QAction m_revertToSavedAction; + QAction m_saveAction; + QAction m_saveAsAction; + QAction m_closeCurrentEditorAction; + QAction m_closeAllEditorsAction; + QAction m_closeOtherEditorsAction; + QAction m_undoAction; + QAction m_redoAction; + Utils::ParameterAction m_deleteAction; + Utils::ParameterAction m_cutAction; + Utils::ParameterAction m_copyAction; + Utils::ParameterAction m_pasteAction; + Utils::ParameterAction m_selectAllAction; + QAction m_hideSidebarsAction; + QAction m_restoreDefaultViewAction; + QAction m_toggleLeftSidebarAction; + QAction m_toggleRightSidebarAction; + QAction m_goIntoComponentAction; +}; + +} // namespace QmlDesigner + +#endif // QMLDESIGNER_SHORTCUTMANAGER_H -- cgit v1.2.1