27 #include <KontactInterface/Core>
30 #include <KActionCollection>
31 #include <KCmdLineArgs>
38 : KontactInterface::Plugin( core, core, "kjots" ), m_interface( 0 )
40 setComponentData( KontactPluginFactory::componentData() );
43 new KAction( KIcon( QLatin1String(
"document-new") ),
44 i18nc(
"@action:inmenu",
"New KJots Page" ),
this );
45 actionCollection()->addAction( QLatin1String(
"new_kjots_page"), action );
46 action->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_P ) );
48 i18nc(
"@info:status",
"Create a new jots page" ) );
50 i18nc(
"@info:whatsthis",
51 "You will be presented with a dialog where you can create a new jots page." ) );
52 connect( action, SIGNAL(triggered(
bool)), SLOT(newPage()) );
53 insertNewAction( action );
55 action =
new KAction( KIcon( QLatin1String(
"address-book-new") ),
56 i18nc(
"@action:inmenu",
"New KJots Book" ),
this );
57 actionCollection()->addAction( QLatin1String(
"new_kjots_book"), action );
58 action->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_B ) );
60 i18nc(
"@info:status",
"Create a new jots book" ) );
62 i18nc(
"@info:whatsthis",
63 "You will be presented with a dialog where you can create a new jots book." ) );
64 connect( action, SIGNAL(triggered(
bool)), SLOT(newBook()) );
65 insertNewAction( action );
67 mUniqueAppWatcher =
new KontactInterface::UniqueAppWatcher(
68 new KontactInterface::UniqueAppHandlerFactory<KJotsUniqueAppHandler>(),
this );
84 return QStringList() << QLatin1String(
"new_page") << QLatin1String(
"new_book") ;
89 KParts::ReadOnlyPart *part = loadPart();
95 QLatin1String(
"org.kde.kjots"), QLatin1String(
"/KJotsWidget"), QDBusConnection::sessionBus() );
109 void KJotsPlugin::newPage()
111 core()->selectPlugin(
this );
115 void KJotsPlugin::newBook()
117 core()->selectPlugin(
this );
132 KCmdLineArgs::addCmdLineOptions( KCmdLineOptions() );
138 (void)plugin()->part();
140 org::kde::KJotsWidget kjots(
141 "org.kde.kjots",
"/KJotsWidget", QDBusConnection::sessionBus() );
143 return KontactInterface::UniqueAppHandler::newInstance();
148 #include "kjots_plugin.moc"
OrgKdeKJotsWidgetInterface * interface()
virtual int newInstance()
QStringList invisibleToolbarActions() const
KontactInterface::UniqueAppWatcher * mUniqueAppWatcher
virtual void loadCommandLineOptions()
KParts::ReadOnlyPart * createPart()
OrgKdeKJotsWidgetInterface * m_interface
bool isRunningStandalone() const
virtual bool queryClose() const