26 #include "calendarinterface.h"
29 #include <KontactInterface/Core>
31 #include <KActionCollection>
32 #include <KIconLoader>
35 #include <QtDBus/QtDBus>
40 : KontactInterface::Plugin( core, core, "korganizer", "journal" ), mIface( 0 )
42 setComponentData( KontactPluginFactory::componentData() );
43 KIconLoader::global()->addAppDir( QLatin1String(
"korganizer") );
44 KIconLoader::global()->addAppDir( QLatin1String(
"kdepim") );
47 new KAction( KIcon( QLatin1String(
"journal-new") ),
48 i18nc(
"@action:inmenu",
"New Journal..." ),
this );
49 actionCollection()->addAction( QLatin1String(
"new_journal"), action );
50 action->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_J ) );
52 i18nc(
"@info:status",
"Create a new journal" ) );
54 i18nc(
"@info:whatsthis",
55 "You will be presented with a dialog where you can create "
56 "a new journal entry." ) );
57 connect( action, SIGNAL(triggered(
bool)), SLOT(slotNewJournal()) );
58 insertNewAction( action );
61 new KAction( KIcon( QLatin1String(
"view-refresh") ),
62 i18nc(
"@action:inmenu",
"Sync Journal" ),
this );
63 actionCollection()->addAction( QLatin1String(
"journal_sync"), syncAction );
64 syncAction->setHelpText(
65 i18nc(
"@info:status",
"Synchronize groupware journal" ) );
66 syncAction->setWhatsThis(
67 i18nc(
"@info:whatsthis",
68 "Choose this option to synchronize your groupware journal entries." ) );
69 connect( syncAction, SIGNAL(triggered(
bool)), SLOT(slotSyncJournal()) );
70 insertSyncAction( syncAction );
72 mUniqueAppWatcher =
new KontactInterface::UniqueAppWatcher(
73 new KontactInterface::UniqueAppHandlerFactory<KOrganizerUniqueAppHandler>(),
this );
82 KParts::ReadOnlyPart *part = loadPart();
88 mIface =
new OrgKdeKorganizerCalendarInterface(
89 QLatin1String(
"org.kde.korganizer"), QLatin1String(
"/Calendar"), QDBusConnection::sessionBus(),
this );
101 QStringList invisible;
102 invisible += QLatin1String(
"new_event");
103 invisible += QLatin1String(
"new_todo");
104 invisible += QLatin1String(
"new_journal");
106 invisible += QLatin1String(
"view_whatsnext");
107 invisible += QLatin1String(
"view_day");
108 invisible += QLatin1String(
"view_nextx");
109 invisible += QLatin1String(
"view_month");
110 invisible += QLatin1String(
"view_workweek");
111 invisible += QLatin1String(
"view_week");
112 invisible += QLatin1String(
"view_list");
113 invisible += QLatin1String(
"view_todo");
114 invisible += QLatin1String(
"view_journal");
115 invisible += QLatin1String(
"view_timeline");
116 invisible += QLatin1String(
"view_timespent");
130 void JournalPlugin::slotNewJournal()
132 interface()->openJournalEditor( QString(), QDate() );
135 void JournalPlugin::slotSyncJournal()
137 #if 0 //TODO porting !!!!
138 QDBusMessage message =
139 QDBusMessage::createMethodCall(
"org.kde.kmail",
"/Groupware",
140 "org.kde.kmail.groupware",
142 message << QString(
"Journal" );
143 QDBusConnection::sessionBus().send( message );
145 kWarning() <<
" JournalPlugin::slotSyncJournal : need to port to Akonadi";
151 if ( serviceType == QLatin1String(
"DBUS/Organizer") || serviceType == QLatin1String(
"DBUS/Calendar") ) {
161 return mUniqueAppWatcher->isRunningStandalone();
164 #include "journalplugin.moc"
OrgKdeKorganizerCalendarInterface * interface()
KParts::ReadOnlyPart * createPart()
QStringList invisibleToolbarActions() const
bool createDBUSInterface(const QString &serviceType)
bool isRunningStandalone() const