kontact
kmobiletools_plugin.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kmobiletools_plugin.h"
00021
00022 #include <maininterface.h>
00023 #include <kontactinterfaces/core.h>
00024
00025 #include <kaboutdata.h>
00026 #include <kaction.h>
00027 #include <kactioncollection.h>
00028 #include <kapplication.h>
00029 #include <kgenericfactory.h>
00030 #include <kparts/componentfactory.h>
00031
00032 EXPORT_KONTACT_PLUGIN( KMobileToolsPlugin, kmobiletools )
00033
00034 KMobileToolsPlugin::KMobileToolsPlugin( Kontact::Core *core, const QVariantList & )
00035 : Kontact::Plugin( core, core, "KMobileTools" ), partLoaded( false )
00036 {
00037 setComponentData( KontactPluginFactory::componentData() );
00038 KAction *newaction = new KAction( KIcon( "newsms" ), i18n( "New SMS..." ), this );
00039 actionCollection()->addAction( "newsms", newaction );
00040 newaction->setShortcut( QKeySequence( Qt::CTRL+Qt::SHIFT + Qt::Key_S ) );
00041 connect( newaction, SIGNAL(triggered(bool)),SLOT(slotNewSMS()) );
00042 insertNewAction( newaction );
00043 setExecutableName( "kmobiletools_bin" );
00044 }
00045
00046 KMobileToolsPlugin::~KMobileToolsPlugin()
00047 {
00048 }
00049
00050 bool KMobileToolsPlugin::isRunningStandalone()
00051 {
00052
00053 #ifdef __GNUC__
00054 #warning FIXME!!!
00055 #endif
00056 return false;
00057 }
00058
00059 KParts::ReadOnlyPart *KMobileToolsPlugin::createPart()
00060 {
00061 KParts::ReadOnlyPart *m_part = loadPart();
00062 partLoaded=(bool)m_part;
00063 #ifdef __GNUC__
00064 #warning "look at if interface is ok";
00065 #endif
00066 m_interface = new OrgKdeKmobiletoolsMainInterface( "org.kde.kmobiletools",
00067 "/KMobitools", QDBusConnection::sessionBus() );
00068 return m_part;
00069 }
00070
00071 void KMobileToolsPlugin::slotNewSMS()
00072 {
00073 (void) part();
00074 Q_ASSERT( m_interface );
00075 m_interface->newSMS();
00076 }
00077
00078 #include "kmobiletools_plugin.moc"