forked from qt-creator/qt-creator
Adapt examples.
This commit is contained in:
@@ -27,9 +27,9 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoNothingPlugin::shutdown()
|
ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown()
|
||||||
{
|
{
|
||||||
// Do nothing
|
return SynchronousShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
~DoNothingPlugin();
|
~DoNothingPlugin();
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
bool initialize(const QStringList & arguments, QString * errorString);
|
bool initialize(const QStringList & arguments, QString * errorString);
|
||||||
void shutdown();
|
ShutdownFlag shutdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DONOTHING_PLUGIN_H
|
#endif // DONOTHING_PLUGIN_H
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
QTC_SOURCE = C:/Work/QtCreator
|
|
||||||
QTC_BUILD = C:/Work/QtCreator/build
|
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = DoNothing
|
TARGET = DoNothing
|
||||||
|
|
||||||
IDE_SOURCE_TREE = $$QTC_SOURCE
|
isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../
|
||||||
IDE_BUILD_TREE = $$QTC_BUILD
|
else:IDE_SOURCE_TREE=$$(QTC_SOURCE)
|
||||||
|
|
||||||
|
isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../
|
||||||
|
else:IDE_BUILD_TREE=$$(QTC_BUILD)
|
||||||
|
|
||||||
PROVIDER = FooCompanyInc
|
PROVIDER = FooCompanyInc
|
||||||
|
|
||||||
include($$QTC_SOURCE/src/qtcreatorplugin.pri)
|
include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri)
|
||||||
include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri)
|
include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri)
|
||||||
|
|
||||||
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,16 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <QKeySequence>
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
#include <QtPlugin>
|
#include <QKeySequence>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QtPlugin>
|
||||||
|
|
||||||
DoNothingPlugin::DoNothingPlugin()
|
DoNothingPlugin::DoNothingPlugin()
|
||||||
{
|
{
|
||||||
@@ -36,29 +40,32 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg)
|
|||||||
Core::ActionContainer* ac = am->createMenu("DoNothingPlugin.DoNothingMenu");
|
Core::ActionContainer* ac = am->createMenu("DoNothingPlugin.DoNothingMenu");
|
||||||
ac->menu()->setTitle("DoNothing");
|
ac->menu()->setTitle("DoNothing");
|
||||||
|
|
||||||
// Create a command for "About DoNothing".
|
// Create a command for "DoNothing".
|
||||||
QAction *action = new QAction(tr("About DoNothing"),this);
|
QAction *action = new QAction(tr("DoNothing"),this);
|
||||||
Core::Command* cmd = am->registerAction(action,"DoNothingPlugin.AboutDoNothing",QList<int>() << 0);
|
Core::Command* cmd = am->registerAction(action,
|
||||||
|
QLatin1String("DoNothingPlugin.DoNothing"),
|
||||||
|
Core::Context(Core::Constants::C_GLOBAL));
|
||||||
|
|
||||||
// Add DoNothing menu to the menubar
|
// 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);
|
ac->addAction(cmd);
|
||||||
|
|
||||||
// Connect the action
|
// Connect the action
|
||||||
connect(action, SIGNAL(triggered(bool)), this, SLOT(about()));
|
connect(action, SIGNAL(triggered(bool)), this, SLOT(performAction()));
|
||||||
return true;
|
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",
|
QMessageBox::information(0, tr("DoNothing Plugin"),
|
||||||
"Seriously dude, this plugin does nothing");
|
tr("Seriously dude, this plugin does nothing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ public:
|
|||||||
~DoNothingPlugin();
|
~DoNothingPlugin();
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
bool initialize(const QStringList & arguments, QString * errorString);
|
bool initialize(const QStringList & arguments, QString * errorString);
|
||||||
void shutdown();
|
ShutdownFlag shutdown();
|
||||||
private slots:
|
|
||||||
void about();
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void performAction();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DONOTHING_PLUGIN_H
|
#endif // DONOTHING_PLUGIN_H
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
QTC_SOURCE = C:/Work/QtCreator
|
|
||||||
QTC_BUILD = C:/Work/QtCreator/build
|
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = DoNothing
|
TARGET = DoNothing
|
||||||
|
|
||||||
IDE_SOURCE_TREE = $$QTC_SOURCE
|
isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../../
|
||||||
IDE_BUILD_TREE = $$QTC_BUILD
|
else:IDE_SOURCE_TREE=$$(QTC_SOURCE)
|
||||||
|
|
||||||
|
isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../../
|
||||||
|
else:IDE_BUILD_TREE=$$(QTC_BUILD)
|
||||||
|
|
||||||
PROVIDER = FooCompanyInc
|
PROVIDER = FooCompanyInc
|
||||||
|
|
||||||
include($$QTC_SOURCE/src/qtcreatorplugin.pri)
|
include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri)
|
||||||
include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri)
|
include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri)
|
||||||
|
|
||||||
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,16 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <QKeySequence>
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
#include <QtPlugin>
|
#include <QKeySequence>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QtPlugin>
|
||||||
|
|
||||||
DoNothingPlugin::DoNothingPlugin()
|
DoNothingPlugin::DoNothingPlugin()
|
||||||
{
|
{
|
||||||
@@ -32,35 +36,21 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg)
|
|||||||
// Fetch the action manager
|
// Fetch the action manager
|
||||||
Core::ActionManager* am = Core::ICore::instance()->actionManager();
|
Core::ActionManager* am = Core::ICore::instance()->actionManager();
|
||||||
|
|
||||||
// Create a DoNothing menu
|
// Create a command for "DoNothing".
|
||||||
Core::ActionContainer* ac = am->createMenu("DoNothingPlugin.DoNothingMenu");
|
QAction *action = new QAction(tr("DoNothing"),this);
|
||||||
ac->menu()->setTitle("DoNothing");
|
Core::Command* cmd = am->registerAction(action,
|
||||||
|
QLatin1String("DoNothingPlugin.DoNothing"),
|
||||||
|
Core::Context(Core::Constants::C_GLOBAL));
|
||||||
|
|
||||||
// Create a command for "About DoNothing".
|
// Add the "DoNothing" action to the tools menu
|
||||||
QAction *action = new QAction(tr("About DoNothing"),this);
|
am->actionContainer(Core::Constants::M_TOOLS)->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
|
||||||
Core::Command* cmd = am->registerAction(action,"DoNothingPlugin.AboutDoNothing",QList<int>() << 0);
|
|
||||||
|
|
||||||
// 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 "About DoNothing" action to the DoNothing menu
|
|
||||||
ac->addAction(cmd);
|
|
||||||
|
|
||||||
// Connect the action
|
|
||||||
connect(action, SIGNAL(triggered(bool)), this, SLOT(about()));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoNothingPlugin::shutdown()
|
ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown()
|
||||||
{
|
{
|
||||||
// Do nothing
|
return SynchronousShutdown;
|
||||||
}
|
|
||||||
void DoNothingPlugin::about()
|
|
||||||
{
|
|
||||||
QMessageBox::information(0, "About DoNothing Plugin",
|
|
||||||
"Seriously dude, this plugin does nothing");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ public:
|
|||||||
~DoNothingPlugin();
|
~DoNothingPlugin();
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
bool initialize(const QStringList & arguments, QString * errorString);
|
bool initialize(const QStringList & arguments, QString * errorString);
|
||||||
void shutdown();
|
ShutdownFlag shutdown();
|
||||||
private slots:
|
|
||||||
void about();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DONOTHING_PLUGIN_H
|
#endif // DONOTHING_PLUGIN_H
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
QTC_SOURCE = C:/Work/QtCreator
|
|
||||||
QTC_BUILD = C:/Work/QtCreator/build
|
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = DoNothing
|
TARGET = DoNothing
|
||||||
|
|
||||||
IDE_SOURCE_TREE = $$QTC_SOURCE
|
isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../../
|
||||||
IDE_BUILD_TREE = $$QTC_BUILD
|
else:IDE_SOURCE_TREE=$$(QTC_SOURCE)
|
||||||
|
|
||||||
|
isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../../
|
||||||
|
else:IDE_BUILD_TREE=$$(QTC_BUILD)
|
||||||
|
|
||||||
PROVIDER = FooCompanyInc
|
PROVIDER = FooCompanyInc
|
||||||
|
|
||||||
include($$QTC_SOURCE/src/qtcreatorplugin.pri)
|
include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri)
|
||||||
include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri)
|
include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri)
|
||||||
|
|
||||||
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,16 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <QKeySequence>
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
#include <QtPlugin>
|
#include <QKeySequence>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QtPlugin>
|
||||||
|
|
||||||
DoNothingPlugin::DoNothingPlugin()
|
DoNothingPlugin::DoNothingPlugin()
|
||||||
{
|
{
|
||||||
@@ -31,18 +36,21 @@ bool DoNothingPlugin::initialize(const QStringList& args, QString *errMsg)
|
|||||||
// Fetch the action manager
|
// Fetch the action manager
|
||||||
Core::ActionManager* am = Core::ICore::instance()->actionManager();
|
Core::ActionManager* am = Core::ICore::instance()->actionManager();
|
||||||
|
|
||||||
// Create a command for "About DoNothing".
|
// Create a command for "DoNothing".
|
||||||
Core::Command* cmd = am->registerAction(new QAction(tr("About DoNothing"),this),"DoNothingPlugin.AboutDoNothing",
|
QAction *action = new QAction(tr("DoNothing"),this);
|
||||||
QList<int>() <<Core::Constants::C_GLOBAL_ID);
|
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);
|
||||||
|
|
||||||
// Add the command to Help menu
|
|
||||||
am->actionContainer(Core::Constants::M_HELP)->addAction(cmd);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoNothingPlugin::shutdown()
|
ExtensionSystem::IPlugin::ShutdownFlag DoNothingPlugin::shutdown()
|
||||||
{
|
{
|
||||||
// Do nothing
|
return SynchronousShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
Q_EXPORT_PLUGIN(DoNothingPlugin)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
~DoNothingPlugin();
|
~DoNothingPlugin();
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
bool initialize(const QStringList & arguments, QString * errorString);
|
bool initialize(const QStringList & arguments, QString * errorString);
|
||||||
void shutdown();
|
ShutdownFlag shutdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DONOTHING_PLUGIN_H
|
#endif // DONOTHING_PLUGIN_H
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
QTC_SOURCE = C:/Work/QtCreator
|
|
||||||
QTC_BUILD = C:/Work/QtCreator/build
|
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = DoNothing
|
TARGET = DoNothing
|
||||||
|
|
||||||
IDE_SOURCE_TREE = $$QTC_SOURCE
|
isEmpty(QTC_SOURCE):IDE_SOURCE_TREE=$$PWD/../../../../../
|
||||||
IDE_BUILD_TREE = $$QTC_BUILD
|
else:IDE_SOURCE_TREE=$$(QTC_SOURCE)
|
||||||
|
|
||||||
|
isEmpty(QTC_BUILD):IDE_BUILD_TREE=$$OUT_PWD/../../../../../
|
||||||
|
else:IDE_BUILD_TREE=$$(QTC_BUILD)
|
||||||
|
|
||||||
PROVIDER = FooCompanyInc
|
PROVIDER = FooCompanyInc
|
||||||
|
|
||||||
include($$QTC_SOURCE/src/qtcreatorplugin.pri)
|
include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri)
|
||||||
include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri)
|
include($$IDE_SOURCE_TREE/src/plugins/coreplugin/coreplugin.pri)
|
||||||
|
|
||||||
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
LIBS += -L$$IDE_PLUGIN_PATH/Nokia
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<plugin name="DoNothing" version="0.0.1">
|
<plugin name="DoNothing" version="0.0.1">
|
||||||
<vendor>FooCompanyInc</vendor>
|
<vendor>FooCompanyInc</vendor>
|
||||||
<copyright>FooCompanyInc</copyright>
|
<copyright>FooCompanyInc</copyright>
|
||||||
<license>
|
<license></license>
|
||||||
GPL</license>
|
|
||||||
<description>DO NOTHING</description>
|
<description>DO NOTHING</description>
|
||||||
<url>http://www.FooCompanyInc.com</url>
|
<url>http://www.FooCompanyInc.com</url>
|
||||||
<dependencyList>
|
<dependencyList>
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
#include "donothingplugin.h"
|
||||||
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
#include <coreplugin/icontext.h>
|
||||||
|
|
||||||
|
#include <QKeySequence>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QtPlugin>
|
||||||
|
|
||||||
|
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)
|
||||||
@@ -12,10 +12,10 @@ public:
|
|||||||
~DoNothingPlugin();
|
~DoNothingPlugin();
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
bool initialize(const QStringList & arguments, QString * errorString);
|
bool initialize(const QStringList & arguments, QString * errorString);
|
||||||
void shutdown();
|
ShutdownFlag shutdown();
|
||||||
private slots:
|
|
||||||
void about();
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void performAction();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DONOTHING_PLUGIN_H
|
#endif // DONOTHING_PLUGIN_H
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
#include "donothingplugin.h"
|
|
||||||
#include <coreplugin/coreconstants.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/command.h>
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <QKeySequence>
|
|
||||||
|
|
||||||
#include <QtPlugin>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
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<int>() << 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)
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user