summaryrefslogtreecommitdiff
path: root/core/applets/aboutapplet/about.cpp
blob: accfdd6e982f47bf5a31b0979b676451e937d5c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "about.h"
#include "widget.h"

#include <opie2/oresource.h>

#include <qpe/applnk.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>

#include <qlabel.h>

AboutApplet::AboutApplet ( )
        : QObject ( 0, "AboutApplet" ), m_ad( 0l )
{}

AboutApplet::~AboutApplet ( )
{
    delete m_ad;
}

int AboutApplet::position ( ) const
{
    return 1;
}

QString AboutApplet::name ( ) const
{
    return tr( "About shortcut" );
}

QString AboutApplet::text ( ) const
{
    return tr( "About" );
}

QString AboutApplet::tr( const char* s ) const
{
    return qApp->translate( "AboutApplet", s, 0 );
}

QString AboutApplet::tr( const char* s, const char* p ) const
{
    return qApp->translate( "AboutApplet", s, p );
}

QIconSet AboutApplet::icon() const
{
    QPixmap pix = Opie::Core::OResource::loadPixmap ( "logo/opielogo", Opie::Core::OResource::SmallIcon );
    return pix;
}

QPopupMenu *AboutApplet::popup ( QWidget * ) const
{
    return 0;
}

void AboutApplet::activated()
{
    if ( !m_ad )
        m_ad = new AboutWidget( 0, "aboutDialog" );

    QPEApplication::showWidget( m_ad );
}

QRESULT AboutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
    *iface = 0;
    if ( uuid == IID_QUnknown )
        * iface = this;
    else if ( uuid == IID_MenuApplet )
        * iface = this;
    else
        return QS_FALSE;

    if ( *iface )
        ( *iface ) -> addRef ( );
    return QS_OK;
}

Q_EXPORT_INTERFACE( )
{
    Q_CREATE_INSTANCE( AboutApplet )
}