Commit 3934347f authored by Eike Ziller's avatar Eike Ziller Committed by hjk
Browse files

ActionManager API cleanup.



d-pointer instead of inheritance
static methods

Change-Id: I7b2f0c8b05ad3951e1ff26a7d4e08e195d2dd258
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 7c7ccdc7
...@@ -170,13 +170,13 @@ ...@@ -170,13 +170,13 @@
\row \row
\o Add a menu or menu item. \o Add a menu or menu item.
\o You can extend existing menus or create new ones. \o You can extend existing menus or create new ones.
\o \l{Core::ActionManager}, \l{Core::Command}, \l{Core::ICore::actionManager()} \o \l{Core::ActionManager}, \l{Core::Command}
\row \row
\o Add a configurable keyboard shortcut. \o Add a configurable keyboard shortcut.
\o Registering shortcuts makes it possible for users to configure them in \o Registering shortcuts makes it possible for users to configure them in
the common shortcut settings dialog. the common shortcut settings dialog.
\o \l{Core::ActionManager}, \l{Core::Command}, \l{Core::ICore::actionManager()} \o \l{Core::ActionManager}, \l{Core::Command}
\row \row
\o Add a mode. \o Add a mode.
......
...@@ -39,18 +39,17 @@ bool %PluginName%Plugin::initialize(const QStringList &arguments, QString *error ...@@ -39,18 +39,17 @@ bool %PluginName%Plugin::initialize(const QStringList &arguments, QString *error
Q_UNUSED(arguments) Q_UNUSED(arguments)
Q_UNUSED(errorString) Q_UNUSED(errorString)
Core::ActionManager *am = Core::ICore::actionManager();
QAction *action = new QAction(tr("%PluginName% action"), this); QAction *action = new QAction(tr("%PluginName% action"), this);
Core::Command *cmd = am->registerAction(action, Constants::ACTION_ID, Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
Core::Context(Core::Constants::C_GLOBAL)); Core::Context(Core::Constants::C_GLOBAL));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A")));
connect(action, SIGNAL(triggered()), this, SLOT(triggerAction())); connect(action, SIGNAL(triggered()), this, SLOT(triggerAction()));
Core::ActionContainer *menu = am->createMenu(Constants::MENU_ID); Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID);
menu->menu()->setTitle(tr("%PluginName%")); menu->menu()->setTitle(tr("%PluginName%"));
menu->addAction(cmd); menu->addAction(cmd);
am->actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
return true; return true;
} }
......
...@@ -258,12 +258,11 @@ AnalyzerManagerPrivate::~AnalyzerManagerPrivate() ...@@ -258,12 +258,11 @@ AnalyzerManagerPrivate::~AnalyzerManagerPrivate()
void AnalyzerManagerPrivate::setupActions() void AnalyzerManagerPrivate::setupActions()
{ {
ActionManager *am = ICore::actionManager();
const Context globalcontext(C_GLOBAL); const Context globalcontext(C_GLOBAL);
Command *command = 0; Command *command = 0;
// Menus // Menus
m_menu = am->createMenu(M_DEBUG_ANALYZER); m_menu = Core::ActionManager::createMenu(M_DEBUG_ANALYZER);
m_menu->menu()->setTitle(tr("&Analyze")); m_menu->menu()->setTitle(tr("&Analyze"));
m_menu->menu()->setEnabled(true); m_menu->menu()->setEnabled(true);
...@@ -272,36 +271,36 @@ void AnalyzerManagerPrivate::setupActions() ...@@ -272,36 +271,36 @@ void AnalyzerManagerPrivate::setupActions()
m_menu->appendGroup(G_ANALYZER_REMOTE_TOOLS); m_menu->appendGroup(G_ANALYZER_REMOTE_TOOLS);
m_menu->appendGroup(G_ANALYZER_OPTIONS); m_menu->appendGroup(G_ANALYZER_OPTIONS);
ActionContainer *menubar = am->actionContainer(MENU_BAR); ActionContainer *menubar = Core::ActionManager::actionContainer(MENU_BAR);
ActionContainer *mtools = am->actionContainer(M_TOOLS); ActionContainer *mtools = Core::ActionManager::actionContainer(M_TOOLS);
menubar->addMenu(mtools, m_menu); menubar->addMenu(mtools, m_menu);
m_startAction = new QAction(tr("Start"), m_menu); m_startAction = new QAction(tr("Start"), m_menu);
m_startAction->setIcon(QIcon(QLatin1String(ANALYZER_CONTROL_START_ICON))); m_startAction->setIcon(QIcon(QLatin1String(ANALYZER_CONTROL_START_ICON)));
command = am->registerAction(m_startAction, "Analyzer.Start", globalcontext); command = Core::ActionManager::registerAction(m_startAction, "Analyzer.Start", globalcontext);
connect(m_startAction, SIGNAL(triggered()), this, SLOT(startTool())); connect(m_startAction, SIGNAL(triggered()), this, SLOT(startTool()));
m_stopAction = new QAction(tr("Stop"), m_menu); m_stopAction = new QAction(tr("Stop"), m_menu);
m_stopAction->setEnabled(false); m_stopAction->setEnabled(false);
m_stopAction->setIcon(QIcon(QLatin1String(ANALYZER_CONTROL_STOP_ICON))); m_stopAction->setIcon(QIcon(QLatin1String(ANALYZER_CONTROL_STOP_ICON)));
command = am->registerAction(m_stopAction, "Analyzer.Stop", globalcontext); command = Core::ActionManager::registerAction(m_stopAction, "Analyzer.Stop", globalcontext);
m_menu->addAction(command, G_ANALYZER_CONTROL); m_menu->addAction(command, G_ANALYZER_CONTROL);
QAction *separatorAction1 = new QAction(m_menu); QAction *separatorAction1 = new QAction(m_menu);
separatorAction1->setSeparator(true); separatorAction1->setSeparator(true);
command = am->registerAction(separatorAction1, command = Core::ActionManager::registerAction(separatorAction1,
"Menu.Action.Analyzer.Tools.Separator1", globalcontext); "Menu.Action.Analyzer.Tools.Separator1", globalcontext);
m_menu->addAction(command, G_ANALYZER_TOOLS); m_menu->addAction(command, G_ANALYZER_TOOLS);
QAction *separatorAction2 = new QAction(m_menu); QAction *separatorAction2 = new QAction(m_menu);
separatorAction2->setSeparator(true); separatorAction2->setSeparator(true);
command = am->registerAction(separatorAction2, command = Core::ActionManager::registerAction(separatorAction2,
"Menu.Action.Analyzer.Tools.Separator2", globalcontext); "Menu.Action.Analyzer.Tools.Separator2", globalcontext);
m_menu->addAction(command, G_ANALYZER_REMOTE_TOOLS); m_menu->addAction(command, G_ANALYZER_REMOTE_TOOLS);
QAction *separatorAction3 = new QAction(m_menu); QAction *separatorAction3 = new QAction(m_menu);
separatorAction3->setSeparator(true); separatorAction3->setSeparator(true);
command = am->registerAction(separatorAction3, command = Core::ActionManager::registerAction(separatorAction3,
"Menu.Action.Analyzer.Tools.Separator3", globalcontext); "Menu.Action.Analyzer.Tools.Separator3", globalcontext);
m_menu->addAction(command, G_ANALYZER_OPTIONS); m_menu->addAction(command, G_ANALYZER_OPTIONS);
} }
...@@ -334,21 +333,20 @@ void AnalyzerManagerPrivate::delayedInit() ...@@ -334,21 +333,20 @@ void AnalyzerManagerPrivate::delayedInit()
// Populate Windows->Views menu with standard actions. // Populate Windows->Views menu with standard actions.
Context analyzerContext(C_ANALYZEMODE); Context analyzerContext(C_ANALYZEMODE);
ActionManager *am = ICore::actionManager(); ActionContainer *viewsMenu = Core::ActionManager::actionContainer(Id(M_WINDOW_VIEWS));
ActionContainer *viewsMenu = am->actionContainer(Id(M_WINDOW_VIEWS)); Command *cmd = Core::ActionManager::registerAction(m_mainWindow->menuSeparator1(),
Command *cmd = am->registerAction(m_mainWindow->menuSeparator1(),
Id("Analyzer.Views.Separator1"), analyzerContext); Id("Analyzer.Views.Separator1"), analyzerContext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
viewsMenu->addAction(cmd, G_DEFAULT_THREE); viewsMenu->addAction(cmd, G_DEFAULT_THREE);
cmd = am->registerAction(m_mainWindow->toggleLockedAction(), cmd = Core::ActionManager::registerAction(m_mainWindow->toggleLockedAction(),
Id("Analyzer.Views.ToggleLocked"), analyzerContext); Id("Analyzer.Views.ToggleLocked"), analyzerContext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
viewsMenu->addAction(cmd, G_DEFAULT_THREE); viewsMenu->addAction(cmd, G_DEFAULT_THREE);
cmd = am->registerAction(m_mainWindow->menuSeparator2(), cmd = Core::ActionManager::registerAction(m_mainWindow->menuSeparator2(),
Id("Analyzer.Views.Separator2"), analyzerContext); Id("Analyzer.Views.Separator2"), analyzerContext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
viewsMenu->addAction(cmd, G_DEFAULT_THREE); viewsMenu->addAction(cmd, G_DEFAULT_THREE);
cmd = am->registerAction(m_mainWindow->resetLayoutAction(), cmd = Core::ActionManager::registerAction(m_mainWindow->resetLayoutAction(),
Id("Analyzer.Views.ResetSimple"), analyzerContext); Id("Analyzer.Views.ResetSimple"), analyzerContext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
viewsMenu->addAction(cmd, G_DEFAULT_THREE); viewsMenu->addAction(cmd, G_DEFAULT_THREE);
...@@ -428,22 +426,20 @@ void AnalyzerManagerPrivate::activateDock(Qt::DockWidgetArea area, QDockWidget * ...@@ -428,22 +426,20 @@ void AnalyzerManagerPrivate::activateDock(Qt::DockWidgetArea area, QDockWidget *
Context globalContext(C_GLOBAL); Context globalContext(C_GLOBAL);
ActionManager *am = ICore::actionManager();
QAction *toggleViewAction = dockWidget->toggleViewAction(); QAction *toggleViewAction = dockWidget->toggleViewAction();
toggleViewAction->setText(dockWidget->windowTitle()); toggleViewAction->setText(dockWidget->windowTitle());
Command *cmd = am->registerAction(toggleViewAction, Command *cmd = Core::ActionManager::registerAction(toggleViewAction,
Id(QLatin1String("Analyzer.") + dockWidget->objectName()), globalContext); Id(QLatin1String("Analyzer.") + dockWidget->objectName()), globalContext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
ActionContainer *viewsMenu = am->actionContainer(Id(M_WINDOW_VIEWS)); ActionContainer *viewsMenu = Core::ActionManager::actionContainer(Id(M_WINDOW_VIEWS));
viewsMenu->addAction(cmd); viewsMenu->addAction(cmd);
} }
void AnalyzerManagerPrivate::deactivateDock(QDockWidget *dockWidget) void AnalyzerManagerPrivate::deactivateDock(QDockWidget *dockWidget)
{ {
ActionManager *am = ICore::actionManager();
QAction *toggleViewAction = dockWidget->toggleViewAction(); QAction *toggleViewAction = dockWidget->toggleViewAction();
am->unregisterAction(toggleViewAction, Id(QLatin1String("Analyzer.") + dockWidget->objectName())); Core::ActionManager::unregisterAction(toggleViewAction, Id(QLatin1String("Analyzer.") + dockWidget->objectName()));
m_mainWindow->removeDockWidget(dockWidget); m_mainWindow->removeDockWidget(dockWidget);
dockWidget->hide(); dockWidget->hide();
// Prevent saveState storing the data of the wrong children. // Prevent saveState storing the data of the wrong children.
...@@ -682,13 +678,12 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode ...@@ -682,13 +678,12 @@ void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &mode
delayedInit(); // Make sure that there is a valid IMode instance. delayedInit(); // Make sure that there is a valid IMode instance.
const bool blocked = m_toolBox->blockSignals(true); // Do not make current. const bool blocked = m_toolBox->blockSignals(true); // Do not make current.
ActionManager *am = ICore::actionManager();
foreach (StartMode mode, modes) { foreach (StartMode mode, modes) {
QString actionName = tool->actionName(mode); QString actionName = tool->actionName(mode);
Id menuGroup = tool->menuGroup(mode); Id menuGroup = tool->menuGroup(mode);
Id actionId = tool->actionId(mode); Id actionId = tool->actionId(mode);
QAction *action = new QAction(actionName, 0); QAction *action = new QAction(actionName, 0);
Command *command = am->registerAction(action, actionId, Context(C_GLOBAL)); Command *command = Core::ActionManager::registerAction(action, actionId, Context(C_GLOBAL));
m_menu->addAction(command, menuGroup); m_menu->addAction(command, menuGroup);
command->action()->setData(int(StartLocal)); command->action()->setData(int(StartLocal));
// Assuming this happens before project loading. // Assuming this happens before project loading.
......
...@@ -155,8 +155,6 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag ...@@ -155,8 +155,6 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
m_client = new BazaarClient(&m_bazaarSettings); m_client = new BazaarClient(&m_bazaarSettings);
initializeVcs(new BazaarControl(m_client)); initializeVcs(new BazaarControl(m_client));
m_actionManager = Core::ICore::actionManager();
m_optionsPage = new OptionsPage(); m_optionsPage = new OptionsPage();
addAutoReleasedObject(m_optionsPage); addAutoReleasedObject(m_optionsPage);
m_bazaarSettings.readSettings(Core::ICore::settings()); m_bazaarSettings.readSettings(Core::ICore::settings());
...@@ -214,7 +212,7 @@ void BazaarPlugin::createMenu() ...@@ -214,7 +212,7 @@ void BazaarPlugin::createMenu()
Core::Context context(Core::Constants::C_GLOBAL); Core::Context context(Core::Constants::C_GLOBAL);
// Create menu item for Bazaar // Create menu item for Bazaar
m_bazaarContainer = m_actionManager->createMenu(Core::Id("Bazaar.BazaarMenu")); m_bazaarContainer = Core::ActionManager::createMenu(Core::Id("Bazaar.BazaarMenu"));
QMenu *menu = m_bazaarContainer->menu(); QMenu *menu = m_bazaarContainer->menu();
menu->setTitle(tr("Bazaar")); menu->setTitle(tr("Bazaar"));
...@@ -226,7 +224,7 @@ void BazaarPlugin::createMenu() ...@@ -226,7 +224,7 @@ void BazaarPlugin::createMenu()
createSeparator(context, Core::Id("Bazaar.Repository Management")); createSeparator(context, Core::Id("Bazaar.Repository Management"));
// Request the Tools menu and add the Bazaar menu to it // Request the Tools menu and add the Bazaar menu to it
Core::ActionContainer *toolsMenu = m_actionManager->actionContainer(Core::Id(Core::Constants::M_TOOLS)); Core::ActionContainer *toolsMenu = Core::ActionManager::actionContainer(Core::Id(Core::Constants::M_TOOLS));
toolsMenu->addMenu(m_bazaarContainer); toolsMenu->addMenu(m_bazaarContainer);
m_menuAction = m_bazaarContainer->menu()->menuAction(); m_menuAction = m_bazaarContainer->menu()->menuAction();
} }
...@@ -236,14 +234,14 @@ void BazaarPlugin::createFileActions(const Core::Context &context) ...@@ -236,14 +234,14 @@ void BazaarPlugin::createFileActions(const Core::Context &context)
Core::Command *command; Core::Command *command;
m_annotateFile = new Utils::ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_annotateFile = new Utils::ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = m_actionManager->registerAction(m_annotateFile, Core::Id(Constants::ANNOTATE), context); command = Core::ActionManager::registerAction(m_annotateFile, Core::Id(Constants::ANNOTATE), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_annotateFile, SIGNAL(triggered()), this, SLOT(annotateCurrentFile())); connect(m_annotateFile, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_diffFile = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_diffFile = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = m_actionManager->registerAction(m_diffFile, Core::Id(Constants::DIFF), context); command = Core::ActionManager::registerAction(m_diffFile, Core::Id(Constants::DIFF), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+D") : tr("ALT+Z,Alt+D"))); command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+D") : tr("ALT+Z,Alt+D")));
connect(m_diffFile, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffFile, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
...@@ -251,7 +249,7 @@ void BazaarPlugin::createFileActions(const Core::Context &context) ...@@ -251,7 +249,7 @@ void BazaarPlugin::createFileActions(const Core::Context &context)
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_logFile = new Utils::ParameterAction(tr("Log Current File"), tr("Log \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_logFile = new Utils::ParameterAction(tr("Log Current File"), tr("Log \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = m_actionManager->registerAction(m_logFile, Core::Id(Constants::LOG), context); command = Core::ActionManager::registerAction(m_logFile, Core::Id(Constants::LOG), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+L") : tr("ALT+Z,Alt+L"))); command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+L") : tr("ALT+Z,Alt+L")));
connect(m_logFile, SIGNAL(triggered()), this, SLOT(logCurrentFile())); connect(m_logFile, SIGNAL(triggered()), this, SLOT(logCurrentFile()));
...@@ -259,7 +257,7 @@ void BazaarPlugin::createFileActions(const Core::Context &context) ...@@ -259,7 +257,7 @@ void BazaarPlugin::createFileActions(const Core::Context &context)
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_statusFile = new Utils::ParameterAction(tr("Status Current File"), tr("Status \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_statusFile = new Utils::ParameterAction(tr("Status Current File"), tr("Status \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = m_actionManager->registerAction(m_statusFile, Core::Id(Constants::STATUS), context); command = Core::ActionManager::registerAction(m_statusFile, Core::Id(Constants::STATUS), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+S") : tr("ALT+Z,Alt+S"))); command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+S") : tr("ALT+Z,Alt+S")));
connect(m_statusFile, SIGNAL(triggered()), this, SLOT(statusCurrentFile())); connect(m_statusFile, SIGNAL(triggered()), this, SLOT(statusCurrentFile()));
...@@ -269,21 +267,21 @@ void BazaarPlugin::createFileActions(const Core::Context &context) ...@@ -269,21 +267,21 @@ void BazaarPlugin::createFileActions(const Core::Context &context)
createSeparator(context, Core::Id("Bazaar.FileDirSeperator1")); createSeparator(context, Core::Id("Bazaar.FileDirSeperator1"));
m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this); m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
command = m_actionManager->registerAction(m_addAction, Core::Id(Constants::ADD), context); command = Core::ActionManager::registerAction(m_addAction, Core::Id(Constants::ADD), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_deleteAction = new Utils::ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this); m_deleteAction = new Utils::ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this);
command = m_actionManager->registerAction(m_deleteAction, Core::Id(Constants::DELETE), context); command = Core::ActionManager::registerAction(m_deleteAction, Core::Id(Constants::DELETE), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile())); connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
m_revertFile = new Utils::ParameterAction(tr("Revert Current File..."), tr("Revert \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this); m_revertFile = new Utils::ParameterAction(tr("Revert Current File..."), tr("Revert \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this);
command = m_actionManager->registerAction(m_revertFile, Core::Id(Constants::REVERT), context); command = Core::ActionManager::registerAction(m_revertFile, Core::Id(Constants::REVERT), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_revertFile, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); connect(m_revertFile, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
...@@ -348,28 +346,28 @@ void BazaarPlugin::createDirectoryActions(const Core::Context &context) ...@@ -348,28 +346,28 @@ void BazaarPlugin::createDirectoryActions(const Core::Context &context)
action = new QAction(tr("Diff"), this); action = new QAction(tr("Diff"), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::DIFFMULTI), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::DIFFMULTI), context);
connect(action, SIGNAL(triggered()), this, SLOT(diffRepository())); connect(action, SIGNAL(triggered()), this, SLOT(diffRepository()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
action = new QAction(tr("Log"), this); action = new QAction(tr("Log"), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::LOGMULTI), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::LOGMULTI), context);
connect(action, SIGNAL(triggered()), this, SLOT(logRepository())); connect(action, SIGNAL(triggered()), this, SLOT(logRepository()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
action = new QAction(tr("Revert..."), this); action = new QAction(tr("Revert..."), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::REVERTMULTI), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::REVERTMULTI), context);
connect(action, SIGNAL(triggered()), this, SLOT(revertAll())); connect(action, SIGNAL(triggered()), this, SLOT(revertAll()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
action = new QAction(tr("Status"), this); action = new QAction(tr("Status"), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::STATUSMULTI), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::STATUSMULTI), context);
connect(action, SIGNAL(triggered()), this, SLOT(statusMulti())); connect(action, SIGNAL(triggered()), this, SLOT(statusMulti()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
...@@ -419,35 +417,35 @@ void BazaarPlugin::createRepositoryActions(const Core::Context &context) ...@@ -419,35 +417,35 @@ void BazaarPlugin::createRepositoryActions(const Core::Context &context)
action = new QAction(tr("Pull..."), this); action = new QAction(tr("Pull..."), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::PULL), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::PULL), context);
connect(action, SIGNAL(triggered()), this, SLOT(pull())); connect(action, SIGNAL(triggered()), this, SLOT(pull()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
action = new QAction(tr("Push..."), this); action = new QAction(tr("Push..."), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::PUSH), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::PUSH), context);
connect(action, SIGNAL(triggered()), this, SLOT(push())); connect(action, SIGNAL(triggered()), this, SLOT(push()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
action = new QAction(tr("Update..."), this); action = new QAction(tr("Update..."), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::UPDATE), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::UPDATE), context);
connect(action, SIGNAL(triggered()), this, SLOT(update())); connect(action, SIGNAL(triggered()), this, SLOT(update()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
action = new QAction(tr("Commit..."), this); action = new QAction(tr("Commit..."), this);
m_repositoryActionList.append(action); m_repositoryActionList.append(action);
command = m_actionManager->registerAction(action, Core::Id(Constants::COMMIT), context); command = Core::ActionManager::registerAction(action, Core::Id(Constants::COMMIT), context);
command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+C") : tr("ALT+Z,Alt+C"))); command->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Z,Meta+C") : tr("ALT+Z,Alt+C")));
connect(action, SIGNAL(triggered()), this, SLOT(commit())); connect(action, SIGNAL(triggered()), this, SLOT(commit()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
m_commandLocator->appendCommand(command); m_commandLocator->appendCommand(command);
QAction *createRepositoryAction = new QAction(tr("Create Repository..."), this); QAction *createRepositoryAction = new QAction(tr("Create Repository..."), this);
command = m_actionManager->registerAction(createRepositoryAction, Core::Id(Constants::CREATE_REPOSITORY), context); command = Core::ActionManager::registerAction(createRepositoryAction, Core::Id(Constants::CREATE_REPOSITORY), context);
connect(createRepositoryAction, SIGNAL(triggered()), this, SLOT(createRepository())); connect(createRepositoryAction, SIGNAL(triggered()), this, SLOT(createRepository()));
m_bazaarContainer->addAction(command); m_bazaarContainer->addAction(command);
} }
...@@ -514,18 +512,18 @@ void BazaarPlugin::createSubmitEditorActions() ...@@ -514,18 +512,18 @@ void BazaarPlugin::createSubmitEditorActions()
Core::Command *command; Core::Command *command;
m_editorCommit = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this); m_editorCommit = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = m_actionManager->registerAction(m_editorCommit, Core::Id(Constants::COMMIT), context); command = Core::ActionManager::registerAction(m_editorCommit, Core::Id(Constants::COMMIT), context);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_editorCommit, SIGNAL(triggered()), this, SLOT(commitFromEditor())); connect(m_editorCommit, SIGNAL(triggered()), this, SLOT(commitFromEditor()));
m_editorDiff = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); m_editorDiff = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
command = m_actionManager->registerAction(m_editorDiff, Core::Id(Constants::DIFFEDITOR), context); command = Core::ActionManager::registerAction(m_editorDiff, Core::Id(Constants::DIFFEDITOR), context);
m_editorUndo = new QAction(tr("&Undo"), this); m_editorUndo = new QAction(tr("&Undo"), this);
command = m_actionManager->registerAction(m_editorUndo, Core::Id(Core::Constants::UNDO), context); command = Core::ActionManager::registerAction(m_editorUndo, Core::Id(Core::Constants::UNDO), context);
m_editorRedo = new QAction(tr("&Redo"), this); m_editorRedo = new QAction(tr("&Redo"), this);
command = m_actionManager->registerAction(m_editorRedo, Core::Id(Core::Constants::REDO), context); command = Core::ActionManager::registerAction(m_editorRedo, Core::Id(Core::Constants::REDO), context);
} }
void BazaarPlugin::commit() void BazaarPlugin::commit()
...@@ -682,7 +680,7 @@ void BazaarPlugin::createSeparator(const Core::Context &context, const Core::Id ...@@ -682,7 +680,7 @@ void BazaarPlugin::createSeparator(const Core::Context &context, const Core::Id
{ {
QAction *action = new QAction(this); QAction *action = new QAction(this);
action->setSeparator(true); action->setSeparator(true);
m_bazaarContainer->addAction(m_actionManager->registerAction(action, id, context)); m_bazaarContainer->addAction(Core::ActionManager::registerAction(action, id, context));
} }
void BazaarPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) void BazaarPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
......
...@@ -139,7 +139,6 @@ private: ...@@ -139,7 +139,6 @@ private:
BazaarClient *m_client; BazaarClient *m_client;
Locator::CommandLocator *m_commandLocator; Locator::CommandLocator *m_commandLocator;
Core::ActionManager *m_actionManager;
Core::ActionContainer *m_bazaarContainer; Core::ActionContainer *m_bazaarContainer;
QList<QAction *> m_repositoryActionList; QList<QAction *> m_repositoryActionList;
......