Diffstat (limited to 'core/applets/aboutapplet/about.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/aboutapplet/about.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/core/applets/aboutapplet/about.cpp b/core/applets/aboutapplet/about.cpp new file mode 100644 index 0000000..e909d0f --- a/dev/null +++ b/core/applets/aboutapplet/about.cpp | |||
@@ -0,0 +1,89 @@ | |||
1 | #include "about.h" | ||
2 | #include "dialog.h" | ||
3 | |||
4 | #include <qpe/resource.h> | ||
5 | #include <qpe/qcopenvelope_qws.h> | ||
6 | |||
7 | #include <qapplication.h> | ||
8 | #include <qlabel.h> | ||
9 | |||
10 | AboutApplet::AboutApplet ( ) | ||
11 | : QObject ( 0, "AboutApplet" ) | ||
12 | {} | ||
13 | |||
14 | AboutApplet::~AboutApplet ( ) | ||
15 | {} | ||
16 | |||
17 | int AboutApplet::position ( ) const | ||
18 | { | ||
19 | return 1; | ||
20 | } | ||
21 | |||
22 | QString AboutApplet::name ( ) const | ||
23 | { | ||
24 | return tr( "About shortcut" ); | ||
25 | } | ||
26 | |||
27 | QString AboutApplet::text ( ) const | ||
28 | { | ||
29 | return tr( "About" ); | ||
30 | } | ||
31 | |||
32 | QString AboutApplet::tr( const char* s ) const | ||
33 | { | ||
34 | return qApp->translate( "AboutApplet", s, 0 ); | ||
35 | } | ||
36 | |||
37 | QString AboutApplet::tr( const char* s, const char* p ) const | ||
38 | { | ||
39 | return qApp->translate( "AboutApplet", s, p ); | ||
40 | } | ||
41 | |||
42 | QIconSet AboutApplet::icon ( ) const | ||
43 | { | ||
44 | QPixmap pix; | ||
45 | QImage img = Resource::loadImage ( "about" ); | ||
46 | |||
47 | if ( !img. isNull ( ) ) | ||
48 | pix. convertFromImage ( img. smoothScale ( 14, 14 ) ); | ||
49 | return pix; | ||
50 | } | ||
51 | |||
52 | QPopupMenu *AboutApplet::popup ( QWidget * ) const | ||
53 | { | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | void AboutApplet::activated() | ||
58 | { | ||
59 | AboutDialog* d = new AboutDialog( qApp->mainWidget(), "aboutDialog", true ); | ||
60 | if ( qApp->desktop()->width() == 240 ) | ||
61 | { | ||
62 | d->logo->hide(); | ||
63 | d->setFixedWidth( qApp->desktop()->width() - 5 ); | ||
64 | d->setFixedHeight( qApp->desktop()->height() - 50 ); | ||
65 | } | ||
66 | d->exec(); | ||
67 | } | ||
68 | |||
69 | QRESULT AboutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
70 | { | ||
71 | *iface = 0; | ||
72 | if ( uuid == IID_QUnknown ) | ||
73 | * iface = this; | ||
74 | else if ( uuid == IID_MenuApplet ) | ||
75 | * iface = this; | ||
76 | else | ||
77 | return QS_FALSE; | ||
78 | |||
79 | if ( *iface ) | ||
80 | ( *iface ) -> addRef ( ); | ||
81 | return QS_OK; | ||
82 | } | ||
83 | |||
84 | Q_EXPORT_INTERFACE( ) | ||
85 | { | ||
86 | Q_CREATE_INSTANCE( AboutApplet ) | ||
87 | } | ||
88 | |||
89 | |||