author | ar <ar> | 2004-02-21 19:09:12 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-21 19:09:12 (UTC) |
commit | c7e563cbb26c20807e66dd4284d1ce9cbf8e1419 (patch) (side-by-side diff) | |
tree | e55119af88abe930c1ce492f30efb72c929a730c | |
parent | 536f271b1e6a1d1886e96a28524a3503c4c38c4e (diff) | |
download | opie-c7e563cbb26c20807e66dd4284d1ce9cbf8e1419.zip opie-c7e563cbb26c20807e66dd4284d1ce9cbf8e1419.tar.gz opie-c7e563cbb26c20807e66dd4284d1ce9cbf8e1419.tar.bz2 |
improve support for BigScreen
-rw-r--r-- | noncore/tools/formatter/formatter.cpp | 174 | ||||
-rw-r--r-- | noncore/tools/opie-sh/opie-sh.cpp | 20 | ||||
-rw-r--r-- | noncore/tools/remote/learntab.cpp | 11 | ||||
-rw-r--r-- | noncore/tools/remote/remote.cpp | 10 |
4 files changed, 138 insertions, 77 deletions
diff --git a/noncore/tools/formatter/formatter.cpp b/noncore/tools/formatter/formatter.cpp index 532ee40..e869317 100644 --- a/noncore/tools/formatter/formatter.cpp +++ b/noncore/tools/formatter/formatter.cpp @@ -12,3 +12,3 @@ -#include <qmenubar.h> +/* OPIE */ #include <qpe/qpetoolbar.h> @@ -21,2 +21,4 @@ +/* QT */ +#include <qmenubar.h> #include <qmultilineedit.h> @@ -27,5 +29,3 @@ #include <qfile.h> - #include <qtstream.h> - #include <qcombobox.h> @@ -34,3 +34,2 @@ #include <qregexp.h> - #include <qlabel.h> @@ -43,2 +42,3 @@ +/* STD */ #include <unistd.h> @@ -170,7 +170,7 @@ FormatterApp::FormatterApp( QWidget* parent, const char* name, WFlags fl, bool -FormatterApp::~FormatterApp() { - -} +FormatterApp::~FormatterApp() +{} -void FormatterApp::doFormat() { +void FormatterApp::doFormat() +{ int err=0; @@ -192,3 +192,4 @@ void FormatterApp::doFormat() { - if( currentText.find("CF",0,TRUE) != -1) { + if( currentText.find("CF",0,TRUE) != -1) + { umountS = "umount "; @@ -199,3 +200,4 @@ void FormatterApp::doFormat() { } - if( currentText.find("SD",0,TRUE) != -1) { + if( currentText.find("SD",0,TRUE) != -1) + { umountS = "umount "; @@ -213,4 +215,6 @@ void FormatterApp::doFormat() { ,1 - ,1) ) { - case 0: { + ,1) ) + { + case 0: + { if(fs == "vfat") @@ -219,3 +223,4 @@ void FormatterApp::doFormat() { cmd = "mke2fs -v " + diskDevice+" 2>&1"; - else { + else + { QMessageBox::warning(this, tr("Formatter"),tr("Could not format.\nUnknown type"), tr("Ok")); @@ -225,4 +230,3 @@ void FormatterApp::doFormat() { outDlg = new Output(this, tr("Formatter Output"),FALSE); - outDlg->showMaximized(); - outDlg->show(); + QPEApplication::showDialog( outDlg); qApp->processEvents(); @@ -239,3 +243,4 @@ void FormatterApp::doFormat() { // qDebug("%d", fp); - if ( !fp ) { + if ( !fp ) + { qDebug("Could not execute '" + umountS + "'! err=%d\n" +(QString)strerror(errno), err); @@ -244,7 +249,11 @@ void FormatterApp::doFormat() { return; - } else { + } + else + { // outDlg->OutputEdit->append( currentText + tr("\nhas been successfully umounted.")); // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); - while ( fgets( line, sizeof line, fp)) { - if( ((QString)line).find("busy",0,TRUE) != -1) { + while ( fgets( line, sizeof line, fp)) + { + if( ((QString)line).find("busy",0,TRUE) != -1) + { qDebug("Could not find '" + umountS); @@ -253,3 +262,5 @@ void FormatterApp::doFormat() { return; - } else { + } + else + { QString lineStr = line; @@ -268,4 +279,6 @@ void FormatterApp::doFormat() { fp = popen( (const char *) cmd, "r"); - while ( fgets( line, sizeof line, fp)) { - if( ((QString)line).find("No such device",0,TRUE) != -1) { + while ( fgets( line, sizeof line, fp)) + { + if( ((QString)line).find("No such device",0,TRUE) != -1) + { qDebug("No such device '" + umountS); @@ -276,3 +289,5 @@ void FormatterApp::doFormat() { return; - } else { + } + else + { QString lineStr = line; @@ -290,3 +305,4 @@ void FormatterApp::doFormat() { fp = popen( (const char *) remountS, "r"); - if ( !fp) { + if ( !fp) + { qDebug("Could not execute '" + remountS + "'! err=%d\n" +(QString)strerror(errno), err); @@ -294,5 +310,8 @@ void FormatterApp::doFormat() { - } else { + } + else + { outDlg->OutputEdit->append(tr("%1\nhas been successfully mounted.").arg( currentText )); - while ( fgets( line, sizeof line, fp)) { + while ( fgets( line, sizeof line, fp)) + { QString lineStr = line; @@ -316,3 +335,4 @@ void FormatterApp::doFormat() { -bool FormatterApp::doFdisk() { +bool FormatterApp::doFdisk() +{ return FALSE; @@ -321,3 +341,4 @@ bool FormatterApp::doFdisk() { -void FormatterApp::fillCombos() { +void FormatterApp::fillCombos() +{ @@ -327,3 +348,4 @@ void FormatterApp::fillCombos() { QString storage; - for( ; it.current(); ++it ){ + for( ; it.current(); ++it ) + { const QString name = (*it)->name(); @@ -332,3 +354,4 @@ void FormatterApp::fillCombos() { const QString options = (*it)->options(); - if( name.find( tr("Internal"),0,TRUE) == -1) { + if( name.find( tr("Internal"),0,TRUE) == -1) + { storageComboBox->insertItem(name +" -> "+disk); @@ -346,7 +369,7 @@ void FormatterApp::fillCombos() { -void FormatterApp::fsComboSelected(int ) { +void FormatterApp::fsComboSelected(int ) +{} -} - -void FormatterApp::storageComboSelected(int index ) { +void FormatterApp::storageComboSelected(int index ) +{ @@ -360,3 +383,4 @@ void FormatterApp::storageComboSelected(int index ) { // qDebug(fsType); - for(int i = 0; i < fileSystemsCombo->count(); i++) { + for(int i = 0; i < fileSystemsCombo->count(); i++) + { if( fsType == fileSystemsCombo->text(i)) @@ -367,3 +391,4 @@ void FormatterApp::storageComboSelected(int index ) { -void FormatterApp::deviceComboSelected(int index) { +void FormatterApp::deviceComboSelected(int index) +{ @@ -377,3 +402,4 @@ void FormatterApp::deviceComboSelected(int index) { QString storage; - for( ; it.current(); ++it ){ + for( ; it.current(); ++it ) + { const QString name = (*it)->name(); @@ -382,3 +408,4 @@ void FormatterApp::deviceComboSelected(int index) { // const QString options = (*it)->options(); - if( selectedText == disk) { + if( selectedText == disk) + { diskS = disk; nameS= name; @@ -407,8 +434,8 @@ void FormatterApp::deviceComboSelected(int index) { -void FormatterApp::cleanUp() { - -} +void FormatterApp::cleanUp() +{} -void FormatterApp::editFstab() { +void FormatterApp::editFstab() +{ QCopEnvelope e("QPE/Application/textedit","setDocument(QString)"); @@ -417,3 +444,4 @@ void FormatterApp::editFstab() { -void FormatterApp::parsetab(const QString &fileName) { +void FormatterApp::parsetab(const QString &fileName) +{ @@ -424,7 +452,10 @@ void FormatterApp::parsetab(const QString &fileName) { FILE *mntfp = setmntent( fileName.latin1(), "r" ); - if ( mntfp ) { - while ( (me = getmntent( mntfp )) != 0 ) { + if ( mntfp ) + { + while ( (me = getmntent( mntfp )) != 0 ) + { QString deviceName = me->mnt_fsname; QString filesystemType = me->mnt_type; - if(deviceName != "none") { + if(deviceName != "none") + { if( fsList.contains(filesystemType) == 0 @@ -466,3 +497,4 @@ void FormatterApp::parsetab(const QString &fileName) { -QString FormatterApp::getFileSystemType(const QString ¤tText) { +QString FormatterApp::getFileSystemType(const QString ¤tText) +{ @@ -470,5 +502,7 @@ QString FormatterApp::getFileSystemType(const QString ¤tText) { - for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) { + for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) + { QString temp = (*it); - if( temp.find( currentText,0,TRUE) != -1) { + if( temp.find( currentText,0,TRUE) != -1) + { return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); @@ -480,3 +514,4 @@ QString FormatterApp::getFileSystemType(const QString ¤tText) { -bool FormatterApp::doFsck() { +bool FormatterApp::doFsck() +{ @@ -506,4 +541,3 @@ bool FormatterApp::doFsck() { outDlg = new Output(this, tr("Formatter Output"),FALSE); - outDlg->showMaximized(); - outDlg->show(); + QPEApplication::showDialog( outDlg ); qApp->processEvents(); @@ -518,3 +552,4 @@ bool FormatterApp::doFsck() { // qDebug("%d", fp); - if ( !fp ) { + if ( !fp ) + { qDebug("Could not execute '" + umountS + "'!\n" +(QString)strerror(errno)); @@ -523,7 +558,11 @@ bool FormatterApp::doFsck() { return false; - } else { + } + else + { // outDlg->OutputEdit->append( currentText + tr("\nhas been successfully umounted.")); // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); - while ( fgets( line, sizeof line, fp)) { - if( ((QString)line).find("busy",0,TRUE) != -1) { + while ( fgets( line, sizeof line, fp)) + { + if( ((QString)line).find("busy",0,TRUE) != -1) + { qDebug("Could not find '" + umountS); @@ -533,3 +572,5 @@ bool FormatterApp::doFsck() { return false; - } else { + } + else + { QString lineStr = line; @@ -544,4 +585,6 @@ bool FormatterApp::doFsck() { fp = popen( (const char *) cmd, "r"); - while ( fgets( line, sizeof line, fp)) { - if( ((QString)line).find("No such device",0,TRUE) != -1) { + while ( fgets( line, sizeof line, fp)) + { + if( ((QString)line).find("No such device",0,TRUE) != -1) + { qDebug("No such device '" + umountS); @@ -552,3 +595,5 @@ bool FormatterApp::doFsck() { return false; - } else { + } + else + { QString lineStr = line; @@ -570,3 +615,4 @@ bool FormatterApp::doFsck() { -bool FormatterApp::doFsckCheck() { +bool FormatterApp::doFsckCheck() +{ @@ -575,3 +621,4 @@ bool FormatterApp::doFsckCheck() { -int FormatterApp::formatCheck(const QString &) { +int FormatterApp::formatCheck(const QString &) +{ @@ -580,3 +627,4 @@ int FormatterApp::formatCheck(const QString &) { -int FormatterApp::runCommand(const QString &) { +int FormatterApp::runCommand(const QString &) +{ diff --git a/noncore/tools/opie-sh/opie-sh.cpp b/noncore/tools/opie-sh/opie-sh.cpp index a353d3f..7d54a03 100644 --- a/noncore/tools/opie-sh/opie-sh.cpp +++ b/noncore/tools/opie-sh/opie-sh.cpp @@ -16,5 +16,13 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +#include "mbox.h" +#include "fviewer.h" +#include "inputdialog.h" + +/* OPIE */ +#include <qpe/qpeapplication.h> + +/* QT */ #include <qstring.h> #include <qstringlist.h> -#include <qpe/qpeapplication.h> #include <qmessagebox.h> @@ -22,7 +30,5 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +/* STD */ #include <stdio.h> -#include "mbox.h" -#include "fviewer.h" -#include "inputdialog.h" @@ -86,3 +92,3 @@ int myMessageBox(int wi, int h, QWidget *w, int argc, QStringList args) w->setCaption(title); - w->showMaximized(); + QPEApplication::showWidget( w ); } @@ -163,3 +169,3 @@ int fileviewer(QPEApplication *a, int argc, QStringList args) a->setMainWidget(fview); - fview->showMaximized(); + QPEApplication::showWidget( fview ); return a->exec(); @@ -227,3 +233,3 @@ int input(int wi, int h, QWidget *w, int argc, QStringList args) w->setCaption(title); - w->showMaximized(); + QPEApplication::showWidget( w ); } diff --git a/noncore/tools/remote/learntab.cpp b/noncore/tools/remote/learntab.cpp index 7582161..335a3e9 100644 --- a/noncore/tools/remote/learntab.cpp +++ b/noncore/tools/remote/learntab.cpp @@ -18,2 +18,5 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +/* OPIE */ +#include <qpe/qpeapplication.h> + LearnTab::LearnTab(QWidget *parent, const char *name):QWidget(parent,name) @@ -52,3 +55,3 @@ void LearnTab::add() RecordDialog *dialog = new RecordDialog(this); - dialog->showMaximized(); + QPEApplication::showDialog( dialog ); } @@ -56,8 +59,6 @@ void LearnTab::add() void LearnTab::edit() -{ -} +{} void LearnTab::del() -{ -} +{} diff --git a/noncore/tools/remote/remote.cpp b/noncore/tools/remote/remote.cpp index 7972def..638629f 100644 --- a/noncore/tools/remote/remote.cpp +++ b/noncore/tools/remote/remote.cpp @@ -16,2 +16,5 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#include "mainview.h" + +/* OPIE */ #include <qpe/qpeapplication.h> @@ -19,2 +22,4 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include <qpe/config.h> + +/* QT */ #include <qpushbutton.h> @@ -25,2 +30,4 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include <qobject.h> + +/* STD */ #include <sys/socket.h> @@ -32,3 +39,2 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#include "mainview.h" @@ -97,3 +103,3 @@ int main( int argc, char **argv ) w.setIRSocket(fd); - w.showMaximized(); + QPEApplication::showWidget( &w ); return a.exec(); |