summaryrefslogtreecommitdiff
authordrw <drw>2005-04-29 00:05:39 (UTC)
committer drw <drw>2005-04-29 00:05:39 (UTC)
commit0d940522f5d849dd480bd2785d592f3d787e0941 (patch) (unidiff)
tree035a7b4ed517f221fd7ced4eec83708326cd50f5
parentc1cab57555a395c9da678b92f492779506421386 (diff)
downloadopie-0d940522f5d849dd480bd2785d592f3d787e0941.zip
opie-0d940522f5d849dd480bd2785d592f3d787e0941.tar.gz
opie-0d940522f5d849dd480bd2785d592f3d787e0941.tar.bz2
Resource -> OResource
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/cardmon/cardmon.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index 452339c..11ce880 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -16,18 +16,19 @@
16 * * 16 * *
17 ***************************************************************************/ 17 ***************************************************************************/
18 18
19#include "cardmon.h" 19#include "cardmon.h"
20 20
21/* OPIE */ 21/* OPIE */
22#include <opie2/odebug.h> 22#include <opie2/odebug.h>
23#include <opie2/odevice.h> 23#include <opie2/odevice.h>
24#include <opie2/otaskbarapplet.h>
25#include <opie2/oprocess.h> 24#include <opie2/oprocess.h>
25#include <opie2/oresource.h>
26#include <opie2/otaskbarapplet.h>
26 27
27#include <qpe/applnk.h> 28#include <qpe/applnk.h>
28#include <qpe/resource.h> 29#include <qpe/resource.h>
29using namespace Opie::Core; 30using namespace Opie::Core;
30using namespace Opie::Ui; 31using namespace Opie::Ui;
31 32
32/* QT */ 33/* QT */
33#include <qcopchannel_qws.h> 34#include <qcopchannel_qws.h>
@@ -45,17 +46,17 @@ using namespace Opie::Ui;
45#include <fcntl.h> 46#include <fcntl.h>
46#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 47#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
47#include <sys/vfs.h> 48#include <sys/vfs.h>
48#include <mntent.h> 49#include <mntent.h>
49#endif 50#endif
50 51
51CardMonitor::CardMonitor( QWidget * parent ) : QWidget( parent ) 52CardMonitor::CardMonitor( QWidget * parent ) : QWidget( parent )
52{ 53{
53 pm = Resource::loadImage( "cardmon/pcmcia").smoothScale(AppLnk::smallIconSize(), AppLnk::smallIconSize()); 54 pm = Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon );
54 55
55 QCopChannel * pcmciaChannel = new QCopChannel( "QPE/Card", this ); 56 QCopChannel * pcmciaChannel = new QCopChannel( "QPE/Card", this );
56 connect( pcmciaChannel, 57 connect( pcmciaChannel,
57 SIGNAL( received(const QCString&,const QByteArray&) ), this, 58 SIGNAL( received(const QCString&,const QByteArray&) ), this,
58 SLOT( cardMessage(const QCString&,const QByteArray&) ) ); 59 SLOT( cardMessage(const QCString&,const QByteArray&) ) );
59 60
60 QCopChannel *sdChannel = new QCopChannel( "QPE/Card", this ); 61 QCopChannel *sdChannel = new QCopChannel( "QPE/Card", this );
61 connect( sdChannel, 62 connect( sdChannel,
@@ -86,17 +87,17 @@ void CardMonitor::popUp( QString message, QString icon ) {
86 if ( !popupMenu ) { 87 if ( !popupMenu ) {
87 popupMenu = new QPopupMenu( this ); 88 popupMenu = new QPopupMenu( this );
88 } 89 }
89 90
90 popupMenu->clear(); 91 popupMenu->clear();
91 if ( icon.isEmpty() ) { 92 if ( icon.isEmpty() ) {
92 popupMenu->insertItem( message, 0 ); 93 popupMenu->insertItem( message, 0 );
93 } else { 94 } else {
94 popupMenu->insertItem( QIconSet( Resource::loadPixmap( icon ) ), 95 popupMenu->insertItem( QIconSet( Opie::Core::OResource::loadPixmap( icon, Opie::Core::OResource::SmallIcon ) ),
95 message, 0 ); 96 message, 0 );
96 } 97 }
97 98
98 QPoint p = mapToGlobal( QPoint( 0, 0 ) ); 99 QPoint p = mapToGlobal( QPoint( 0, 0 ) );
99 QSize s = popupMenu->sizeHint(); 100 QSize s = popupMenu->sizeHint();
100 popupMenu->popup( QPoint( p.x() + ( width() / 2 ) - ( s.width() / 2 ), 101 popupMenu->popup( QPoint( p.x() + ( width() / 2 ) - ( s.width() / 2 ),
101 p.y() - s.height() ), 0 ); 102 p.y() - s.height() ), 0 );
102 103
@@ -108,31 +109,31 @@ void CardMonitor::popupTimeout() {
108} 109}
109 110
110void CardMonitor::mousePressEvent( QMouseEvent * ) { 111void CardMonitor::mousePressEvent( QMouseEvent * ) {
111 QPopupMenu * menu = new QPopupMenu( this ); 112 QPopupMenu * menu = new QPopupMenu( this );
112 QStringList cmd; 113 QStringList cmd;
113 bool execute = true; 114 bool execute = true;
114 115
115 if ( cardInSd ) { 116 if ( cardInSd ) {
116 menu->insertItem( QIconSet( Resource::loadPixmap( "cardmon/ide" ) ), 117 menu->insertItem( QIconSet( Opie::Core::OResource::loadPixmap( "cardmon/ide", Opie::Core::OResource::SmallIcon ) ),
117 tr( "Eject SD/MMC card" ), 0 ); 118 tr( "Eject SD/MMC card" ), 0 );
118 } 119 }
119 120
120 if ( cardInPcmcia0 ) { 121 if ( cardInPcmcia0 ) {
121 menu-> 122 menu->
122 insertItem( QIconSet 123 insertItem( QIconSet
123 ( Resource::loadPixmap( "cardmon/" + cardInPcmcia0Type ) ), 124 ( Opie::Core::OResource::loadPixmap( "cardmon/" + cardInPcmcia0Type, Opie::Core::OResource::SmallIcon ) ),
124 tr( "Eject card 0: %1" ).arg( cardInPcmcia0Name ), 1 ); 125 tr( "Eject card 0: %1" ).arg( cardInPcmcia0Name ), 1 );
125 } 126 }
126 127
127 if ( cardInPcmcia1 ) { 128 if ( cardInPcmcia1 ) {
128 menu-> 129 menu->
129 insertItem( QIconSet 130 insertItem( QIconSet
130 ( Resource::loadPixmap( "cardmon/" + cardInPcmcia1Type ) ), 131 ( Opie::Core::OResource::loadPixmap( "cardmon/" + cardInPcmcia1Type, Opie::Core::OResource::SmallIcon ) ),
131 tr( "Eject card 1: %1" ).arg( cardInPcmcia1Name ), 2 ); 132 tr( "Eject card 1: %1" ).arg( cardInPcmcia1Name ), 2 );
132 } 133 }
133 134
134 QPoint p = mapToGlobal( QPoint( 0, 0 ) ); 135 QPoint p = mapToGlobal( QPoint( 0, 0 ) );
135 QSize s = menu->sizeHint(); 136 QSize s = menu->sizeHint();
136 int opt = menu->exec( QPoint( p.x() + ( width() / 2 ) - ( s.width() / 2 ), 137 int opt = menu->exec( QPoint( p.x() + ( width() / 2 ) - ( s.width() / 2 ),
137 p.y() - s.height() ), 0 ); 138 p.y() - s.height() ), 0 );
138 139