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/memoryapplet/swapfile.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/applets/memoryapplet/swapfile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/memoryapplet/swapfile.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
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 | |||
@@ -15,72 +15,77 @@ | |||
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 "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> |
29 | #include <qhbuttongroup.h> | 35 | #include <qhbuttongroup.h> |
30 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
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> |
50 | 55 | ||
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); |
68 | hb1->setSpacing(5); | 73 | hb1->setSpacing(5); |
69 | 74 | ||
70 | swapPath1 = new QLineEdit(hb1); | 75 | swapPath1 = new QLineEdit(hb1); |
71 | swapPath1->setEnabled(false); | 76 | swapPath1->setEnabled(false); |
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 | ||
85 | QHBox *hb3 = new QHBox(box1); | 90 | QHBox *hb3 = new QHBox(box1); |
86 | hb3->setSpacing(5); | 91 | hb3->setSpacing(5); |
@@ -208,17 +213,17 @@ void Swapfile::getStatusPcmcia() | |||
208 | } else { | 213 | } else { |
209 | cfRB->setChecked(FALSE); | 214 | cfRB->setChecked(FALSE); |
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 | ||
223 | 228 | ||
224 | void Swapfile::getStatusSd() | 229 | void Swapfile::getStatusSd() |