kitchensync
part.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <qlayout.h>
00022 #include <qvbox.h>
00023
00024 #include <kaction.h>
00025 #include <kapplication.h>
00026 #include <kdebug.h>
00027 #include <kiconloader.h>
00028 #include <kinstance.h>
00029 #include <klocale.h>
00030 #include <kparts/genericfactory.h>
00031
00032 #include "mainwidget.h"
00033
00034 #include "part.h"
00035
00036 typedef KParts::GenericFactory< KitchenSyncPart > KitchenSyncFactory;
00037 K_EXPORT_COMPONENT_FACTORY( libkitchensyncpart, KitchenSyncFactory )
00038
00039 KitchenSyncPart::KitchenSyncPart( QWidget *parentWidget, const char *widgetName,
00040 QObject *parent, const char *name,
00041 const QStringList& )
00042 : KParts::ReadOnlyPart( parent, name )
00043 {
00044 setInstance( KitchenSyncFactory::instance() );
00045
00046 QVBox *canvas = new QVBox( parentWidget, widgetName );
00047 setWidget( canvas );
00048
00049 new MainWidget( this, canvas );
00050
00051 KGlobal::iconLoader()->addAppDir( "kitchensync" );
00052
00053 setXMLFile( "kitchensync_part.rc" );
00054 }
00055
00056 KitchenSyncPart::~KitchenSyncPart()
00057 {
00058 closeURL();
00059 }
00060
00061 KAboutData *KitchenSyncPart::createAboutData()
00062 {
00063 return MainWidget::aboutData();
00064 }
00065
00066 void KitchenSyncPart::exit()
00067 {
00068 delete this;
00069 }
00070
00071 bool KitchenSyncPart::openURL( const KURL &url )
00072 {
00073 emit setWindowCaption( url.prettyURL() );
00074
00075 return true;
00076 }
00077
00078 bool KitchenSyncPart::openFile()
00079 {
00080 return true;
00081 }
00082
00083 void KitchenSyncPart::guiActivateEvent( KParts::GUIActivateEvent *e )
00084 {
00085 KParts::ReadOnlyPart::guiActivateEvent( e );
00086 }
00087
00088 #include "part.moc"
00089
|