27 #include <tdeapplication.h>
28 #include <tdeaction.h>
30 #include <kgenericfactory.h>
31 #include <kiconloader.h>
32 #include <tdemessagebox.h>
33 #include <dcopclient.h>
37 #include "journalplugin.h"
38 #include "korg_uniqueapp.h"
41 typedef KGenericFactory< JournalPlugin, Kontact::Core > JournalPluginFactory;
42 K_EXPORT_COMPONENT_FACTORY( libkontact_journalplugin,
43 JournalPluginFactory(
"kontact_journalplugin" ) )
45 JournalPlugin::JournalPlugin( Kontact::Core *core, const
char *, const TQStringList& )
46 : Kontact::Plugin( core, core, "korganizer" ),
49 setInstance( JournalPluginFactory::instance() );
50 instance()->iconLoader()->addAppDir(
"tdepim");
52 insertNewAction(
new TDEAction( i18n(
"New Journal..." ),
"newjournal",
53 CTRL+SHIFT+Key_J,
this, TQ_SLOT( slotNewJournal() ), actionCollection(),
55 insertSyncAction(
new TDEAction( i18n(
"Synchronize Journal" ),
"reload",
56 0,
this, TQ_SLOT( slotSyncJournal() ), actionCollection(),
64 JournalPlugin::~JournalPlugin()
68 KParts::ReadOnlyPart *JournalPlugin::createPart()
70 KParts::ReadOnlyPart *part = loadPart();
76 mIface =
new KCalendarIface_stub( dcopClient(),
"kontact",
"CalendarIface" );
81 void JournalPlugin::select()
83 interface()->showJournalView();
86 TQStringList JournalPlugin::invisibleToolbarActions()
const
88 TQStringList invisible;
89 invisible +=
"new_event";
90 invisible +=
"new_todo";
91 invisible +=
"new_journal";
93 invisible +=
"view_day";
94 invisible +=
"view_list";
95 invisible +=
"view_workweek";
96 invisible +=
"view_week";
97 invisible +=
"view_nextx";
98 invisible +=
"view_month";
99 invisible +=
"view_todo";
103 KCalendarIface_stub *JournalPlugin::interface()
112 void JournalPlugin::slotNewJournal()
114 interface()->openJournalEditor(
"" );
117 void JournalPlugin::slotSyncJournal()
119 DCOPRef ref(
"kmail",
"KMailICalIface" );
120 ref.send(
"triggerSync", TQString(
"Journal") );
123 bool JournalPlugin::createDCOPInterface(
const TQString& serviceType )
125 kdDebug(5602) << k_funcinfo << serviceType << endl;
126 if ( serviceType ==
"DCOP/Organizer" || serviceType ==
"DCOP/Calendar" ) {
134 bool JournalPlugin::isRunningStandalone()
136 return mUniqueAppWatcher->isRunningStandalone();
139 #include "journalplugin.moc"
Used by UniqueAppWatcher below, to create the above UniqueAppHandler object when necessary.
If the standalone application is running by itself, we need to watch for when the user closes it,...