forked from qt-creator/qt-creator
QmlDesigner: Rename DefaultDesignerAction to AbstractAction
We are already in the QmlDesigner namespace and default gives no real information about the class. Change-Id: Ia45c93c778d207c5237d52f5bd2bef6ee6559bb5 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -28,32 +28,32 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "defaultdesigneraction.h"
|
#include "abstractaction.h"
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
DefaultDesignerAction::DefaultDesignerAction(const QString &description)
|
AbstractAction::AbstractAction(const QString &description)
|
||||||
: m_defaultAction(new DefaultAction(description))
|
: m_defaultAction(new DefaultAction(description))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultDesignerAction::DefaultDesignerAction(DefaultAction *action)
|
AbstractAction::AbstractAction(DefaultAction *action)
|
||||||
: m_defaultAction(action)
|
: m_defaultAction(action)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction *DefaultDesignerAction::action() const
|
QAction *AbstractAction::action() const
|
||||||
{
|
{
|
||||||
return m_defaultAction.data();
|
return m_defaultAction.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultDesignerAction::currentContextChanged(const SelectionContext &selectionContext)
|
void AbstractAction::currentContextChanged(const SelectionContext &selectionContext)
|
||||||
{
|
{
|
||||||
m_selectionContext = selectionContext;
|
m_selectionContext = selectionContext;
|
||||||
updateContext();
|
updateContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultDesignerAction::updateContext()
|
void AbstractAction::updateContext()
|
||||||
{
|
{
|
||||||
m_defaultAction->setSelectionContext(m_selectionContext);
|
m_defaultAction->setSelectionContext(m_selectionContext);
|
||||||
if (m_selectionContext.isValid()) {
|
if (m_selectionContext.isValid()) {
|
||||||
@@ -62,12 +62,12 @@ void DefaultDesignerAction::updateContext()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultAction *DefaultDesignerAction::defaultAction() const
|
DefaultAction *AbstractAction::defaultAction() const
|
||||||
{
|
{
|
||||||
return m_defaultAction.data();
|
return m_defaultAction.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectionContext DefaultDesignerAction::selectionContext() const
|
SelectionContext AbstractAction::selectionContext() const
|
||||||
{
|
{
|
||||||
return m_selectionContext;
|
return m_selectionContext;
|
||||||
}
|
}
|
@@ -56,11 +56,11 @@ protected:
|
|||||||
SelectionContext m_selectionContext;
|
SelectionContext m_selectionContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLDESIGNERCORE_EXPORT DefaultDesignerAction : public ActionInterface
|
class QMLDESIGNERCORE_EXPORT AbstractAction : public ActionInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DefaultDesignerAction(const QString &description = QString());
|
AbstractAction(const QString &description = QString());
|
||||||
DefaultDesignerAction(DefaultAction *action);
|
AbstractAction(DefaultAction *action);
|
||||||
|
|
||||||
QAction *action() const;
|
QAction *action() const;
|
||||||
DefaultAction *defaultAction() const;
|
DefaultAction *defaultAction() const;
|
@@ -3,7 +3,7 @@ VPATH += $$PWD
|
|||||||
SOURCES += modelnodecontextmenu.cpp
|
SOURCES += modelnodecontextmenu.cpp
|
||||||
SOURCES += abstractactiongroup.cpp
|
SOURCES += abstractactiongroup.cpp
|
||||||
SOURCES += designeractionmanagerview.cpp
|
SOURCES += designeractionmanagerview.cpp
|
||||||
SOURCES += defaultdesigneraction.cpp
|
SOURCES += abstractaction.cpp
|
||||||
SOURCES += modelnodecontextmenu_helper.cpp
|
SOURCES += modelnodecontextmenu_helper.cpp
|
||||||
SOURCES += selectioncontext.cpp
|
SOURCES += selectioncontext.cpp
|
||||||
SOURCES += designeractionmanager.cpp
|
SOURCES += designeractionmanager.cpp
|
||||||
@@ -13,7 +13,7 @@ SOURCES += crumblebar.cpp
|
|||||||
HEADERS += modelnodecontextmenu.h
|
HEADERS += modelnodecontextmenu.h
|
||||||
HEADERS += abstractactiongroup.h
|
HEADERS += abstractactiongroup.h
|
||||||
HEADERS += designeractionmanagerview.h
|
HEADERS += designeractionmanagerview.h
|
||||||
HEADERS += defaultdesigneraction.h
|
HEADERS += abstractaction.h
|
||||||
HEADERS += modelnodecontextmenu_helper.h
|
HEADERS += modelnodecontextmenu_helper.h
|
||||||
HEADERS += selectioncontext.h
|
HEADERS += selectioncontext.h
|
||||||
HEADERS += componentcore_constants.h
|
HEADERS += componentcore_constants.h
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
#define MODELNODECONTEXTMENU_HELPER_H
|
#define MODELNODECONTEXTMENU_HELPER_H
|
||||||
|
|
||||||
#include "modelnodeoperations.h"
|
#include "modelnodeoperations.h"
|
||||||
#include "defaultdesigneraction.h"
|
#include "abstractaction.h"
|
||||||
#include "abstractactiongroup.h"
|
#include "abstractactiongroup.h"
|
||||||
#include "qmlitemnode.h"
|
#include "qmlitemnode.h"
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ private:
|
|||||||
SelectionContextFunction m_visibility;
|
SelectionContextFunction m_visibility;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SeperatorDesignerAction : public DefaultDesignerAction
|
class SeperatorDesignerAction : public AbstractAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SeperatorDesignerAction(const QByteArray &category, int priority) :
|
SeperatorDesignerAction(const QByteArray &category, int priority) :
|
||||||
@@ -165,14 +165,14 @@ private:
|
|||||||
SelectionContextFunction m_visibility;
|
SelectionContextFunction m_visibility;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModelNodeAction : public DefaultDesignerAction
|
class ModelNodeAction : public AbstractAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModelNodeAction(const QString &description, const QByteArray &category, int priority,
|
ModelNodeAction(const QString &description, const QByteArray &category, int priority,
|
||||||
ModelNodeOperations::SelectionAction selectionAction,
|
ModelNodeOperations::SelectionAction selectionAction,
|
||||||
SelectionContextFunction enabled = &SelectionContextFunctors::always,
|
SelectionContextFunction enabled = &SelectionContextFunctors::always,
|
||||||
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
|
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
|
||||||
DefaultDesignerAction(new ActionTemplate(description, selectionAction)),
|
AbstractAction(new ActionTemplate(description, selectionAction)),
|
||||||
m_category(category),
|
m_category(category),
|
||||||
m_priority(priority),
|
m_priority(priority),
|
||||||
m_enabled(enabled),
|
m_enabled(enabled),
|
||||||
|
@@ -57,7 +57,7 @@ bool isTabAndParentIsTabView(const ModelNode &modelNode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddTabDesignerAction::AddTabDesignerAction()
|
AddTabDesignerAction::AddTabDesignerAction()
|
||||||
: DefaultDesignerAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
|
: AbstractAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
|
||||||
{
|
{
|
||||||
connect(action(), SIGNAL(triggered()), this, SLOT(addNewTab()));
|
connect(action(), SIGNAL(triggered()), this, SLOT(addNewTab()));
|
||||||
}
|
}
|
||||||
|
@@ -30,11 +30,11 @@
|
|||||||
#ifndef QMLDESIGNER_TABVIEWDESIGNERACTION_H
|
#ifndef QMLDESIGNER_TABVIEWDESIGNERACTION_H
|
||||||
#define QMLDESIGNER_TABVIEWDESIGNERACTION_H
|
#define QMLDESIGNER_TABVIEWDESIGNERACTION_H
|
||||||
|
|
||||||
#include "defaultdesigneraction.h"
|
#include "abstractaction.h"
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
class AddTabDesignerAction : public QObject, public DefaultDesignerAction
|
class AddTabDesignerAction : public QObject, public AbstractAction
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user