00001 #include "about.h"
00002 #include "widget.h"
00003
00004 #include <opie2/oresource.h>
00005
00006 #include <qpe/applnk.h>
00007 #include <qpe/qpeapplication.h>
00008 #include <qpe/qcopenvelope_qws.h>
00009
00010 #include <qlabel.h>
00011
00012 AboutApplet::AboutApplet ( )
00013 : QObject ( 0, "AboutApplet" ), m_ad( 0l )
00014 {}
00015
00016 AboutApplet::~AboutApplet ( )
00017 {
00018 delete m_ad;
00019 }
00020
00021 int AboutApplet::position ( ) const
00022 {
00023 return 1;
00024 }
00025
00026 QString AboutApplet::name ( ) const
00027 {
00028 return tr( "About shortcut" );
00029 }
00030
00031 QString AboutApplet::text ( ) const
00032 {
00033 return tr( "About" );
00034 }
00035
00036 QString AboutApplet::tr( const char* s ) const
00037 {
00038 return qApp->translate( "AboutApplet", s, 0 );
00039 }
00040
00041 QString AboutApplet::tr( const char* s, const char* p ) const
00042 {
00043 return qApp->translate( "AboutApplet", s, p );
00044 }
00045
00046 QIconSet AboutApplet::icon() const
00047 {
00048 QPixmap pix = Opie::Core::OResource::loadPixmap ( "logo/opielogo", Opie::Core::OResource::SmallIcon );
00049 return pix;
00050 }
00051
00052 QPopupMenu *AboutApplet::popup ( QWidget * ) const
00053 {
00054 return 0;
00055 }
00056
00057 void AboutApplet::activated()
00058 {
00059 if ( !m_ad )
00060 m_ad = new AboutWidget( 0, "aboutDialog" );
00061
00062 QPEApplication::showWidget( m_ad );
00063 }
00064
00065 QRESULT AboutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
00066 {
00067 *iface = 0;
00068 if ( uuid == IID_QUnknown )
00069 * iface = this;
00070 else if ( uuid == IID_MenuApplet )
00071 * iface = this;
00072 else
00073 return QS_FALSE;
00074
00075 if ( *iface )
00076 ( *iface ) -> addRef ( );
00077 return QS_OK;
00078 }
00079
00080 Q_EXPORT_INTERFACE( )
00081 {
00082 Q_CREATE_INSTANCE( AboutApplet )
00083 }
00084
00085