From 023d863f934b130b1691afb95b6cf6a33cda1609 Mon Sep 17 00:00:00 2001 From: con Date: Thu, 15 Jul 2010 20:28:53 +0200 Subject: Adapt examples. --- .../examples/donothing/donothingplugin.cpp | 4 +- .../examples/donothing/donothingplugin.h | 2 +- .../examples/donothing/donothingplugin.pro | 14 ++--- .../examples/menu/addingmenu/donothingplugin.cpp | 33 ++++++----- .../examples/menu/addingmenu/donothingplugin.h | 6 +- .../examples/menu/addingmenu/donothingplugin.pro | 15 ++--- .../examples/menu/placingmenu/donothingplugin.cpp | 40 +++++--------- .../examples/menu/placingmenu/donothingplugin.h | 5 +- .../examples/menu/placingmenu/donothingplugin.pro | 15 ++--- .../menu/registeringmenuitem/donothingplugin.cpp | 26 ++++++--- .../menu/registeringmenuitem/donothingplugin.h | 2 +- .../menu/registeringmenuitem/donothingplugin.pro | 15 ++--- .../respondingtomenuitems/DoNothing.pluginspec | 10 ++++ .../menu/respondingtomenuitems/donothingplugin.cpp | 64 ++++++++++++++++++++++ .../menu/respondingtomenuitems/donothingplugin.h | 22 ++++++++ .../menu/respondingtomenuitems/donothingplugin.pro | 21 +++++++ .../menu/respondtomenuitem/DoNothing.pluginspec | 11 ---- .../menu/respondtomenuitem/donothingplugin.cpp | 57 ------------------- .../menu/respondtomenuitem/donothingplugin.h | 22 -------- .../menu/respondtomenuitem/donothingplugin.pro | 20 ------- 20 files changed, 208 insertions(+), 196 deletions(-) create mode 100644 doc/pluginhowto/examples/menu/respondingtomenuitems/DoNothing.pluginspec create mode 100644 doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.cpp create mode 100644 doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.h create mode 100644 doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.pro delete mode 100644 doc/pluginhowto/examples/menu/respondtomenuitem/DoNothing.pluginspec delete mode 100644 doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.cpp delete mode 100644 doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.h delete mode 100644 doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.pro (limited to 'doc/pluginhowto') diff --git a/doc/pluginhowto/examples/donothing/donothingplugin.cpp b/doc/pluginhowto/examples/donothing/donothingplugin.cpp index 1b651d0fa9..d13ec20e17 100644 --- a/doc/pluginhowto/examples/donothing/donothingplugin.cpp +++ b/doc/pluginhowto/examples/donothing/donothingplugin.cpp @@ -27,9 +27,9 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg) return true; } -void DoNothingPlugin::shutdown() +ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown() { - // Do nothing + return SynchronousShutdown; } Q_EXPORT_PLUGIN(DoNothingPlugin) diff --git a/doc/pluginhowto/examples/donothing/donothingplugin.h b/doc/pluginhowto/examples/donothing/donothingplugin.h index 25356a7443..5cb641d7f3 100644 --- a/doc/pluginhowto/examples/donothing/donothingplugin.h +++ b/doc/pluginhowto/examples/donothing/donothingplugin.h @@ -12,7 +12,7 @@ public: ~DoNothingPlugin(); void extensionsInitialized(); bool initialize(const QStringList & arguments, QString * errorString); - void shutdown(); + ShutdownFlag shutdown(); }; #endif // DONOTHING_PLUGIN_H diff --git a/doc/pluginhowto/examples/donothing/donothingplugin.pro b/doc/pluginhowto/examples/donothing/donothingplugin.pro index 5a017f626f..954f62d199 100644 --- a/doc/pluginhowto/examples/donothing/donothingplugin.pro +++ b/doc/pluginhowto/examples/donothing/donothingplugin.pro @@ -1,16 +1,16 @@ -QTC_SOURCE = C:/Work/QtCreator -QTC_BUILD = C:/Work/QtCreator/build - TEMPLATE = lib TARGET = DoNothing -IDE_SOURCE_TREE = $$QTC_SOURCE -IDE_BUILD_TREE = $$QTC_BUILD +isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../ +else:IDE_SOURCE_TREE=$$(QTC_SOURCE) + +isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../ +else:IDE_BUILD_TREE=$$(QTC_BUILD) PROVIDER = FooCompanyInc -include($$QTC_SOURCE/src/qtcreatorplugin.pri) -include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri) +include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri) +include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri) LIBS += -L$$IDE_PLUGIN_PATH/Nokia diff --git a/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.cpp b/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.cpp index 7fd1ff5cf6..e75da68ab7 100644 --- a/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.cpp +++ b/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.cpp @@ -2,12 +2,16 @@ #include #include #include +#include #include -#include +#include -#include +#include #include #include +#include +#include +#include DoNothingPlugin::DoNothingPlugin() { @@ -36,29 +40,32 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg) Core::ActionContainer* ac = am->createMenu("DoNothingPlugin.DoNothingMenu"); ac->menu()->setTitle("DoNothing"); - // Create a command for "About DoNothing". - QAction *action = new QAction(tr("About DoNothing"),this); - Core::Command* cmd = am->registerAction(action,"DoNothingPlugin.AboutDoNothing",QList() << 0); + // Create a command for "DoNothing". + QAction *action = new QAction(tr("DoNothing"),this); + Core::Command* cmd = am->registerAction(action, + QLatin1String("DoNothingPlugin.DoNothing"), + Core::Context(Core::Constants::C_GLOBAL)); // Add DoNothing menu to the menubar - am->actionContainer(Core::Constants::MENU_BAR)->addMenu(ac); + am->actionContainer(Core::Constants::M_TOOLS)->addMenu(ac, Core::Constants::G_DEFAULT_THREE); - // Add the "About DoNothing" action to the DoNothing menu + // Add the "DoNothing" action to the DoNothing menu ac->addAction(cmd); // Connect the action - connect(action, SIGNAL(triggered(bool)), this, SLOT(about())); + connect(action, SIGNAL(triggered(bool)), this, SLOT(performAction())); return true; } -void DoNothingPlugin::shutdown() +ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown() { - // Do nothing + return SynchronousShutdown; } -void DoNothingPlugin::about() + +void DoNothingPlugin::performAction() { - QMessageBox::information(0, "About DoNothing Plugin", - "Seriously dude, this plugin does nothing"); + QMessageBox::information(0, tr("DoNothing Plugin"), + tr("Seriously dude, this plugin does nothing")); } Q_EXPORT_PLUGIN(DoNothingPlugin) diff --git a/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.h b/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.h index 2cda18bae1..d699f10ddc 100644 --- a/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.h +++ b/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.h @@ -12,10 +12,10 @@ public: ~DoNothingPlugin(); void extensionsInitialized(); bool initialize(const QStringList & arguments, QString * errorString); - void shutdown(); -private slots: - void about(); + ShutdownFlag shutdown(); +private slots: + void performAction(); }; #endif // DONOTHING_PLUGIN_H diff --git a/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.pro b/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.pro index ac69a5398e..e290291cd2 100644 --- a/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.pro +++ b/doc/pluginhowto/examples/menu/addingmenu/donothingplugin.pro @@ -1,15 +1,16 @@ -QTC_SOURCE = C:/Work/QtCreator -QTC_BUILD = C:/Work/QtCreator/build - TEMPLATE = lib TARGET = DoNothing -IDE_SOURCE_TREE = $$QTC_SOURCE -IDE_BUILD_TREE = $$QTC_BUILD +isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../../ +else:IDE_SOURCE_TREE=$$(QTC_SOURCE) + +isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../../ +else:IDE_BUILD_TREE=$$(QTC_BUILD) + PROVIDER = FooCompanyInc -include($$QTC_SOURCE/src/qtcreatorplugin.pri) -include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri) +include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri) +include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri) LIBS += -L$$IDE_PLUGIN_PATH/Nokia diff --git a/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.cpp b/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.cpp index 63cda06978..5abbb51faa 100644 --- a/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.cpp +++ b/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.cpp @@ -2,12 +2,16 @@ #include #include #include +#include #include -#include +#include -#include +#include #include #include +#include +#include +#include DoNothingPlugin::DoNothingPlugin() { @@ -32,35 +36,21 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg) // Fetch the action manager Core::ActionManager* am = Core::ICore::instance()->actionManager(); - // Create a DoNothing menu - Core::ActionContainer* ac = am->createMenu("DoNothingPlugin.DoNothingMenu"); - ac->menu()->setTitle("DoNothing"); - - // Create a command for "About DoNothing". - QAction *action = new QAction(tr("About DoNothing"),this); - Core::Command* cmd = am->registerAction(action,"DoNothingPlugin.AboutDoNothing",QList() << 0); + // Create a command for "DoNothing". + QAction *action = new QAction(tr("DoNothing"),this); + Core::Command* cmd = am->registerAction(action, + QLatin1String("DoNothingPlugin.DoNothing"), + Core::Context(Core::Constants::C_GLOBAL)); - // Insert the "DoNothing" menu between "Window" and "Help". - QMenu* windowMenu = am->actionContainer(Core::Constants::M_HELP)->menu(); - QMenuBar* menuBar = am->actionContainer(Core::Constants::MENU_BAR)->menuBar(); - menuBar->insertMenu(windowMenu->menuAction(), ac->menu()); + // Add the "DoNothing" action to the tools menu + am->actionContainer(Core::Constants::M_TOOLS)->addAction(cmd, Core::Constants::G_DEFAULT_THREE); - // Add the "About DoNothing" action to the DoNothing menu - ac->addAction(cmd); - - // Connect the action - connect(action, SIGNAL(triggered(bool)), this, SLOT(about())); return true; } -void DoNothingPlugin::shutdown() -{ - // Do nothing -} -void DoNothingPlugin::about() +ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown() { - QMessageBox::information(0, "About DoNothing Plugin", - "Seriously dude, this plugin does nothing"); + return SynchronousShutdown; } Q_EXPORT_PLUGIN(DoNothingPlugin) diff --git a/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.h b/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.h index 2cda18bae1..5cb641d7f3 100644 --- a/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.h +++ b/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.h @@ -12,10 +12,7 @@ public: ~DoNothingPlugin(); void extensionsInitialized(); bool initialize(const QStringList & arguments, QString * errorString); - void shutdown(); -private slots: - void about(); - + ShutdownFlag shutdown(); }; #endif // DONOTHING_PLUGIN_H diff --git a/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.pro b/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.pro index ac69a5398e..e290291cd2 100644 --- a/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.pro +++ b/doc/pluginhowto/examples/menu/placingmenu/donothingplugin.pro @@ -1,15 +1,16 @@ -QTC_SOURCE = C:/Work/QtCreator -QTC_BUILD = C:/Work/QtCreator/build - TEMPLATE = lib TARGET = DoNothing -IDE_SOURCE_TREE = $$QTC_SOURCE -IDE_BUILD_TREE = $$QTC_BUILD +isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../../ +else:IDE_SOURCE_TREE=$$(QTC_SOURCE) + +isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../../ +else:IDE_BUILD_TREE=$$(QTC_BUILD) + PROVIDER = FooCompanyInc -include($$QTC_SOURCE/src/qtcreatorplugin.pri) -include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri) +include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri) +include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri) LIBS += -L$$IDE_PLUGIN_PATH/Nokia diff --git a/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.cpp b/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.cpp index a2e6bd507c..ff03fc3c93 100644 --- a/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.cpp +++ b/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.cpp @@ -2,11 +2,16 @@ #include #include #include +#include #include -#include +#include -#include +#include #include +#include +#include +#include +#include DoNothingPlugin::DoNothingPlugin() { @@ -31,18 +36,21 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg) // Fetch the action manager Core::ActionManager* am = Core::ICore::instance()->actionManager(); - // Create a command for "About DoNothing". - Core::Command* cmd = am->registerAction(new QAction(tr("About DoNothing"),this),"DoNothingPlugin.AboutDoNothing", - QList() <registerAction(action, + QLatin1String("DoNothingPlugin.DoNothing"), + Core::Context(Core::Constants::C_GLOBAL)); + + // Add the "DoNothing" action to the tools menu + am->actionContainer(Core::Constants::M_TOOLS)->addAction(cmd); - // Add the command to Help menu - am->actionContainer(Core::Constants::M_HELP)->addAction(cmd); return true; } -void DoNothingPlugin::shutdown() +ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown() { - // Do nothing + return SynchronousShutdown; } Q_EXPORT_PLUGIN(DoNothingPlugin) diff --git a/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.h b/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.h index 25356a7443..5cb641d7f3 100644 --- a/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.h +++ b/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.h @@ -12,7 +12,7 @@ public: ~DoNothingPlugin(); void extensionsInitialized(); bool initialize(const QStringList & arguments, QString * errorString); - void shutdown(); + ShutdownFlag shutdown(); }; #endif // DONOTHING_PLUGIN_H diff --git a/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.pro b/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.pro index ac69a5398e..e290291cd2 100644 --- a/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.pro +++ b/doc/pluginhowto/examples/menu/registeringmenuitem/donothingplugin.pro @@ -1,15 +1,16 @@ -QTC_SOURCE = C:/Work/QtCreator -QTC_BUILD = C:/Work/QtCreator/build - TEMPLATE = lib TARGET = DoNothing -IDE_SOURCE_TREE = $$QTC_SOURCE -IDE_BUILD_TREE = $$QTC_BUILD +isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../../ +else:IDE_SOURCE_TREE=$$(QTC_SOURCE) + +isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../../ +else:IDE_BUILD_TREE=$$(QTC_BUILD) + PROVIDER = FooCompanyInc -include($$QTC_SOURCE/src/qtcreatorplugin.pri) -include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri) +include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri) +include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri) LIBS += -L$$IDE_PLUGIN_PATH/Nokia diff --git a/doc/pluginhowto/examples/menu/respondingtomenuitems/DoNothing.pluginspec b/doc/pluginhowto/examples/menu/respondingtomenuitems/DoNothing.pluginspec new file mode 100644 index 0000000000..35e922e5af --- /dev/null +++ b/doc/pluginhowto/examples/menu/respondingtomenuitems/DoNothing.pluginspec @@ -0,0 +1,10 @@ + + FooCompanyInc + FooCompanyInc + + DO NOTHING + http://www.FooCompanyInc.com + + + + diff --git a/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.cpp b/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.cpp new file mode 100644 index 0000000000..cd9f918a1f --- /dev/null +++ b/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.cpp @@ -0,0 +1,64 @@ +#include "donothingplugin.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +DoNothingPlugin::DoNothingPlugin() +{ + // Do nothing +} + +DoNothingPlugin::~DoNothingPlugin() +{ + // Do notning +} + +void DoNothingPlugin::extensionsInitialized() +{ + // Do nothing +} + +bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg) +{ + Q_UNUSED(args); + Q_UNUSED(errMsg); + + // Fetch the action manager + Core::ActionManager* am = Core::ICore::instance()->actionManager(); + + // Create a command for "DoNothing". + QAction *action = new QAction(tr("DoNothing"),this); + Core::Command* cmd = am->registerAction(action, + QLatin1String("DoNothingPlugin.DoNothing"), + Core::Context(Core::Constants::C_GLOBAL)); + + // Add the "DoNothing" action to the tools menu + am->actionContainer(Core::Constants::M_TOOLS)->addAction(cmd, Core::Constants::G_DEFAULT_THREE); + + // Connect the action + connect(action, SIGNAL(triggered(bool)), this, SLOT(performAction())); + return true; +} + +ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown() +{ + return SynchronousShutdown; +} + +void DoNothingPlugin::performAction() +{ + QMessageBox::information(0, tr("DoNothing Plugin"), + tr("Seriously dude, this plugin does nothing")); +} + +Q_EXPORT_PLUGIN(DoNothingPlugin) diff --git a/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.h b/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.h new file mode 100644 index 0000000000..d699f10ddc --- /dev/null +++ b/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.h @@ -0,0 +1,22 @@ +#ifndef DONOTHING_PLUGIN_H +#define DONOTHING_PLUGIN_H + +#include + +class DoNothingPlugin : public ExtensionSystem::IPlugin +{ + Q_OBJECT + +public: + DoNothingPlugin(); + ~DoNothingPlugin(); + void extensionsInitialized(); + bool initialize(const QStringList & arguments, QString * errorString); + ShutdownFlag shutdown(); + +private slots: + void performAction(); +}; + +#endif // DONOTHING_PLUGIN_H + diff --git a/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.pro b/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.pro new file mode 100644 index 0000000000..e290291cd2 --- /dev/null +++ b/doc/pluginhowto/examples/menu/respondingtomenuitems/donothingplugin.pro @@ -0,0 +1,21 @@ +TEMPLATE = lib +TARGET = DoNothing + +isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../../ +else:IDE_SOURCE_TREE=$$(QTC_SOURCE) + +isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../../ +else:IDE_BUILD_TREE=$$(QTC_BUILD) + +PROVIDER = FooCompanyInc + +include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri) +include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri) + +LIBS += -L$$IDE_PLUGIN_PATH/Nokia + +HEADERS = donothingplugin.h +SOURCES = donothingplugin.cpp +OTHER_FILES = DoNothing.pluginspec + + diff --git a/doc/pluginhowto/examples/menu/respondtomenuitem/DoNothing.pluginspec b/doc/pluginhowto/examples/menu/respondtomenuitem/DoNothing.pluginspec deleted file mode 100644 index 59cf450b9f..0000000000 --- a/doc/pluginhowto/examples/menu/respondtomenuitem/DoNothing.pluginspec +++ /dev/null @@ -1,11 +0,0 @@ - - FooCompanyInc - FooCompanyInc - - GPL - DO NOTHING - http://www.FooCompanyInc.com - - - - diff --git a/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.cpp b/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.cpp deleted file mode 100644 index a093bae294..0000000000 --- a/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "donothingplugin.h" -#include -#include -#include -#include -#include - -#include -#include -#include - -DoNothingPlugin::DoNothingPlugin() -{ - // Do nothing -} - -DoNothingPlugin::~DoNothingPlugin() -{ - // Do notning -} - -void DoNothingPlugin::extensionsInitialized() -{ - // Do nothing -} - -bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg) -{ - Q_UNUSED(args); - Q_UNUSED(errMsg); - - // Fetch the action manager - Core::ActionManager* am = Core::ICore::instance()->actionManager(); - - // Create a command for "About DoNothing". - QAction *action = new QAction(tr("About DoNothing"),this); - Core::Command* cmd = am->registerAction(action,"DoNothingPlugin.AboutDoNothing",QList() << 0); - Core::ActionContainer* ac = am->createMenu("DoNothingPlugin.DoNothingMenu"); - - // Add the command to Help menu - am->actionContainer(Core::Constants::M_HELP)->addAction(cmd); - - connect(action, SIGNAL(triggered(bool)), this, SLOT(about())); - return true; -} - -void DoNothingPlugin::shutdown() -{ - // Do nothing -} -void DoNothingPlugin::about() -{ - QMessageBox::information(0, "About DoNothing Plugin", - "Seriously dude, this plugin does nothing"); -} - -Q_EXPORT_PLUGIN(DoNothingPlugin) diff --git a/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.h b/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.h deleted file mode 100644 index 2cda18bae1..0000000000 --- a/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef DONOTHING_PLUGIN_H -#define DONOTHING_PLUGIN_H - -#include - -class DoNothingPlugin : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - DoNothingPlugin(); - ~DoNothingPlugin(); - void extensionsInitialized(); - bool initialize(const QStringList & arguments, QString * errorString); - void shutdown(); -private slots: - void about(); - -}; - -#endif // DONOTHING_PLUGIN_H - diff --git a/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.pro b/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.pro deleted file mode 100644 index ac69a5398e..0000000000 --- a/doc/pluginhowto/examples/menu/respondtomenuitem/donothingplugin.pro +++ /dev/null @@ -1,20 +0,0 @@ -QTC_SOURCE = C:/Work/QtCreator -QTC_BUILD = C:/Work/QtCreator/build - -TEMPLATE = lib -TARGET = DoNothing - -IDE_SOURCE_TREE = $$QTC_SOURCE -IDE_BUILD_TREE = $$QTC_BUILD -PROVIDER = FooCompanyInc - -include($$QTC_SOURCE/src/qtcreatorplugin.pri) -include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri) - -LIBS += -L$$IDE_PLUGIN_PATH/Nokia - -HEADERS = donothingplugin.h -SOURCES = donothingplugin.cpp -OTHER_FILES = DoNothing.pluginspec - - -- cgit v1.2.1