author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/applets | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/applets/autorotateapplet/autorotate.cpp | 10 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/swapfile.cpp | 21 | ||||
-rw-r--r-- | noncore/applets/networkapplet/networkapplet.cpp | 16 | ||||
-rw-r--r-- | noncore/applets/notesapplet/config.in | 2 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notes.cpp | 54 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notesapplet.pro | 18 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 44 | ||||
-rw-r--r-- | noncore/applets/zkbapplet/zkbwidget.cpp | 2 |
8 files changed, 89 insertions, 78 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp index ae7fbd0..34802fb 100644 --- a/noncore/applets/autorotateapplet/autorotate.cpp +++ b/noncore/applets/autorotateapplet/autorotate.cpp | |||
@@ -10,22 +10,22 @@ | |||
10 | * * | 10 | * * |
11 | *************************************************************************/ | 11 | *************************************************************************/ |
12 | 12 | ||
13 | #include "autorotate.h" | 13 | #include "autorotate.h" |
14 | 14 | ||
15 | /* OPIE */ | 15 | /* OPIE */ |
16 | #include <opie2/odevice.h> | 16 | #include <opie2/odebug.h> |
17 | #include <opie2/otaskbarapplet.h> | 17 | #include <opie2/otaskbarapplet.h> |
18 | #include <qpe/applnk.h> | 18 | #include <qpe/applnk.h> |
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | using namespace Opie::Core; | ||
21 | 22 | ||
22 | /* QT */ | 23 | /* QT */ |
23 | #include <qpainter.h> | 24 | #include <qpainter.h> |
24 | 25 | ||
25 | using namespace Opie::Ui; | ||
26 | AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) | 26 | AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) |
27 | { | 27 | { |
28 | setFixedWidth( AppLnk::smallIconSize() ); | 28 | setFixedWidth( AppLnk::smallIconSize() ); |
29 | setFixedHeight( AppLnk::smallIconSize() ); | 29 | setFixedHeight( AppLnk::smallIconSize() ); |
30 | 30 | ||
31 | enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) ); | 31 | enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) ); |
@@ -84,14 +84,14 @@ bool AutoRotate::isRotateEnabled() | |||
84 | Config cfg( "qpe" ); | 84 | Config cfg( "qpe" ); |
85 | cfg.setGroup( "Appearance" ); | 85 | cfg.setGroup( "Appearance" ); |
86 | 86 | ||
87 | bool res = cfg.readBoolEntry( "rotateEnabled" ); | 87 | bool res = cfg.readBoolEntry( "rotateEnabled" ); |
88 | 88 | ||
89 | if (res ) | 89 | if (res ) |
90 | qDebug("Enabled"); | 90 | odebug << "Enabled" << oendl; |
91 | else | 91 | else |
92 | qDebug("Disabled"); | 92 | odebug << "Disabled" << oendl; |
93 | return res; | 93 | return res; |
94 | } | 94 | } |
95 | 95 | ||
96 | EXPORT_OPIE_APPLET_v1( AutoRotate ) | 96 | EXPORT_OPIE_APPLET_v1( AutoRotate ) |
97 | 97 | ||
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp index 9416db3..a71078f 100644 --- a/noncore/applets/memoryapplet/swapfile.cpp +++ b/noncore/applets/memoryapplet/swapfile.cpp | |||
@@ -17,12 +17,18 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "swapfile.h" | 21 | #include "swapfile.h" |
22 | 22 | ||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
25 | #include <qpe/resource.h> | ||
26 | using namespace Opie::Core; | ||
27 | |||
28 | /* QT */ | ||
23 | #include <qfile.h> | 29 | #include <qfile.h> |
24 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
25 | #include <qlabel.h> | 31 | #include <qlabel.h> |
26 | #include <qtimer.h> | 32 | #include <qtimer.h> |
27 | #include <qlayout.h> | 33 | #include <qlayout.h> |
28 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
@@ -31,19 +37,18 @@ | |||
31 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
32 | #include <qprogressbar.h> | 38 | #include <qprogressbar.h> |
33 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
34 | #include <qvgroupbox.h> | 40 | #include <qvgroupbox.h> |
35 | #include <qhbox.h> | 41 | #include <qhbox.h> |
36 | #include <qmessagebox.h> | 42 | #include <qmessagebox.h> |
43 | #include <qcopchannel_qws.h> | ||
44 | |||
45 | /* STD */ | ||
37 | #include <stdio.h> | 46 | #include <stdio.h> |
38 | #include <stdlib.h> | 47 | #include <stdlib.h> |
39 | #include <string.h> | 48 | #include <string.h> |
40 | |||
41 | #include <qcopchannel_qws.h> | ||
42 | #include <qpe/resource.h> | ||
43 | |||
44 | #include <unistd.h> | 49 | #include <unistd.h> |
45 | #include <fcntl.h> | 50 | #include <fcntl.h> |
46 | #include <sys/vfs.h> | 51 | #include <sys/vfs.h> |
47 | #include <mntent.h> | 52 | #include <mntent.h> |
48 | #include <unistd.h> | 53 | #include <unistd.h> |
49 | #include <sys/types.h> | 54 | #include <sys/types.h> |
@@ -51,17 +56,17 @@ | |||
51 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) | 56 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) |
52 | : QWidget( parent, name, f ) | 57 | : QWidget( parent, name, f ) |
53 | { | 58 | { |
54 | // are we running as root? | 59 | // are we running as root? |
55 | isRoot = geteuid() == 0; | 60 | isRoot = geteuid() == 0; |
56 | 61 | ||
57 | QVBoxLayout* vb = new QVBoxLayout(this, 5); | 62 | QVBoxLayout* vb = new QVBoxLayout(this, 5); |
58 | 63 | ||
59 | QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); | 64 | QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); |
60 | cfsdRBG->setRadioButtonExclusive(true); | 65 | cfsdRBG->setRadioButtonExclusive(true); |
61 | vb->addWidget(cfsdRBG); | 66 | vb->addWidget(cfsdRBG); |
62 | 67 | ||
63 | ramRB = new QRadioButton(tr("RAM"), cfsdRBG); | 68 | ramRB = new QRadioButton(tr("RAM"), cfsdRBG); |
64 | cfRB = new QRadioButton(tr("CF Card"), cfsdRBG); | 69 | cfRB = new QRadioButton(tr("CF Card"), cfsdRBG); |
65 | sdRB = new QRadioButton(tr("SD Card"), cfsdRBG); | 70 | sdRB = new QRadioButton(tr("SD Card"), cfsdRBG); |
66 | 71 | ||
67 | QHBox *hb1 = new QHBox(this); | 72 | QHBox *hb1 = new QHBox(this); |
@@ -72,13 +77,13 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) | |||
72 | 77 | ||
73 | QPushButton* swapOn = new QPushButton(tr(" On "), hb1); | 78 | QPushButton* swapOn = new QPushButton(tr(" On "), hb1); |
74 | QPushButton* swapOff = new QPushButton(tr(" Off "), hb1); | 79 | QPushButton* swapOff = new QPushButton(tr(" Off "), hb1); |
75 | vb->addWidget(hb1); | 80 | vb->addWidget(hb1); |
76 | 81 | ||
77 | QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this); | 82 | QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this); |
78 | vb->addWidget(box1); | 83 | vb->addWidget(box1); |
79 | 84 | ||
80 | QHBox *hb2 = new QHBox(box1); | 85 | QHBox *hb2 = new QHBox(box1); |
81 | hb2->setSpacing(5); | 86 | hb2->setSpacing(5); |
82 | QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2); | 87 | QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2); |
83 | QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2); | 88 | QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2); |
84 | 89 | ||
@@ -210,13 +215,13 @@ void Swapfile::getStatusPcmcia() | |||
210 | cfRB->setEnabled(FALSE); | 215 | cfRB->setEnabled(FALSE); |
211 | } | 216 | } |
212 | } | 217 | } |
213 | } | 218 | } |
214 | } else { | 219 | } else { |
215 | // no file found | 220 | // no file found |
216 | qDebug("no file found"); | 221 | odebug << "no file found" << oendl; |
217 | cardInPcmcia0 = FALSE; | 222 | cardInPcmcia0 = FALSE; |
218 | cardInPcmcia1 = FALSE; | 223 | cardInPcmcia1 = FALSE; |
219 | } | 224 | } |
220 | Swapfile::cfsdchecked(); | 225 | Swapfile::cfsdchecked(); |
221 | } | 226 | } |
222 | 227 | ||
diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp index 5eb5ad2..534a8d0 100644 --- a/noncore/applets/networkapplet/networkapplet.cpp +++ b/noncore/applets/networkapplet/networkapplet.cpp | |||
@@ -33,23 +33,25 @@ | |||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | #include <opie2/onetwork.h> | 35 | #include <opie2/onetwork.h> |
36 | #include <opie2/otaskbarapplet.h> | 36 | #include <opie2/otaskbarapplet.h> |
37 | #include <qpe/applnk.h> | 37 | #include <qpe/applnk.h> |
38 | #include <qpe/resource.h> | 38 | #include <qpe/resource.h> |
39 | #include <qpainter.h> | 39 | using namespace Opie::Core; |
40 | using namespace Opie::Ui; | ||
41 | using namespace Opie::Net; | ||
40 | 42 | ||
41 | /* QT */ | 43 | /* QT */ |
44 | #include <qpainter.h> | ||
42 | #include <qlabel.h> | 45 | #include <qlabel.h> |
43 | #include <qlayout.h> | 46 | #include <qlayout.h> |
44 | #include <qobjectlist.h> | 47 | #include <qobjectlist.h> |
45 | 48 | ||
49 | /* STD */ | ||
46 | #include <assert.h> | 50 | #include <assert.h> |
47 | 51 | ||
48 | using namespace Opie::Ui; | ||
49 | using namespace Opie::Net; | ||
50 | IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name ) | 52 | IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name ) |
51 | :QToolButton( parent, name ) | 53 | :QToolButton( parent, name ) |
52 | { | 54 | { |
53 | _iface = ONetwork::instance()->interface( name ); | 55 | _iface = ONetwork::instance()->interface( name ); |
54 | assert( _iface ); | 56 | assert( _iface ); |
55 | setToggleButton( true ); | 57 | setToggleButton( true ); |
@@ -164,21 +166,21 @@ QString NetworkAppletControl::guessDevice( ONetworkInterface* iface ) | |||
164 | 166 | ||
165 | } | 167 | } |
166 | 168 | ||
167 | 169 | ||
168 | void NetworkAppletControl::showEvent( QShowEvent* e ) | 170 | void NetworkAppletControl::showEvent( QShowEvent* e ) |
169 | { | 171 | { |
170 | qDebug( "showEvent" ); | 172 | odebug << "showEvent" << oendl; |
171 | build(); | 173 | build(); |
172 | QWidget::showEvent( e ); | 174 | QWidget::showEvent( e ); |
173 | } | 175 | } |
174 | 176 | ||
175 | 177 | ||
176 | void NetworkAppletControl::hideEvent( QHideEvent* e ) | 178 | void NetworkAppletControl::hideEvent( QHideEvent* e ) |
177 | { | 179 | { |
178 | qDebug( "hideEvent" ); | 180 | odebug << "hideEvent" << oendl; |
179 | QWidget::hideEvent( e ); | 181 | QWidget::hideEvent( e ); |
180 | 182 | ||
181 | delete l; | 183 | delete l; |
182 | 184 | ||
183 | // delete all child widgets from this frame | 185 | // delete all child widgets from this frame |
184 | QObjectList* list = const_cast<QObjectList*>( children() ); | 186 | QObjectList* list = const_cast<QObjectList*>( children() ); |
@@ -189,24 +191,24 @@ void NetworkAppletControl::hideEvent( QHideEvent* e ) | |||
189 | ++it; | 191 | ++it; |
190 | delete obj; | 192 | delete obj; |
191 | } | 193 | } |
192 | 194 | ||
193 | list = const_cast<QObjectList*>( children() ); | 195 | list = const_cast<QObjectList*>( children() ); |
194 | if ( list ) | 196 | if ( list ) |
195 | qWarning( "D'oh! We still have %d children...", list->count() ); | 197 | owarn << "D'oh! We still have " << list->count() << " children..." << oendl; |
196 | 198 | ||
197 | // renew layout | 199 | // renew layout |
198 | l = new QVBoxLayout( this, 4, 2 ); | 200 | l = new QVBoxLayout( this, 4, 2 ); |
199 | resize( 0, 0 ); | 201 | resize( 0, 0 ); |
200 | } | 202 | } |
201 | 203 | ||
202 | 204 | ||
203 | QSize NetworkAppletControl::sizeHint() const | 205 | QSize NetworkAppletControl::sizeHint() const |
204 | { | 206 | { |
205 | ONetwork::instance()->synchronize(); // rebuild interface database | 207 | ONetwork::instance()->synchronize(); // rebuild interface database |
206 | qDebug( "sizeHint (#ifaces=%d)", ONetwork::instance()->count() ); | 208 | odebug << "sizeHint (#ifaces=" << ONetwork::instance()->count() << ")" << oendl; |
207 | return QSize( 14+35+105+14 + 8, ONetwork::instance()->count() * 26 ); | 209 | return QSize( 14+35+105+14 + 8, ONetwork::instance()->count() * 26 ); |
208 | } | 210 | } |
209 | 211 | ||
210 | 212 | ||
211 | NetworkApplet::NetworkApplet( QWidget *parent, const char *name ) | 213 | NetworkApplet::NetworkApplet( QWidget *parent, const char *name ) |
212 | :OTaskbarApplet( parent, name ) | 214 | :OTaskbarApplet( parent, name ) |
diff --git a/noncore/applets/notesapplet/config.in b/noncore/applets/notesapplet/config.in index 27a8187..c92c1d5 100644 --- a/noncore/applets/notesapplet/config.in +++ b/noncore/applets/notesapplet/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config NOTESAPPLET | 1 | config NOTESAPPLET |
2 | boolean "opie-notesapplet (quick note taking applet)" | 2 | boolean "opie-notesapplet (quick note taking applet)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp index 13f7cf3..b3e72a7 100644 --- a/noncore/applets/notesapplet/notes.cpp +++ b/noncore/applets/notesapplet/notes.cpp | |||
@@ -12,44 +12,46 @@ | |||
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 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "notes.h" | 16 | #include "notes.h" |
17 | 17 | ||
18 | #include <qapplication.h> | 18 | /* OPIE */ |
19 | #include <stdlib.h> | 19 | #include <opie2/odebug.h> |
20 | #include <qstringlist.h> | ||
21 | |||
22 | #include <opie2/otaskbarapplet.h> | 20 | #include <opie2/otaskbarapplet.h> |
23 | #include <qpe/filemanager.h> | 21 | #include <qpe/filemanager.h> |
24 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/timestring.h> | 23 | #include <qpe/timestring.h> |
26 | #include <qpe/applnk.h> | 24 | #include <qpe/applnk.h> |
27 | #include <qpe/ir.h> | 25 | #include <qpe/ir.h> |
28 | #include <qpe/config.h> | 26 | #include <qpe/config.h> |
27 | using namespace Opie::Core; | ||
28 | using namespace Opie::Ui; | ||
29 | 29 | ||
30 | // #include <qsocket.h> | 30 | /* QT */ |
31 | // #include <qclipboard.h> | ||
32 | #include <qmultilineedit.h> | 31 | #include <qmultilineedit.h> |
33 | #include <qlistbox.h> | 32 | #include <qlistbox.h> |
34 | #include <qpopupmenu.h> | 33 | #include <qpopupmenu.h> |
35 | #include <qmessagebox.h> | 34 | #include <qmessagebox.h> |
36 | 35 | #include <qapplication.h> | |
37 | #include <qdir.h> | 36 | #include <qdir.h> |
38 | #include <qfile.h> | 37 | #include <qfile.h> |
39 | #include <qpoint.h> | 38 | #include <qpoint.h> |
40 | #include <qpushbutton.h> | 39 | #include <qpushbutton.h> |
41 | #include <qpainter.h> | 40 | #include <qpainter.h> |
42 | #include <qlayout.h> | 41 | #include <qlayout.h> |
43 | #include <qframe.h> | 42 | #include <qframe.h> |
44 | #include <qpixmap.h> | 43 | #include <qpixmap.h> |
45 | #include <qstring.h> | 44 | #include <qstring.h> |
45 | #include <qstringlist.h> | ||
46 | #include <qtimer.h> | 46 | #include <qtimer.h> |
47 | 47 | ||
48 | /* STD */ | ||
49 | #include <stdlib.h> | ||
50 | |||
48 | /* XPM */ | 51 | /* XPM */ |
49 | using namespace Opie::Ui; | ||
50 | static char * notes_xpm[] = { | 52 | static char * notes_xpm[] = { |
51 | "16 16 11 1", | 53 | "16 16 11 1", |
52 | " c None", | 54 | " c None", |
53 | ". c #000000", | 55 | ". c #000000", |
54 | "+ c #7F7F7F", | 56 | "+ c #7F7F7F", |
55 | "@ c #BFBFBF", | 57 | "@ c #BFBFBF", |
@@ -81,15 +83,15 @@ static char * notes_xpm[] = { | |||
81 | NotesControl::NotesControl( QWidget *, const char * ) | 83 | NotesControl::NotesControl( QWidget *, const char * ) |
82 | : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop ) | 84 | : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop ) |
83 | // : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) | 85 | // : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) |
84 | { | 86 | { |
85 | QDir d( QDir::homeDirPath()+"/notes"); | 87 | QDir d( QDir::homeDirPath()+"/notes"); |
86 | if( !d.exists()) { | 88 | if( !d.exists()) { |
87 | qDebug("make dir"); | 89 | odebug << "make dir" << oendl; |
88 | if(!d.mkdir( QDir::homeDirPath()+"/notes", true)) | 90 | if(!d.mkdir( QDir::homeDirPath()+"/notes", true)) |
89 | qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed"); | 91 | odebug << "<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed" << oendl; |
90 | } | 92 | } |
91 | Config cfg("Notes"); | 93 | Config cfg("Notes"); |
92 | cfg.setGroup("Options"); | 94 | cfg.setGroup("Options"); |
93 | showMax = cfg.readBoolEntry("ShowMax", false); | 95 | showMax = cfg.readBoolEntry("ShowMax", false); |
94 | 96 | ||
95 | setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); | 97 | setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); |
@@ -162,43 +164,43 @@ void NotesControl::slotDeleteButtonClicked() { | |||
162 | }; | 164 | }; |
163 | } | 165 | } |
164 | 166 | ||
165 | void NotesControl::slotDeleteButton() { | 167 | void NotesControl::slotDeleteButton() { |
166 | 168 | ||
167 | QString selectedText = box->currentText(); | 169 | QString selectedText = box->currentText(); |
168 | qDebug("deleting "+selectedText); | 170 | odebug << "deleting "+selectedText << oendl; |
169 | 171 | ||
170 | if( !selectedText.isEmpty()) { | 172 | if( !selectedText.isEmpty()) { |
171 | 173 | ||
172 | Config cfg("Notes"); | 174 | Config cfg("Notes"); |
173 | cfg.setGroup("Docs"); | 175 | cfg.setGroup("Docs"); |
174 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); | 176 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
175 | QString entryName, entryName2;; | 177 | QString entryName, entryName2;; |
176 | for ( int i = 0; i < noOfFiles; i++ ) { | 178 | for ( int i = 0; i < noOfFiles; i++ ) { |
177 | entryName.sprintf( "File%i", i + 1 ); | 179 | entryName.sprintf( "File%i", i + 1 ); |
178 | if(selectedText == cfg.readEntry( entryName )) { | 180 | if(selectedText == cfg.readEntry( entryName )) { |
179 | qDebug("removing %s, %d", selectedText.latin1(), i); | 181 | odebug << "removing " << selectedText.latin1() << ", " << i << "" << oendl; |
180 | for ( int j = i; j < noOfFiles; j++ ) { | 182 | for ( int j = i; j < noOfFiles; j++ ) { |
181 | entryName.sprintf( "File%i", i + 1 ); | 183 | entryName.sprintf( "File%i", i + 1 ); |
182 | entryName2.sprintf( "File%i", i + 2 ); | 184 | entryName2.sprintf( "File%i", i + 2 ); |
183 | QString temp = cfg.readEntry(entryName2); | 185 | QString temp = cfg.readEntry(entryName2); |
184 | qDebug("move "+temp); | 186 | odebug << "move "+temp << oendl; |
185 | cfg.writeEntry(entryName, temp); | 187 | cfg.writeEntry(entryName, temp); |
186 | i++; | 188 | i++; |
187 | } | 189 | } |
188 | cfg.writeEntry("NumberOfFiles", noOfFiles-1 ); | 190 | cfg.writeEntry("NumberOfFiles", noOfFiles-1 ); |
189 | entryName.sprintf( "File%i", noOfFiles ); | 191 | entryName.sprintf( "File%i", noOfFiles ); |
190 | cfg.removeEntry(entryName); | 192 | cfg.removeEntry(entryName); |
191 | cfg.write(); | 193 | cfg.write(); |
192 | DocLnk nf(selectedText); | 194 | DocLnk nf(selectedText); |
193 | nf.removeFiles(); | 195 | nf.removeFiles(); |
194 | QString fi=QPEApplication::documentDir()+"/text/plain/"+selectedText+".desktop"; | 196 | QString fi=QPEApplication::documentDir()+"/text/plain/"+selectedText+".desktop"; |
195 | qDebug(fi); | 197 | odebug << fi << oendl; |
196 | 198 | ||
197 | QFile f( fi); | 199 | QFile f( fi); |
198 | if( !f.remove()) qDebug(".desktop file not removed"); | 200 | if( !f.remove()) odebug << ".desktop file not removed" << oendl; |
199 | 201 | ||
200 | } | 202 | } |
201 | } | 203 | } |
202 | view->clear(); | 204 | view->clear(); |
203 | 205 | ||
204 | populateBox(); | 206 | populateBox(); |
@@ -280,13 +282,13 @@ void NotesControl::focusOutEvent ( QFocusEvent * e) { | |||
280 | } | 282 | } |
281 | 283 | ||
282 | void NotesControl::save() { | 284 | void NotesControl::save() { |
283 | Config cfg("Notes"); | 285 | Config cfg("Notes"); |
284 | cfg.setGroup("Docs"); | 286 | cfg.setGroup("Docs"); |
285 | if( edited) { | 287 | if( edited) { |
286 | // qDebug("is edited"); | 288 | // odebug << "is edited" << oendl; |
287 | QString rt = view->text(); | 289 | QString rt = view->text(); |
288 | if( rt.length()>1) { | 290 | if( rt.length()>1) { |
289 | QString pt = rt.simplifyWhiteSpace(); | 291 | QString pt = rt.simplifyWhiteSpace(); |
290 | int i = pt.find( ' ', pt.find( ' ' )+2 ); | 292 | int i = pt.find( ' ', pt.find( ' ' )+2 ); |
291 | QString docname = pt; | 293 | QString docname = pt; |
292 | if ( i > 0 ) | 294 | if ( i > 0 ) |
@@ -298,51 +300,51 @@ void NotesControl::save() { | |||
298 | // cut the length. filenames longer than that don't make sense | 300 | // cut the length. filenames longer than that don't make sense |
299 | // and something goes wrong when they get too long. | 301 | // and something goes wrong when they get too long. |
300 | if ( docname.length() > 40 ) | 302 | if ( docname.length() > 40 ) |
301 | docname = docname.left(40); | 303 | docname = docname.left(40); |
302 | if ( docname.isEmpty() ) | 304 | if ( docname.isEmpty() ) |
303 | docname = "Empty Text"; | 305 | docname = "Empty Text"; |
304 | // qDebug(docname); | 306 | // odebug << docname << oendl; |
305 | 307 | ||
306 | if( oldDocName != docname) { | 308 | if( oldDocName != docname) { |
307 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); | 309 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
308 | QString entryName; | 310 | QString entryName; |
309 | entryName.sprintf( "File%i", noOfFiles + 1 ); | 311 | entryName.sprintf( "File%i", noOfFiles + 1 ); |
310 | cfg.writeEntry( entryName,docname ); | 312 | cfg.writeEntry( entryName,docname ); |
311 | cfg.writeEntry("NumberOfFiles", noOfFiles+1 ); | 313 | cfg.writeEntry("NumberOfFiles", noOfFiles+1 ); |
312 | cfg.write(); | 314 | cfg.write(); |
313 | } | 315 | } |
314 | // else | 316 | // else |
315 | // qDebug("oldname equals docname"); | 317 | // odebug << "oldname equals docname" << oendl; |
316 | 318 | ||
317 | doc = new DocLnk(docname); | 319 | doc = new DocLnk(docname); |
318 | if(QFile(doc->linkFile()).exists()) | 320 | if(QFile(doc->linkFile()).exists()) |
319 | qDebug("puppie"); | 321 | odebug << "puppie" << oendl; |
320 | doc->setType("text/plain"); | 322 | doc->setType("text/plain"); |
321 | doc->setName(docname); | 323 | doc->setName(docname); |
322 | QString temp = docname.replace( QRegExp(" "), "_" ); | 324 | QString temp = docname.replace( QRegExp(" "), "_" ); |
323 | doc->setFile( QDir::homeDirPath()+"/notes/"+temp); | 325 | doc->setFile( QDir::homeDirPath()+"/notes/"+temp); |
324 | FileManager fm; | 326 | FileManager fm; |
325 | if ( !fm.saveFile( *doc, rt ) ) { | 327 | if ( !fm.saveFile( *doc, rt ) ) { |
326 | } | 328 | } |
327 | 329 | ||
328 | oldDocName=docname; | 330 | oldDocName=docname; |
329 | edited=false; | 331 | edited=false; |
330 | // qDebug("save"); | 332 | // odebug << "save" << oendl; |
331 | if (doPopulate) | 333 | if (doPopulate) |
332 | populateBox(); | 334 | populateBox(); |
333 | } | 335 | } |
334 | cfg.writeEntry( "LastDoc",oldDocName ); | 336 | cfg.writeEntry( "LastDoc",oldDocName ); |
335 | cfg.write(); | 337 | cfg.write(); |
336 | 338 | ||
337 | } | 339 | } |
338 | } | 340 | } |
339 | 341 | ||
340 | void NotesControl::populateBox() { | 342 | void NotesControl::populateBox() { |
341 | box->clear(); | 343 | box->clear(); |
342 | // qDebug("populate"); | 344 | // odebug << "populate" << oendl; |
343 | Config cfg("Notes"); | 345 | Config cfg("Notes"); |
344 | cfg.setGroup("Docs"); | 346 | cfg.setGroup("Docs"); |
345 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); | 347 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
346 | QStringList list; | 348 | QStringList list; |
347 | QString entryName; | 349 | QString entryName; |
348 | for ( int i = 0; i < noOfFiles; i++ ) { | 350 | for ( int i = 0; i < noOfFiles; i++ ) { |
@@ -371,13 +373,13 @@ void NotesControl::load() { | |||
371 | cfg.writeEntry( "LastDoc",oldDocName ); | 373 | cfg.writeEntry( "LastDoc",oldDocName ); |
372 | cfg.write(); | 374 | cfg.write(); |
373 | } | 375 | } |
374 | } | 376 | } |
375 | 377 | ||
376 | void NotesControl::load(const QString & file) { | 378 | void NotesControl::load(const QString & file) { |
377 | qDebug("loading "+file); | 379 | odebug << "loading "+file << oendl; |
378 | QString name = file; | 380 | QString name = file; |
379 | QString temp; | 381 | QString temp; |
380 | if( !QFile( QDir::homeDirPath()+"/"+file).exists() ) | 382 | if( !QFile( QDir::homeDirPath()+"/"+file).exists() ) |
381 | temp = QDir::homeDirPath()+"/notes/"+ name.replace( QRegExp(" "), "_" ); | 383 | temp = QDir::homeDirPath()+"/notes/"+ name.replace( QRegExp(" "), "_" ); |
382 | else | 384 | else |
383 | temp = name; | 385 | temp = name; |
@@ -398,13 +400,13 @@ void NotesControl::load(const QString & file) { | |||
398 | } | 400 | } |
399 | 401 | ||
400 | void NotesControl::loadDoc( const DocLnk &f) { | 402 | void NotesControl::loadDoc( const DocLnk &f) { |
401 | FileManager fm; | 403 | FileManager fm; |
402 | QString txt; | 404 | QString txt; |
403 | if ( !fm.loadFile( f, txt ) ) { | 405 | if ( !fm.loadFile( f, txt ) ) { |
404 | qDebug("could not load file "+f.file()); | 406 | odebug << "could not load file "+f.file() << oendl; |
405 | return; | 407 | return; |
406 | } | 408 | } |
407 | view->setText(txt); | 409 | view->setText(txt); |
408 | } | 410 | } |
409 | 411 | ||
410 | void NotesControl::slotViewEdited() { | 412 | void NotesControl::slotViewEdited() { |
@@ -432,13 +434,13 @@ void NotesControl::slotSearch() { | |||
432 | 434 | ||
433 | // void NotesControl::keyReleaseEvent( QKeyEvent *e) { | 435 | // void NotesControl::keyReleaseEvent( QKeyEvent *e) { |
434 | 436 | ||
435 | // switch ( e->state() ) { | 437 | // switch ( e->state() ) { |
436 | // case ControlButton: | 438 | // case ControlButton: |
437 | // if(e->key() == Key_C) { //copy | 439 | // if(e->key() == Key_C) { //copy |
438 | // qDebug("copy"); | 440 | // odebug << "copy" << oendl; |
439 | // QClipboard *cb = QApplication::clipboard(); | 441 | // QClipboard *cb = QApplication::clipboard(); |
440 | // QString text; | 442 | // QString text; |
441 | 443 | ||
442 | // // Copy text from the clipboard (paste) | 444 | // // Copy text from the clipboard (paste) |
443 | // text = cb->text(); | 445 | // text = cb->text(); |
444 | // } | 446 | // } |
@@ -479,16 +481,16 @@ void NotesApplet::mousePressEvent( QMouseEvent *) { | |||
479 | vc->save(); | 481 | vc->save(); |
480 | vc->close(); | 482 | vc->close(); |
481 | } else { | 483 | } else { |
482 | // vc = new NotesControl; | 484 | // vc = new NotesControl; |
483 | // QPoint curPos = mapToGlobal( rect().topLeft() ); | 485 | // QPoint curPos = mapToGlobal( rect().topLeft() ); |
484 | if(vc->showMax) { | 486 | if(vc->showMax) { |
485 | qDebug("show max"); | 487 | odebug << "show max" << oendl; |
486 | vc->showMaximized(); | 488 | vc->showMaximized(); |
487 | } else { | 489 | } else { |
488 | qDebug("no show max"); | 490 | odebug << "no show max" << oendl; |
489 | QWidget *wid = QPEApplication::desktop(); | 491 | QWidget *wid = QPEApplication::desktop(); |
490 | QRect rect = QApplication::desktop()->geometry(); | 492 | QRect rect = QApplication::desktop()->geometry(); |
491 | vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180); | 493 | vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180); |
492 | vc->move ( (rect.center()/2) - (vc->rect().center()/2)); | 494 | vc->move ( (rect.center()/2) - (vc->rect().center()/2)); |
493 | // vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28); | 495 | // vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28); |
494 | } | 496 | } |
diff --git a/noncore/applets/notesapplet/notesapplet.pro b/noncore/applets/notesapplet/notesapplet.pro index 44e5b34..c3f9b1c 100644 --- a/noncore/applets/notesapplet/notesapplet.pro +++ b/noncore/applets/notesapplet/notesapplet.pro | |||
@@ -1,12 +1,12 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt plugin warn_on | 2 | CONFIG += qt plugin warn_on |
3 | HEADERS = notes.h | 3 | HEADERS = notes.h |
4 | SOURCES = notes.cpp | 4 | SOURCES = notes.cpp |
5 | TARGET = notesapplet | 5 | TARGET = notesapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe -lopiecore2 |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.1 |
11 | 11 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 12 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp index 0491a86..364f3ad 100644 --- a/noncore/applets/wirelessapplet/wireless.cpp +++ b/noncore/applets/wirelessapplet/wireless.cpp | |||
@@ -13,16 +13,20 @@ | |||
13 | 13 | ||
14 | #include "wireless.h" | 14 | #include "wireless.h" |
15 | #include "mgraph.h" | 15 | #include "mgraph.h" |
16 | #include "advancedconfig.h" | 16 | #include "advancedconfig.h" |
17 | 17 | ||
18 | /* OPIE */ | 18 | /* OPIE */ |
19 | #include <opie2/odebug.h> | ||
19 | #include <opie2/onetwork.h> | 20 | #include <opie2/onetwork.h> |
20 | #include <opie2/otaskbarapplet.h> | 21 | #include <opie2/otaskbarapplet.h> |
21 | #include <qpe/config.h> | 22 | #include <qpe/config.h> |
22 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | using namespace Opie::Core; | ||
25 | using namespace Opie::Ui; | ||
26 | using namespace Opie::Net; | ||
23 | 27 | ||
24 | /* QT */ | 28 | /* QT */ |
25 | #include <qradiobutton.h> | 29 | #include <qradiobutton.h> |
26 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
27 | #include <qpainter.h> | 31 | #include <qpainter.h> |
28 | #include <qlabel.h> | 32 | #include <qlabel.h> |
@@ -40,14 +44,12 @@ | |||
40 | #define round qRound | 44 | #define round qRound |
41 | #endif | 45 | #endif |
42 | 46 | ||
43 | //#define MDEBUG | 47 | //#define MDEBUG |
44 | #undef MDEBUG | 48 | #undef MDEBUG |
45 | 49 | ||
46 | using namespace Opie::Ui; | ||
47 | using namespace Opie::Net; | ||
48 | WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) | 50 | WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) |
49 | : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) | 51 | : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) |
50 | { | 52 | { |
51 | 53 | ||
52 | readConfig(); | 54 | readConfig(); |
53 | writeConfigEntry( "UpdateFrequency", updateFrequency ); | 55 | writeConfigEntry( "UpdateFrequency", updateFrequency ); |
@@ -204,72 +206,72 @@ void WirelessApplet::checkInterface() | |||
204 | if ( it.current() && it.current()->isWireless() ) | 206 | if ( it.current() && it.current()->isWireless() ) |
205 | interface = static_cast<OWirelessNetworkInterface*>( it.current() ); | 207 | interface = static_cast<OWirelessNetworkInterface*>( it.current() ); |
206 | 208 | ||
207 | if ( interface ) | 209 | if ( interface ) |
208 | { | 210 | { |
209 | #ifdef MDEBUG | 211 | #ifdef MDEBUG |
210 | qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->name() ); | 212 | odebug << "WIFIAPPLET: using interface '" << ( const char* ) interface->name() << "'" << oendl; |
211 | #endif | 213 | #endif |
212 | 214 | ||
213 | } | 215 | } |
214 | else | 216 | else |
215 | { | 217 | { |
216 | #ifdef MDEBUG | 218 | #ifdef MDEBUG |
217 | qDebug( "WIFIAPPLET: D'oh! No Wireless interface present... :(" ); | 219 | odebug << "WIFIAPPLET: D'oh! No Wireless interface present... :(" << oendl; |
218 | #endif | 220 | #endif |
219 | hide(); | 221 | hide(); |
220 | } | 222 | } |
221 | } | 223 | } |
222 | 224 | ||
223 | void WirelessApplet::renewDHCP() | 225 | void WirelessApplet::renewDHCP() |
224 | { | 226 | { |
225 | #ifdef MDEBUG | 227 | #ifdef MDEBUG |
226 | qDebug( "WIFIAPPLET: Going to request a DHCP configuration renew." ); | 228 | odebug << "WIFIAPPLET: Going to request a DHCP configuration renew." << oendl; |
227 | #endif | 229 | #endif |
228 | 230 | ||
229 | QString pidfile; | 231 | QString pidfile; |
230 | if ( !interface ) | 232 | if ( !interface ) |
231 | return ; | 233 | return ; |
232 | QString ifacename( interface->name() ); | 234 | QString ifacename( interface->name() ); |
233 | 235 | ||
234 | // At first we are trying dhcpcd | 236 | // At first we are trying dhcpcd |
235 | 237 | ||
236 | pidfile.sprintf( "/var/run/dhcpcd-%s.pid", ( const char* ) ifacename ); | 238 | pidfile.sprintf( "/var/run/dhcpcd-%s.pid", ( const char* ) ifacename ); |
237 | #ifdef MDEBUG | 239 | #ifdef MDEBUG |
238 | qDebug( "WIFIAPPLET: dhcpcd pidfile is '%s'", ( const char* ) pidfile ); | 240 | odebug << "WIFIAPPLET: dhcpcd pidfile is '" << ( const char* ) pidfile << "'" << oendl; |
239 | #endif | 241 | #endif |
240 | int pid; | 242 | int pid; |
241 | QFile pfile( pidfile ); | 243 | QFile pfile( pidfile ); |
242 | bool hasFile = pfile.open( IO_ReadOnly ); | 244 | bool hasFile = pfile.open( IO_ReadOnly ); |
243 | QTextStream s( &pfile ); | 245 | QTextStream s( &pfile ); |
244 | if ( hasFile ) | 246 | if ( hasFile ) |
245 | { | 247 | { |
246 | s >> pid; | 248 | s >> pid; |
247 | #ifdef MDEBUG | 249 | #ifdef MDEBUG |
248 | qDebug( "WIFIAPPLET: sent SIGALARM to pid %d", pid ); | 250 | odebug << "WIFIAPPLET: sent SIGALARM to pid " << pid << "" << oendl; |
249 | #endif | 251 | #endif |
250 | kill( pid, SIGALRM ); | 252 | kill( pid, SIGALRM ); |
251 | return ; | 253 | return ; |
252 | } | 254 | } |
253 | 255 | ||
254 | // No dhcpcd, so we are trying udhcpc | 256 | // No dhcpcd, so we are trying udhcpc |
255 | #ifdef MDEBUG | 257 | #ifdef MDEBUG |
256 | qDebug( "WIFIAPPLET: dhcpcd not available." ); | 258 | odebug << "WIFIAPPLET: dhcpcd not available." << oendl; |
257 | #endif | 259 | #endif |
258 | pidfile.sprintf( "/var/run/udhcpc.%s.pid", ( const char* ) ifacename ); | 260 | pidfile.sprintf( "/var/run/udhcpc.%s.pid", ( const char* ) ifacename ); |
259 | #ifdef MDEBUG | 261 | #ifdef MDEBUG |
260 | qDebug( "WIFIAPPLET: udhcpc pidfile is '%s'", ( const char* ) pidfile ); | 262 | odebug << "WIFIAPPLET: udhcpc pidfile is '" << ( const char* ) pidfile << "'" << oendl; |
261 | #endif | 263 | #endif |
262 | QFile pfile2( pidfile ); | 264 | QFile pfile2( pidfile ); |
263 | hasFile = pfile2.open( IO_ReadOnly ); | 265 | hasFile = pfile2.open( IO_ReadOnly ); |
264 | QTextStream s2( &pfile2 ); | 266 | QTextStream s2( &pfile2 ); |
265 | if ( hasFile ) | 267 | if ( hasFile ) |
266 | { | 268 | { |
267 | s2 >> pid; | 269 | s2 >> pid; |
268 | #ifdef MDEBUG | 270 | #ifdef MDEBUG |
269 | qDebug( "WIFIAPPLET: sent SIGUSR1 to pid %d", pid ); | 271 | odebug << "WIFIAPPLET: sent SIGUSR1 to pid " << pid << "" << oendl; |
270 | #endif | 272 | #endif |
271 | kill( pid, SIGUSR1 ); | 273 | kill( pid, SIGUSR1 ); |
272 | return ; | 274 | return ; |
273 | } | 275 | } |
274 | } | 276 | } |
275 | 277 | ||
@@ -300,30 +302,30 @@ void WirelessApplet::displayStyleChange( int style ) | |||
300 | WirelessApplet::~WirelessApplet() | 302 | WirelessApplet::~WirelessApplet() |
301 | {} | 303 | {} |
302 | 304 | ||
303 | void WirelessApplet::timerEvent( QTimerEvent* ) | 305 | void WirelessApplet::timerEvent( QTimerEvent* ) |
304 | { | 306 | { |
305 | #ifdef MDEBUG | 307 | #ifdef MDEBUG |
306 | qDebug( "WirelessApplet::timerEvent" ); | 308 | odebug << "WirelessApplet::timerEvent" << oendl; |
307 | #endif | 309 | #endif |
308 | if ( interface ) | 310 | if ( interface ) |
309 | { | 311 | { |
310 | if ( !ONetwork::instance()->isPresent( (const char*) interface->name() ) ) | 312 | if ( !ONetwork::instance()->isPresent( (const char*) interface->name() ) ) |
311 | { | 313 | { |
312 | #ifdef MDEBUG | 314 | #ifdef MDEBUG |
313 | qDebug( "WIFIAPPLET: Interface no longer present." ); | 315 | odebug << "WIFIAPPLET: Interface no longer present." << oendl; |
314 | #endif | 316 | #endif |
315 | interface = 0L; | 317 | interface = 0L; |
316 | mustRepaint(); | 318 | mustRepaint(); |
317 | return; | 319 | return; |
318 | } | 320 | } |
319 | 321 | ||
320 | if ( mustRepaint() ) | 322 | if ( mustRepaint() ) |
321 | { | 323 | { |
322 | #ifdef MDEBUG | 324 | #ifdef MDEBUG |
323 | qDebug( "WIFIAPPLET: A value has changed -> repainting." ); | 325 | odebug << "WIFIAPPLET: A value has changed -> repainting." << oendl; |
324 | #endif | 326 | #endif |
325 | repaint(); | 327 | repaint(); |
326 | } | 328 | } |
327 | 329 | ||
328 | if ( status->isVisible() ) | 330 | if ( status->isVisible() ) |
329 | { | 331 | { |
@@ -353,20 +355,20 @@ bool WirelessApplet::mustRepaint() | |||
353 | if ( interface != oldiface ) | 355 | if ( interface != oldiface ) |
354 | { | 356 | { |
355 | oldiface = interface; | 357 | oldiface = interface; |
356 | if ( interface ) | 358 | if ( interface ) |
357 | { | 359 | { |
358 | #ifdef MDEBUG | 360 | #ifdef MDEBUG |
359 | qDebug( "WIFIAPPLET: We had no interface but now we have one! :-)" ); | 361 | odebug << "WIFIAPPLET: We had no interface but now we have one! :-)" << oendl; |
360 | #endif | 362 | #endif |
361 | show(); | 363 | show(); |
362 | } | 364 | } |
363 | else | 365 | else |
364 | { | 366 | { |
365 | #ifdef MDEBUG | 367 | #ifdef MDEBUG |
366 | qDebug( "WIFIAPPLET: We had a interface but now we don't have one! ;-(" ); | 368 | odebug << "WIFIAPPLET: We had a interface but now we don't have one! ;-(" << oendl; |
367 | #endif | 369 | #endif |
368 | hide(); | 370 | hide(); |
369 | return true; | 371 | return true; |
370 | } | 372 | } |
371 | } | 373 | } |
372 | 374 | ||
@@ -392,34 +394,34 @@ bool WirelessApplet::mustRepaint() | |||
392 | return true; | 394 | return true; |
393 | } | 395 | } |
394 | 396 | ||
395 | if ( rocESSID && ( oldESSID != interface->SSID() ) ) | 397 | if ( rocESSID && ( oldESSID != interface->SSID() ) ) |
396 | { | 398 | { |
397 | #ifdef MDEBUG | 399 | #ifdef MDEBUG |
398 | qDebug( "WIFIAPPLET: ESSID has changed." ); | 400 | odebug << "WIFIAPPLET: ESSID has changed." << oendl; |
399 | #endif | 401 | #endif |
400 | renewDHCP(); | 402 | renewDHCP(); |
401 | } | 403 | } |
402 | else if ( rocFREQ && ( oldFREQ != interface->frequency() ) ) | 404 | else if ( rocFREQ && ( oldFREQ != interface->frequency() ) ) |
403 | { | 405 | { |
404 | #ifdef MDEBUG | 406 | #ifdef MDEBUG |
405 | qDebug( "WIFIAPPLET: FREQ has changed." ); | 407 | odebug << "WIFIAPPLET: FREQ has changed." << oendl; |
406 | #endif | 408 | #endif |
407 | renewDHCP(); | 409 | renewDHCP(); |
408 | } | 410 | } |
409 | else if ( rocAP && ( oldAP != interface->associatedAP().toString() ) ) | 411 | else if ( rocAP && ( oldAP != interface->associatedAP().toString() ) ) |
410 | { | 412 | { |
411 | #ifdef MDEBUG | 413 | #ifdef MDEBUG |
412 | qDebug( "WIFIAPPLET: AP has changed." ); | 414 | odebug << "WIFIAPPLET: AP has changed." << oendl; |
413 | #endif | 415 | #endif |
414 | renewDHCP(); | 416 | renewDHCP(); |
415 | } | 417 | } |
416 | else if ( rocMODE && ( oldMODE != interface->mode() ) ) | 418 | else if ( rocMODE && ( oldMODE != interface->mode() ) ) |
417 | { | 419 | { |
418 | #ifdef MDEBUG | 420 | #ifdef MDEBUG |
419 | qDebug( "WIFIAPPLET: MODE has changed." ); | 421 | odebug << "WIFIAPPLET: MODE has changed." << oendl; |
420 | #endif | 422 | #endif |
421 | renewDHCP(); | 423 | renewDHCP(); |
422 | } | 424 | } |
423 | 425 | ||
424 | oldESSID = interface->SSID(); | 426 | oldESSID = interface->SSID(); |
425 | oldMODE = interface->mode(); | 427 | oldMODE = interface->mode(); |
@@ -447,13 +449,13 @@ void WirelessApplet::updatePopupWindow() | |||
447 | } | 449 | } |
448 | 450 | ||
449 | int WirelessApplet::numberOfRings() | 451 | int WirelessApplet::numberOfRings() |
450 | { | 452 | { |
451 | if ( !interface ) return -1; | 453 | if ( !interface ) return -1; |
452 | int qualityH = interface->signalStrength(); | 454 | int qualityH = interface->signalStrength(); |
453 | qDebug( "quality = %d", qualityH ); | 455 | odebug << "quality = " << qualityH << "" << oendl; |
454 | if ( qualityH < 1 ) return -1; | 456 | if ( qualityH < 1 ) return -1; |
455 | if ( qualityH < 20 ) return 0; | 457 | if ( qualityH < 20 ) return 0; |
456 | if ( qualityH < 40 ) return 1; | 458 | if ( qualityH < 40 ) return 1; |
457 | if ( qualityH < 60 ) return 2; | 459 | if ( qualityH < 60 ) return 2; |
458 | if ( qualityH < 65 ) return 3; | 460 | if ( qualityH < 65 ) return 3; |
459 | return 4; | 461 | return 4; |
@@ -478,13 +480,13 @@ void WirelessApplet::paintEvent( QPaintEvent* ) | |||
478 | p.setPen( QPen( QColor( 200, 20, 20 ), 2 ) ); | 480 | p.setPen( QPen( QColor( 200, 20, 20 ), 2 ) ); |
479 | p.drawLine( w/2-m-m, h/2-m-m, w/2+m+m, h/2+m+m ); | 481 | p.drawLine( w/2-m-m, h/2-m-m, w/2+m+m, h/2+m+m ); |
480 | p.drawLine( w/2+m+m, h/2-m-m, w/2-m-m, h/2+m+m ); | 482 | p.drawLine( w/2+m+m, h/2-m-m, w/2-m-m, h/2+m+m ); |
481 | return; | 483 | return; |
482 | } | 484 | } |
483 | 485 | ||
484 | qDebug( "WirelessApplet: painting %d rings", rings ); | 486 | odebug << "WirelessApplet: painting " << rings << " rings" << oendl; |
485 | int radius = 2; | 487 | int radius = 2; |
486 | int rstep = 4; | 488 | int rstep = 4; |
487 | int maxrings = w/rstep; | 489 | int maxrings = w/rstep; |
488 | 490 | ||
489 | p.setPen( QColor( 200, 20, 20 ) ); | 491 | p.setPen( QColor( 200, 20, 20 ) ); |
490 | for ( int i = 0; i < rings; ++i ) | 492 | for ( int i = 0; i < rings; ++i ) |
diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp index 3acff1e..13d554c 100644 --- a/noncore/applets/zkbapplet/zkbwidget.cpp +++ b/noncore/applets/zkbapplet/zkbwidget.cpp | |||
@@ -91,13 +91,13 @@ bool ZkbWidget::loadKeymap() { | |||
91 | 91 | ||
92 | QSize ZkbWidget::sizeHint() const { | 92 | QSize ZkbWidget::sizeHint() const { |
93 | return QSize(AppLnk::smallIconSize(),AppLnk::smallIconSize()); | 93 | return QSize(AppLnk::smallIconSize(),AppLnk::smallIconSize()); |
94 | } | 94 | } |
95 | 95 | ||
96 | void ZkbWidget::stateChanged(const QString& s) { | 96 | void ZkbWidget::stateChanged(const QString& s) { |
97 | //qDebug("stateChanged: %s\n", (const char*) s.utf8()); | 97 | //odebug << "stateChanged: " << (const char*) s.utf8() << "\n" << oendl; |
98 | setText(s); | 98 | setText(s); |
99 | } | 99 | } |
100 | 100 | ||
101 | void ZkbWidget::labelChanged(int id) { | 101 | void ZkbWidget::labelChanged(int id) { |
102 | if (id == 0) { | 102 | if (id == 0) { |
103 | keymap->disable(); | 103 | keymap->disable(); |