author | mickeyl <mickeyl> | 2004-03-01 19:19:37 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-01 19:19:37 (UTC) |
commit | ddc3d749af5f7afebf69488b79641771fe246b5b (patch) (unidiff) | |
tree | 8ea8614906c568e4677493ef09040724d60dd2d4 /core/applets/screenshotapplet/screenshot.cpp | |
parent | fb0981f47e529f9d1dd77fa005ffa3c3ecedff67 (diff) | |
download | opie-ddc3d749af5f7afebf69488b79641771fe246b5b.zip opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.gz opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.bz2 |
remove duplicated boiler plate code in favour of the OTaskbarApplet template
Diffstat (limited to 'core/applets/screenshotapplet/screenshot.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp index 56a031c..5d6bce4 100644 --- a/core/applets/screenshotapplet/screenshot.cpp +++ b/core/applets/screenshotapplet/screenshot.cpp | |||
@@ -12,31 +12,34 @@ | |||
12 | ** | 12 | ** |
13 | **********************************************************************/ | 13 | **********************************************************************/ |
14 | 14 | ||
15 | #include "screenshot.h" | 15 | #include "screenshot.h" |
16 | #include "inputDialog.h" | 16 | #include "inputDialog.h" |
17 | 17 | ||
18 | #include <stdlib.h> | 18 | /* OPIE */ |
19 | #include <sys/socket.h> | 19 | #include <opie2/otaskbarapplet.h> |
20 | #include <netinet/in.h> | ||
21 | #include <netdb.h> | ||
22 | #include <unistd.h> | ||
23 | |||
24 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/applnk.h> | 21 | #include <qpe/applnk.h> |
26 | 22 | ||
23 | /* QT */ | ||
27 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
28 | #include <qdir.h> | 25 | #include <qdir.h> |
29 | #include <qlabel.h> | 26 | #include <qlabel.h> |
30 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
31 | #include <qpainter.h> | 28 | #include <qpainter.h> |
32 | #include <qspinbox.h> | 29 | #include <qspinbox.h> |
33 | #include <qlayout.h> | 30 | #include <qlayout.h> |
34 | #include <qcheckbox.h> | 31 | #include <qcheckbox.h> |
35 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
36 | 33 | ||
34 | /* STD */ | ||
35 | #include <stdlib.h> | ||
36 | #include <sys/socket.h> | ||
37 | #include <netinet/in.h> | ||
38 | #include <netdb.h> | ||
39 | #include <unistd.h> | ||
37 | 40 | ||
38 | /* XPM */ | 41 | /* XPM */ |
39 | static char * snapshot_xpm[] = { | 42 | static char * snapshot_xpm[] = { |
40 | "32 32 177 2", | 43 | "32 32 177 2", |
41 | " c None", | 44 | " c None", |
42 | ". c #042045", | 45 | ". c #042045", |
@@ -494,12 +497,17 @@ ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name ) | |||
494 | } | 497 | } |
495 | 498 | ||
496 | ScreenshotApplet::~ScreenshotApplet() | 499 | ScreenshotApplet::~ScreenshotApplet() |
497 | { | 500 | { |
498 | } | 501 | } |
499 | 502 | ||
503 | int ScreenshotApplet::position() | ||
504 | { | ||
505 | return 6; | ||
506 | } | ||
507 | |||
500 | void ScreenshotApplet::mousePressEvent( QMouseEvent *) | 508 | void ScreenshotApplet::mousePressEvent( QMouseEvent *) |
501 | { | 509 | { |
502 | ScreenshotControl *sc = new ScreenshotControl ( ); | 510 | ScreenshotControl *sc = new ScreenshotControl ( ); |
503 | QPoint curPos = mapToGlobal ( QPoint ( 0, 0 )); | 511 | QPoint curPos = mapToGlobal ( QPoint ( 0, 0 )); |
504 | 512 | ||
505 | // windowPosX is the windows position centered above the applets icon. | 513 | // windowPosX is the windows position centered above the applets icon. |
@@ -525,6 +533,11 @@ void ScreenshotApplet::mousePressEvent( QMouseEvent *) | |||
525 | void ScreenshotApplet::paintEvent( QPaintEvent* ) | 533 | void ScreenshotApplet::paintEvent( QPaintEvent* ) |
526 | { | 534 | { |
527 | QPainter p ( this ); | 535 | QPainter p ( this ); |
528 | p.drawPixmap( 0,0, m_icon ); | 536 | p.drawPixmap( 0,0, m_icon ); |
529 | } | 537 | } |
530 | 538 | ||
539 | Q_EXPORT_INTERFACE() | ||
540 | { | ||
541 | Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ScreenshotApplet> ); | ||
542 | } | ||
543 | |||