summaryrefslogtreecommitdiff
path: root/core/applets/aboutapplet/about.cpp
authormickeyl <mickeyl>2004-03-08 15:33:01 (UTC)
committer mickeyl <mickeyl>2004-03-08 15:33:01 (UTC)
commit0d38352ef00f5fc660f4502f2f0ee1cccd508397 (patch) (unidiff)
tree54e1217610c3f325ca6cccf4647bc50d1fc23b0a /core/applets/aboutapplet/about.cpp
parent38301e81221e7e51cc67a5e366498a71df288263 (diff)
downloadopie-0d38352ef00f5fc660f4502f2f0ee1cccd508397.zip
opie-0d38352ef00f5fc660f4502f2f0ee1cccd508397.tar.gz
opie-0d38352ef00f5fc660f4502f2f0ee1cccd508397.tar.bz2
first shot at a neat little about applet. text in about box blatantly
stolen from the KDE about box. authors taken from AUTHORS file in cvs root directory. Add yourself if you're missing. Note: The dialog looks better when viewed in 320x240 or larger (as opposed to 240x320) because of OpieZilla ;)
Diffstat (limited to 'core/applets/aboutapplet/about.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/aboutapplet/about.cpp89
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
10AboutApplet::AboutApplet ( )
11 : QObject ( 0, "AboutApplet" )
12{}
13
14AboutApplet::~AboutApplet ( )
15{}
16
17int AboutApplet::position ( ) const
18{
19 return 1;
20}
21
22QString AboutApplet::name ( ) const
23{
24 return tr( "About shortcut" );
25}
26
27QString AboutApplet::text ( ) const
28{
29 return tr( "About" );
30}
31
32QString AboutApplet::tr( const char* s ) const
33{
34 return qApp->translate( "AboutApplet", s, 0 );
35}
36
37QString AboutApplet::tr( const char* s, const char* p ) const
38{
39 return qApp->translate( "AboutApplet", s, p );
40}
41
42QIconSet 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
52QPopupMenu *AboutApplet::popup ( QWidget * ) const
53{
54 return 0;
55}
56
57void 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
69QRESULT 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
84Q_EXPORT_INTERFACE( )
85{
86 Q_CREATE_INSTANCE( AboutApplet )
87}
88
89