27 #include <dcopclient.h>
29 #include <tdeaboutdata.h>
30 #include <tdeaction.h>
31 #include <tdeapplication.h>
32 #include <tdecmdlineargs.h>
34 #include <kgenericfactory.h>
35 #include <kiconloader.h>
36 #include <tdemessagebox.h>
37 #include <tdeparts/componentfactory.h>
42 #include <akregator_options.h>
43 #include <akregator_part.h>
44 #include "akregator_plugin.h"
47 typedef KGenericFactory<Akregator::AkregatorPlugin, Kontact::Core > PluginFactory;
48 K_EXPORT_COMPONENT_FACTORY( libkontact_akregator,
49 PluginFactory(
"kontact_akregator" ) )
51 AkregatorPlugin::AkregatorPlugin( Kontact::Core *core, const
char *, const TQStringList& )
52 : Kontact::Plugin( core, core, "akregator" ), m_stub(0)
54 setInstance( PluginFactory::instance() );
56 insertNewAction(
new TDEAction( i18n(
"New Feed..." ),
"bookmark_add", CTRL+SHIFT+Key_F,
this, TQ_SLOT( addFeed() ), actionCollection(),
"feed_new" ) );
62 AkregatorPlugin::~AkregatorPlugin()
66 bool AkregatorPlugin::isRunningStandalone()
68 return m_uniqueAppWatcher->isRunningStandalone();
71 TQStringList AkregatorPlugin::invisibleToolbarActions()
const
73 return TQStringList(
"file_new_contact" );
77 Akregator::AkregatorPartIface_stub *AkregatorPlugin::interface()
88 MyBasePart* AkregatorPlugin::createPart()
90 MyBasePart* p = loadPart();
92 connect(p, TQ_SIGNAL(showPart()),
this, TQ_SLOT(showPart()));
93 m_stub =
new Akregator::AkregatorPartIface_stub( dcopClient(),
"akregator",
95 m_stub->openStandardFeedList();
100 void AkregatorPlugin::showPart()
102 core()->selectPlugin(
this);
105 void AkregatorPlugin::addFeed()
107 interface()->addFeed();
110 TQStringList AkregatorPlugin::configModules()
const
112 TQStringList modules;
113 modules <<
"PIM/akregator.desktop";
117 void AkregatorPlugin::readProperties( TDEConfig *config )
120 Akregator::Part *myPart =
static_cast<Akregator::Part*
>( part() );
121 myPart->readProperties( config );
125 void AkregatorPlugin::saveProperties( TDEConfig *config )
128 Akregator::Part *myPart =
static_cast<Akregator::Part*
>( part() );
129 myPart->saveProperties( config );
133 void UniqueAppHandler::loadCommandLineOptions()
135 TDECmdLineArgs::addCmdLineOptions( akregator_options );
138 int UniqueAppHandler::newInstance()
140 kdDebug(5602) << k_funcinfo << endl;
142 (void)plugin()->part();
143 DCOPRef akr(
"akregator",
"AkregatorIface" );
155 #include "akregator_plugin.moc"