25 #include "knode_plugin.h"
29 #include <tdeapplication.h>
30 #include <tdeparts/componentfactory.h>
31 #include <kgenericfactory.h>
32 #include <tdeapplication.h>
33 #include <tdeaction.h>
34 #include <kiconloader.h>
37 #include <dcopclient.h>
42 typedef KGenericFactory<KNodePlugin, Kontact::Core> KNodePluginFactory;
43 K_EXPORT_COMPONENT_FACTORY( libkontact_knodeplugin,
44 KNodePluginFactory(
"kontact_knodeplugin" ) )
47 KNodePlugin::KNodePlugin( Kontact::Core *core, const
char *, const TQStringList& )
48 : Kontact::Plugin( core, core, "knode" ), mStub(0)
50 setInstance( KNodePluginFactory::instance() );
52 insertNewAction(
new TDEAction( i18n(
"New Article..." ),
"mail-message-new", CTRL+SHIFT+Key_A,
53 this, TQ_SLOT( slotPostArticle() ), actionCollection(),
"post_article" ) );
59 KNodePlugin::~KNodePlugin()
63 bool KNodePlugin::createDCOPInterface(
const TQString& )
68 bool KNodePlugin::isRunningStandalone()
70 return mUniqueAppWatcher->isRunningStandalone();
73 TQStringList KNodePlugin::invisibleToolbarActions()
const
75 return TQStringList(
"article_postNew" );
78 void KNodePlugin::slotPostArticle()
86 KParts::ReadOnlyPart* KNodePlugin::createPart()
88 KParts::ReadOnlyPart *part = loadPart();
89 if ( !part )
return 0;
91 mStub =
new KNodeIface_stub( dcopClient(),
"knode",
"KNodeIface" );
97 #include "../../../knode/knode_options.h"
98 void KNodeUniqueAppHandler::loadCommandLineOptions()
100 TDECmdLineArgs::addCmdLineOptions( knode_options );
103 int KNodeUniqueAppHandler::newInstance()
106 (void)plugin()->part();
107 DCOPRef knode(
"knode",
"KNodeIface" );
108 DCOPReply reply = knode.call(
"handleCommandLine" );
110 if ( reply.isValid() ) {
111 bool handled = reply;
112 kdDebug(5602) << k_funcinfo <<
"handled=" << handled << endl;
123 #include "knode_plugin.moc"
Used by UniqueAppWatcher below, to create the above UniqueAppHandler object when necessary.
virtual int newInstance()
We can't use k_dcop and dcopidl here, because the data passed to newInstance can't be expressed in te...
If the standalone application is running by itself, we need to watch for when the user closes it,...