summaryrefslogtreecommitdiff
path: root/noncore/applets/memoryapplet/swapfile.cpp
Side-by-side diff
Diffstat (limited to 'noncore/applets/memoryapplet/swapfile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp
index 96010c8..4609c13 100644
--- a/noncore/applets/memoryapplet/swapfile.cpp
+++ b/noncore/applets/memoryapplet/swapfile.cpp
@@ -81,25 +81,25 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
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")));
+ swapSize->insertStringList(QStringList::split(",", tr("2 Mb,4 Mb,6 Mb,8 Mb,16 Mb,32 Mb,64 Mb")));
mkswapProgress = new QProgressBar(3, hb3);
mkswapProgress->setCenterIndicator(true);
QHBox *hb4 = new QHBox(this);
hb4->setSpacing(5);
swapStatusIcon = new QLabel(hb4);
swapStatus = new QLabel("", hb4);
hb4->setStretchFactor(swapStatus, 99);
vb->addWidget(hb4);
@@ -334,24 +334,31 @@ void Swapfile::makeswapfile()
int i = swapSize->currentItem();
mkswapProgress->setProgress(1);
switch ( i ) {
case 0: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=2048").arg(swapPath1->text()));
break;
case 1: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=4096").arg(swapPath1->text()));
break;
case 2: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=6144").arg(swapPath1->text()));
break;
case 3: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=8192").arg(swapPath1->text()));
break;
+ case 4: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=16384").arg(swapPath1->text()));
+ break;
+ case 5: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=32768").arg(swapPath1->text()));
+ break;
+ case 6: rc=exec(QString("dd if=/dev/zero of=%1 bs=1k count=65536").arg(swapPath1->text()));
+ break;
+
}
if (rc != 0) {
setStatusMessage(tr("Failed to create swapfile."), true);
}
mkswapProgress->setProgress(2);
rc=exec(QString("mkswap %1").arg(swapPath1->text()));
if (rc != 0) {
setStatusMessage(tr("Failed to initialize swapfile."), true);
}
mkswapProgress->setProgress(3);
mkswapProgress->reset();
@@ -422,18 +429,24 @@ void Swapfile::status()
swapsize /=1000;
switch ( swapsize ) {
case 2: swapSize->setCurrentItem(0);
break;
case 4: swapSize->setCurrentItem(1);
break;
case 6: swapSize->setCurrentItem(2);
break;
case 8: swapSize->setCurrentItem(3);
break;
+ case 16: swapSize->setCurrentItem(4);
+ break;
+ case 32: swapSize->setCurrentItem(5);
+ break;
+ case 64: swapSize->setCurrentItem(6);
+ break;
}
}