summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/clipboardapplet/clipboard.cpp14
-rw-r--r--core/applets/clipboardapplet/clipboardapplet.pro2
-rw-r--r--core/applets/clipboardapplet/opie-clipboardapplet.control2
-rw-r--r--core/applets/logoutapplet/logout.cpp9
-rw-r--r--core/applets/logoutapplet/logoutapplet.pro2
5 files changed, 12 insertions, 17 deletions
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp
index 57a4088..a32e98b 100644
--- a/core/applets/clipboardapplet/clipboard.cpp
+++ b/core/applets/clipboardapplet/clipboard.cpp
@@ -8,55 +8,53 @@
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "clipboard.h" 21#include "clipboard.h"
22 22
23#include <opie2/otaskbarapplet.h> 23#include <opie2/otaskbarapplet.h>
24#include <qpe/resource.h> 24#include <opie2/oresource.h>
25
25#include <qpe/applnk.h> 26#include <qpe/applnk.h>
26 27
27#include <qpainter.h> 28#include <qpainter.h>
28#include <qpopupmenu.h> 29#include <qpopupmenu.h>
29#include <qwindowsystem_qws.h> 30#include <qwindowsystem_qws.h>
30#include <qapplication.h> 31#include <qapplication.h>
31#include <qclipboard.h> 32#include <qclipboard.h>
32#include <qtimer.h> 33#include <qtimer.h>
33 34
34//=========================================================================== 35//===========================================================================
35 36
36 37
37using namespace Opie::Ui; 38using namespace Opie::Ui;
38ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) 39ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name )
39{ 40{
40 setFixedWidth ( AppLnk::smallIconSize() ); 41 setFixedWidth ( AppLnk::smallIconSize() );
41 setFixedHeight ( AppLnk::smallIconSize() ); 42 setFixedHeight ( AppLnk::smallIconSize() );
42 43
43 QImage img = Resource::loadImage( "paste"); 44 m_clipboardPixmap = Opie::Core::OResource::loadPixmap( "paste", Opie::Core::OResource::SmallIcon );
44 img = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
45
46 m_clipboardPixmap.convertFromImage( img );
47 45
48 m_timer = new QTimer ( this ); 46 m_timer = new QTimer ( this );
49 47
50 connect ( QApplication::clipboard ( ), SIGNAL( dataChanged()), this, SLOT( newData())); 48 connect ( QApplication::clipboard ( ), SIGNAL( dataChanged()), this, SLOT( newData()));
51 connect ( m_timer, SIGNAL( timeout()), this, SLOT( newData())); 49 connect ( m_timer, SIGNAL( timeout()), this, SLOT( newData()));
52 connect ( qApp, SIGNAL( aboutToQuit()), this, SLOT( shutdown())); 50 connect ( qApp, SIGNAL( aboutToQuit()), this, SLOT( shutdown()));
53 51
54 m_menu = 0; 52 m_menu = 0;
55 m_dirty = true; 53 m_dirty = true;
56 m_lasttext = QString::null; 54 m_lasttext = QString::null;
57 55
58 m_timer-> start ( 0, true ); 56 m_timer-> start ( 0, true );
59} 57}
60 58
61ClipboardApplet::~ClipboardApplet ( ) 59ClipboardApplet::~ClipboardApplet ( )
62{ 60{
@@ -83,35 +81,35 @@ void ClipboardApplet::mousePressEvent ( QMouseEvent *)
83 m_menu = new QPopupMenu ( this ); 81 m_menu = new QPopupMenu ( this );
84 m_menu-> setCheckable ( true ); 82 m_menu-> setCheckable ( true );
85 83
86 if ( m_history. count ( )) { 84 if ( m_history. count ( )) {
87 for ( unsigned int i = 0; i < m_history. count ( ); i++ ) { 85 for ( unsigned int i = 0; i < m_history. count ( ); i++ ) {
88 QString str = m_history [i]; 86 QString str = m_history [i];
89 87
90 if ( str. length ( ) > 20 ) 88 if ( str. length ( ) > 20 )
91 str = str. left ( 20 ) + "..."; 89 str = str. left ( 20 ) + "...";
92 90
93 m_menu-> insertItem ( QString ( "%1: %2" ). arg ( i + 1 ). arg ( str ), i ); 91 m_menu-> insertItem ( QString ( "%1: %2" ). arg ( i + 1 ). arg ( str ), i );
94 m_menu-> setItemChecked ( i, false ); 92 m_menu-> setItemChecked ( i, false );
95 } 93 }
96 m_menu-> setItemChecked ( m_history. count ( ) - 1, true ); 94 m_menu-> setItemChecked ( m_history. count ( ) - 1, true );
97 m_menu-> insertSeparator ( ); 95 m_menu-> insertSeparator ( );
98 } 96 }
99 m_menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "cut" )), tr( "Cut" ), 100 ); 97 m_menu-> insertItem ( Opie::Core::OResource::loadPixmap( "cut", Opie::Core::OResource::SmallIcon ), tr( "Cut" ), 100 );
100 m_menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "copy" )), tr( "Copy" ), 101 ); 98 m_menu-> insertItem ( Opie::Core::OResource::loadPixmap( "copy", Opie::Core::OResource::SmallIcon ), tr( "Copy" ), 101 );
101 m_menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "paste" )), tr( "Paste" ), 102 ); 99 m_menu-> insertItem ( Opie::Core::OResource::loadPixmap( "paste", Opie::Core::OResource::SmallIcon ), tr( "Paste" ), 102 );
102 100
103 connect ( m_menu, SIGNAL( activated(int)), this, SLOT( action(int))); 101 connect ( m_menu, SIGNAL( activated(int)), this, SLOT( action(int)));
104 102
105 m_dirty = false; 103 m_dirty = false;
106 } 104 }
107 QPoint p = mapToGlobal ( QPoint ( 0, 0 )); 105 QPoint p = mapToGlobal ( QPoint ( 0, 0 ));
108 QSize s = m_menu-> sizeHint ( ); 106 QSize s = m_menu-> sizeHint ( );
109 107
110 m_menu-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( ))); 108 m_menu-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( )));
111} 109}
112 110
113void ClipboardApplet::action(int id) 111void ClipboardApplet::action(int id)
114{ 112{
115 ushort unicode = 0; 113 ushort unicode = 0;
116 int scan = 0; 114 int scan = 0;
117 115
diff --git a/core/applets/clipboardapplet/clipboardapplet.pro b/core/applets/clipboardapplet/clipboardapplet.pro
index 647598d..cdd0121 100644
--- a/core/applets/clipboardapplet/clipboardapplet.pro
+++ b/core/applets/clipboardapplet/clipboardapplet.pro
@@ -1,13 +1,13 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt plugin warn_on 2 CONFIG += qt plugin warn_on
3 HEADERS = clipboard.h 3 HEADERS = clipboard.h
4 SOURCES = clipboard.cpp 4 SOURCES = clipboard.cpp
5 TARGET = clipboardapplet 5 TARGET = clipboardapplet
6 DESTDIR = $(OPIEDIR)/plugins/applets 6 DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += 8DEPENDPATH +=
9LIBS += -lqpe 9LIBS += -lqpe -lopiecore2
10 VERSION = 1.0.0 10 VERSION = 1.0.0
11 11
12include( $(OPIEDIR)/include.pro ) 12include( $(OPIEDIR)/include.pro )
13target.path = $$prefix/plugins/applets 13target.path = $$prefix/plugins/applets
diff --git a/core/applets/clipboardapplet/opie-clipboardapplet.control b/core/applets/clipboardapplet/opie-clipboardapplet.control
index e0e2d82..6596633 100644
--- a/core/applets/clipboardapplet/opie-clipboardapplet.control
+++ b/core/applets/clipboardapplet/opie-clipboardapplet.control
@@ -1,10 +1,10 @@
1Package: opie-clipboardapplet 1Package: opie-clipboardapplet
2Files: plugins/applets/libclipboardapplet.so* 2Files: plugins/applets/libclipboardapplet.so*
3Priority: optional 3Priority: optional
4Section: opie/applets 4Section: opie/applets
5Maintainer: Robert Griebl <sandman@handhelds.org> 5Maintainer: Robert Griebl <sandman@handhelds.org>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal 7Depends: task-opie-minimal, libopiecore2
8Description: Clipboard applet 8Description: Clipboard applet
9 Clipboard applet for the Opie environment taskbar. 9 Clipboard applet for the Opie environment taskbar.
10Version: $QPE_VERSION$EXTRAVERSION 10Version: $QPE_VERSION$EXTRAVERSION
diff --git a/core/applets/logoutapplet/logout.cpp b/core/applets/logoutapplet/logout.cpp
index 0f36f16..dc0c67c 100644
--- a/core/applets/logoutapplet/logout.cpp
+++ b/core/applets/logoutapplet/logout.cpp
@@ -1,20 +1,21 @@
1#include "logout.h" 1#include "logout.h"
2 2
3#include <opie2/oresource.h>
4
3#include <qpe/applnk.h> 5#include <qpe/applnk.h>
4#include <qpe/resource.h>
5#include <qpe/qcopenvelope_qws.h> 6#include <qpe/qcopenvelope_qws.h>
6 7
7#include <qapplication.h> 8#include <qapplication.h>
8#include <qmessagebox.h> 9#include <qmessagebox.h>
9 10
10#include <unistd.h> 11#include <unistd.h>
11 12
12LogoutApplet::LogoutApplet ( ) 13LogoutApplet::LogoutApplet ( )
13 : QObject ( 0, "LogoutApplet" ) 14 : QObject ( 0, "LogoutApplet" )
14{ 15{
15} 16}
16 17
17LogoutApplet::~LogoutApplet ( ) 18LogoutApplet::~LogoutApplet ( )
18{ 19{
19} 20}
20 21
@@ -32,37 +33,33 @@ QString LogoutApplet::text ( ) const
32{ 33{
33 return tr( "Logout" ); 34 return tr( "Logout" );
34} 35}
35 36
36QString LogoutApplet::tr( const char* s ) const 37QString LogoutApplet::tr( const char* s ) const
37{ 38{
38 return qApp->translate( "LogoutApplet", s, 0 ); 39 return qApp->translate( "LogoutApplet", s, 0 );
39} 40}
40 41
41QString LogoutApplet::tr( const char* s, const char* p ) const 42QString LogoutApplet::tr( const char* s, const char* p ) const
42{ 43{
43 return qApp->translate( "LogoutApplet", s, p ); 44 return qApp->translate( "LogoutApplet", s, p );
44} 45}
45 46
46QIconSet LogoutApplet::icon ( ) const 47QIconSet LogoutApplet::icon ( ) const
47{ 48{
48 QPixmap pix; 49 QPixmap pix = Opie::Core::OResource::loadPixmap("logout", Opie::Core::OResource::SmallIcon );
49 QImage img = Resource::loadImage ( "logout" );
50
51 if ( !img. isNull ( ))
52 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
53 return pix; 50 return pix;
54} 51}
55 52
56QPopupMenu *LogoutApplet::popup ( QWidget * ) const 53QPopupMenu *LogoutApplet::popup ( QWidget * ) const
57{ 54{
58 return 0; 55 return 0;
59} 56}
60 57
61// This is a workaround for a Qt bug 58// This is a workaround for a Qt bug
62// clipboard applet has to stop its poll timer, or Qt/E 59// clipboard applet has to stop its poll timer, or Qt/E
63// will hang on quit() right before it emits aboutToQuit() 60// will hang on quit() right before it emits aboutToQuit()
64 61
65class HackApplication : public QApplication { 62class HackApplication : public QApplication {
66public: 63public:
67 HackApplication ( ) : QApplication ( dummy, 0 ) 64 HackApplication ( ) : QApplication ( dummy, 0 )
68 { 65 {
diff --git a/core/applets/logoutapplet/logoutapplet.pro b/core/applets/logoutapplet/logoutapplet.pro
index 23cab02..5bb1571 100644
--- a/core/applets/logoutapplet/logoutapplet.pro
+++ b/core/applets/logoutapplet/logoutapplet.pro
@@ -1,13 +1,13 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on 2CONFIG += qt plugin warn_on
3HEADERS = logout.h 3HEADERS = logout.h
4SOURCES = logout.cpp 4SOURCES = logout.cpp
5TARGET = logoutapplet 5TARGET = logoutapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe -lopiecore2
10VERSION = 1.0.0 10VERSION = 1.0.0
11 11
12include( $(OPIEDIR)/include.pro ) 12include( $(OPIEDIR)/include.pro )
13target.path = $$prefix/plugins/applets 13target.path = $$prefix/plugins/applets