summaryrefslogtreecommitdiff
path: root/noncore/applets/memoryapplet/swapfile.cpp
Side-by-side diff
Diffstat (limited to 'noncore/applets/memoryapplet/swapfile.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp
index a71078f..96010c8 100644
--- a/noncore/applets/memoryapplet/swapfile.cpp
+++ b/noncore/applets/memoryapplet/swapfile.cpp
@@ -54,97 +54,97 @@ using namespace Opie::Core;
#include <sys/types.h>
Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
: QWidget( parent, name, f )
{
// are we running as root?
isRoot = geteuid() == 0;
QVBoxLayout* vb = new QVBoxLayout(this, 5);
QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this);
cfsdRBG->setRadioButtonExclusive(true);
vb->addWidget(cfsdRBG);
ramRB = new QRadioButton(tr("RAM"), cfsdRBG);
cfRB = new QRadioButton(tr("CF Card"), cfsdRBG);
sdRB = new QRadioButton(tr("SD Card"), cfsdRBG);
QHBox *hb1 = new QHBox(this);
hb1->setSpacing(5);
swapPath1 = new QLineEdit(hb1);
swapPath1->setEnabled(false);
QPushButton* swapOn = new QPushButton(tr(" On "), hb1);
QPushButton* swapOff = new QPushButton(tr(" Off "), hb1);
vb->addWidget(hb1);
QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this);
vb->addWidget(box1);
QHBox *hb2 = new QHBox(box1);
hb2->setSpacing(5);
QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2);
QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2);
QHBox *hb3 = new QHBox(box1);
hb3->setSpacing(5);
swapSize = new QComboBox(hb3);
swapSize->insertStringList(QStringList::split(",", tr("2 Mb,4 Mb,6 Mb,8 Mb")));
mkswapProgress = new QProgressBar(3, hb3);
mkswapProgress->setCenterIndicator(true);
QHBox *hb4 = new QHBox(this);
hb4->setSpacing(5);
swapStatusIcon = new QLabel(hb4);
- swapStatus = new QLabel(tr(""), hb4);
+ swapStatus = new QLabel("", hb4);
hb4->setStretchFactor(swapStatus, 99);
vb->addWidget(hb4);
connect(swapOn, SIGNAL(clicked()), this, SLOT(swapon()));
connect(swapOff, SIGNAL(clicked()), this, SLOT(swapoff()));
connect(cfRB, SIGNAL(clicked()), this, SLOT(cfsdchecked()));
connect(sdRB, SIGNAL(clicked()), this, SLOT(cfsdchecked()));
connect(ramRB, SIGNAL(clicked()), this, SLOT(cfsdchecked()));
connect(mkSwap, SIGNAL(clicked()), this, SLOT(makeswapfile()));
connect(rmSwap, SIGNAL(clicked()), this, SLOT(removeswapfile()));
cfRB->setEnabled(FALSE);
sdRB->setEnabled(FALSE);
QCopChannel *pcmciaChannel = new QCopChannel("QPE/Card", this);
connect(pcmciaChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(cardnotify(const QCString&,const QByteArray&)));
QCopChannel *sdChannel = new QCopChannel("QPE/Card", this);
connect(sdChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(cardnotify(const QCString&,const QByteArray&)));
cardInPcmcia0 = FALSE;
cardInPcmcia1 = FALSE;
cardInSd = FALSE;
Swapfile::status();
Swapfile::getStatusPcmcia();
Swapfile::getStatusSd();
}
int Swapfile::exec(const QString& arg)
{
return system((!isRoot ? "sudo " : "") + arg);
}
Swapfile::~Swapfile()
{
}
void Swapfile::cardnotify(const QCString & msg, const QByteArray &)
{
if (msg == "stabChanged()")
{
getStatusPcmcia();
}
else if (msg == "mtabChanged()")
{
getStatusSd();
}