summaryrefslogtreecommitdiff
path: root/noncore/applets/pyquicklaunch/pyquicklaunch.cpp
Unidiff
Diffstat (limited to 'noncore/applets/pyquicklaunch/pyquicklaunch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/pyquicklaunch/pyquicklaunch.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/applets/pyquicklaunch/pyquicklaunch.cpp b/noncore/applets/pyquicklaunch/pyquicklaunch.cpp
index bcd2f0d..45eda4e 100644
--- a/noncore/applets/pyquicklaunch/pyquicklaunch.cpp
+++ b/noncore/applets/pyquicklaunch/pyquicklaunch.cpp
@@ -1,46 +1,46 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2004 Michael 'Mickey' Lauer <mickey@vanille.de> 2** Copyright (C) 2004 Michael 'Mickey' Lauer <mickey@vanille.de>
3** All rights reserved. 3** All rights reserved.
4** 4**
5** This file may be distributed and/or modified under the terms of the 5** This file may be distributed and/or modified under the terms of the
6** GNU General Public License version 2 as published by the Free Software 6** GNU General Public License version 2 as published by the Free Software
7** Foundation and appearing in the file LICENSE.GPL included in the 7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file. 8** packaging of this file.
9** 9**
10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12** 12**
13**********************************************************************/ 13**********************************************************************/
14 14
15#include "pyquicklaunch.h" 15#include "pyquicklaunch.h"
16 16
17/* OPIE */ 17/* OPIE */
18#include <opie2/odebug.h> 18#include <opie2/odebug.h>
19#include <opie2/oresource.h>
19#include <opie2/otaskbarapplet.h> 20#include <opie2/otaskbarapplet.h>
20#include <qpe/config.h> 21#include <qpe/config.h>
21#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
22#include <qpe/resource.h>
23using namespace Opie::Core; 23using namespace Opie::Core;
24 24
25/* QT */ 25/* QT */
26#include <qcopchannel_qws.h> 26#include <qcopchannel_qws.h>
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qframe.h> 28#include <qframe.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qtimer.h> 30#include <qtimer.h>
31 31
32/* STD */ 32/* STD */
33#include <pwd.h> 33#include <pwd.h>
34#include <sys/types.h> 34#include <sys/types.h>
35#include <unistd.h> 35#include <unistd.h>
36 36
37PyQuicklaunchControl::PyQuicklaunchControl( PyQuicklaunchApplet *applet, QWidget *parent, const char *name ) 37PyQuicklaunchControl::PyQuicklaunchControl( PyQuicklaunchApplet *applet, QWidget *parent, const char *name )
38 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) 38 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet )
39{ 39{
40 40
41 setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); 41 setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
42 setFixedSize( sizeHint() ); 42 setFixedSize( sizeHint() );
43 setFocusPolicy( QWidget::NoFocus ); 43 setFocusPolicy( QWidget::NoFocus );
44} 44}
45 45
46 46
@@ -61,50 +61,50 @@ void PyQuicklaunchControl::show( bool )
61void PyQuicklaunchControl::readConfig() 61void PyQuicklaunchControl::readConfig()
62{ 62{
63 Config cfg( "qpe" ); 63 Config cfg( "qpe" );
64 cfg.setGroup( "PyQuicklaunch" ); 64 cfg.setGroup( "PyQuicklaunch" );
65 65
66 // ... 66 // ...
67} 67}
68 68
69void PyQuicklaunchControl::writeConfigEntry( const char *entry, int val ) 69void PyQuicklaunchControl::writeConfigEntry( const char *entry, int val )
70{ 70{
71 Config cfg( "qpe" ); 71 Config cfg( "qpe" );
72 cfg.setGroup( "PyQuicklaunch" ); 72 cfg.setGroup( "PyQuicklaunch" );
73 cfg.writeEntry( entry, val ); 73 cfg.writeEntry( entry, val );
74} 74}
75 75
76//=========================================================================== 76//===========================================================================
77 77
78PyQuicklaunchApplet::PyQuicklaunchApplet( QWidget *parent, const char *name ) 78PyQuicklaunchApplet::PyQuicklaunchApplet( QWidget *parent, const char *name )
79 : QWidget( parent, name ), online( false ) 79 : QWidget( parent, name ), online( false )
80{ 80{
81 setFixedHeight( 18 ); 81 setFixedHeight( 18 );
82 setFixedWidth( 14 ); 82 setFixedWidth( 14 );
83 status = new PyQuicklaunchControl( this, this, "Python Quicklaunch Status" ); 83 status = new PyQuicklaunchControl( this, this, "Python Quicklaunch Status" );
84 84
85 _online = Resource::loadPixmap( "pyquicklaunch/online" ); 85 _online = Opie::Core::OResource::loadPixmap( "pyquicklaunch/online", Opie::Core::OResource::SmallIcon );
86 _offline = Resource::loadPixmap( "pyquicklaunch/offline" ); 86 _offline = Opie::Core::OResource::loadPixmap( "pyquicklaunch/offline", Opie::Core::OResource::SmallIcon );
87 87
88 _fifoName = QString().sprintf( "/tmp/mickeys-quicklauncher-%s", ::getpwuid( ::getuid() )->pw_name ); 88 _fifoName = QString().sprintf( "/tmp/mickeys-quicklauncher-%s", ::getpwuid( ::getuid() )->pw_name );
89 odebug << "PyQuicklaunchApplet fifo name = '" << _fifoName << "'" << oendl; 89 odebug << "PyQuicklaunchApplet fifo name = '" << _fifoName << "'" << oendl;
90 _fifo.setName( _fifoName ); 90 _fifo.setName( _fifoName );
91 91
92 _control = new QCopChannel( "QPE/PyLauncher", parent, "PyLauncher QCop Control Channel" ); 92 _control = new QCopChannel( "QPE/PyLauncher", parent, "PyLauncher QCop Control Channel" );
93 connect( _control, SIGNAL(received(const QCString&,const QByteArray&)), 93 connect( _control, SIGNAL(received(const QCString&,const QByteArray&)),
94 this, SLOT(receivedMessage(const QCString&,const QByteArray&) ) ); 94 this, SLOT(receivedMessage(const QCString&,const QByteArray&) ) );
95 95
96} 96}
97 97
98 98
99PyQuicklaunchApplet::~PyQuicklaunchApplet() 99PyQuicklaunchApplet::~PyQuicklaunchApplet()
100{ 100{
101} 101}
102 102
103 103
104void PyQuicklaunchApplet::receivedMessage( const QCString& msg, const QByteArray& data ) 104void PyQuicklaunchApplet::receivedMessage( const QCString& msg, const QByteArray& data )
105{ 105{
106 odebug << "receivedMessage = '" << msg << "' " << oendl; 106 odebug << "receivedMessage = '" << msg << "' " << oendl;
107 107
108 if ( msg == "setOnline()" ) 108 if ( msg == "setOnline()" )
109 { 109 {
110 online = true; 110 online = true;