-rw-r--r-- | noncore/applets/memoryapplet/config.in | 6 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/opie-memoryapplet.control | 2 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/swapfile.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/noncore/applets/memoryapplet/config.in b/noncore/applets/memoryapplet/config.in index a35e35d..a06f888 100644 --- a/noncore/applets/memoryapplet/config.in +++ b/noncore/applets/memoryapplet/config.in @@ -1,6 +1,6 @@ config MEMORYAPPLET boolean "opie-memoryapplet (view memory status and manage a swap file)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && SYSINFO - comment "opie-memoryapplet needs a libqpe, libopie2ui and sysinfo" - depends ! ( LIBOPIE && SYSINFO ) + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && SYSINFO + comment "opie-memoryapplet needs a libqpe, libopie2core, libopie2ui and sysinfo" + depends ! (( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && SYSINFO) diff --git a/noncore/applets/memoryapplet/opie-memoryapplet.control b/noncore/applets/memoryapplet/opie-memoryapplet.control index c01a93f..40f1ec1 100644 --- a/noncore/applets/memoryapplet/opie-memoryapplet.control +++ b/noncore/applets/memoryapplet/opie-memoryapplet.control @@ -1,10 +1,10 @@ Package: opie-memoryapplet Files: plugins/applets/libmemoryapplet.so* pics/memory Priority: optional Section: opie/applets Maintainer: Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> Architecture: arm -Depends: task-opie-minimal, libopieui2 +Depends: task-opie-minimal, libopiecore2, libopieui2 Description: Memory Applet This applet displays the amount of free memory and manages the swap partition Version: $QPE_VERSION$EXTRAVERSION diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp index 50c173b..cd16d6d 100644 --- a/noncore/applets/memoryapplet/swapfile.cpp +++ b/noncore/applets/memoryapplet/swapfile.cpp @@ -1,74 +1,74 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** Copyright (C) 2002-2005 the Opie Team <opie-devel@handhelds.org> ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "swapfile.h" /* OPIE */ #include <opie2/odebug.h> -#include <qpe/resource.h> +#include <opie2/oresource.h> using namespace Opie::Core; /* QT */ #include <qfile.h> #include <qtextstream.h> #include <qlabel.h> #include <qtimer.h> #include <qlayout.h> #include <qpushbutton.h> #include <qhbuttongroup.h> #include <qradiobutton.h> #include <qlineedit.h> #include <qprogressbar.h> #include <qcombobox.h> #include <qvgroupbox.h> #include <qhbox.h> #include <qmessagebox.h> #include <qcopchannel_qws.h> /* STD */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <sys/vfs.h> #include <mntent.h> #include <unistd.h> #include <sys/types.h> Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) : QWidget( parent, name, f ) { if ( !QFile::exists( "/proc/swaps" ) ) { QLabel *text = new QLabel( tr( "Swap disabled in kernel" ), this ); return; } // 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); @@ -248,97 +248,97 @@ void Swapfile::getStatusSd() if (fs.left(14) == "/dev/mmc/part1" || fs.left(7) == "/dev/sd" || fs.left(9) == "/dev/mmcd") { cardInSd = TRUE; show(); } } endmntent(mntfp); } if (cardWas != cardInSd) { QString text = QString::null; QString what = QString::null; if (cardInSd) { sdRB->setEnabled(TRUE); } else { sdRB->setChecked(FALSE); sdRB->setEnabled(FALSE); } } #else #error "Not on Linux" #endif Swapfile::cfsdchecked(); } int rc=0; void Swapfile::swapon() { char swapcmd[128] ="swapon "; Swapfile::cfsdchecked(); strcat(swapcmd,swapPath1->text()); char *runcmd = swapcmd; rc = exec(QString("%1").arg(runcmd)); if (rc != 0) { setStatusMessage("Failed to attach swapfile.", true); } else { /* QMessageBox::information(this, "Information", "Swapfile is active!"); */ setStatusMessage("Swapfile activated."); } Swapfile::status(); } void Swapfile::setStatusMessage(const QString& text, bool error /* = false */) { swapStatus->setText("<b>" + text + "</b>"); - swapStatusIcon->setPixmap(Resource::loadPixmap(error ? "close" : "done")); + swapStatusIcon->setPixmap(Opie::Core::OResource::loadPixmap(error ? "close" : "done", Opie::Core::OResource::SmallIcon)); } void Swapfile::swapoff() { char swapcmd[128] ="swapoff "; if (Swapfile::cfRB->isChecked() == TRUE) Swapfile::cfsdchecked(); strcat(swapcmd,swapPath1->text()); char *runcmd = swapcmd; rc = exec(QString("%1").arg(runcmd)); if (rc != 0) { setStatusMessage(tr("Failed to detach swapfile."), true); } else { /* QMessageBox::information(this, "Information", "Swapfile is inactive!"); */ setStatusMessage(tr("Swapfile deactivated.")); /* Swapfile::swapPath->clear();*/ } Swapfile::status(); } void Swapfile::cfsdchecked() { /* Swapfile::swapPath->clear();*/ Swapfile::swapPath1->clear(); if (Swapfile::ramRB->isChecked() == TRUE) { Swapfile::swapPath1->insert("/home/swapfile"); } if (Swapfile::sdRB->isChecked() == TRUE) { Swapfile::swapPath1->insert("/mnt/card/swapfile"); } if (Swapfile::cfRB->isChecked() == TRUE) { Swapfile::swapPath1->insert("/mnt/cf/swapfile"); } /* Swapfile::swapPath->insert(Swapfile::swapPath1->text());*/ } 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())); |