summaryrefslogtreecommitdiff
path: root/noncore/apps
Side-by-side diff
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp7
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp38
2 files changed, 32 insertions, 13 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index feda198..95e619b 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -1,88 +1,93 @@
/***************************************************************************
advancedfmData.cpp
-------------------
** Created: Mon 09-23-2002 13:24:11
copyright : (C) 2002 by ljp
email : ljp@llornkcor.com
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "advancedfm.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/oresource.h>
#include <qpe/applnk.h>
#include <qpe/storage.h>
#include <qpe/qpeapplication.h>
#include <qpe/menubutton.h>
using namespace Opie::Core;
using namespace Opie::Ui;
/* QT */
+#include <qframe.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qmenubar.h>
#include <qcombobox.h>
#include <qtoolbutton.h>
#include <qlineedit.h>
#include <qlistview.h>
/* STD */
#include <sys/utsname.h>
void AdvancedFm::init() {
b = false;
setCaption( tr( "AdvancedFm" ) );
- QVBoxLayout *layout = new QVBoxLayout( this );
+// QFrame* frame = new QFrame(this);
+// setCentralWidget(frame);
+// QVBoxLayout *layout = new QVBoxLayout( frame );
+
+ QVBoxLayout *layout = new QVBoxLayout( this);
layout->setSpacing( 2);
layout->setMargin( 0); // squeeze
QMenuBar *menuBar = new QMenuBar(this);
menuBar->setMargin( 0 ); // squeeze
fileMenu = new QPopupMenu( this );
viewMenu = new QPopupMenu( this );
// customDirMenu = new QPopupMenu( this );
layout->addWidget( menuBar );
menuBar->insertItem( tr( "File" ), fileMenu);
menuBar->insertItem( tr( "View" ), viewMenu);
bool useBigIcon = qApp->desktop()->size().width() > 330;
cdUpButton = new QToolButton( 0,"cdUpButton");
cdUpButton->setUsesBigPixmap( useBigIcon );
cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) );
cdUpButton->setAutoRaise( true );
menuBar->insertItem( cdUpButton );
qpeDirButton= new QToolButton( 0,"QPEButton");
qpeDirButton->setUsesBigPixmap( useBigIcon );
qpeDirButton->setPixmap( Opie::Core::OResource::loadPixmap( "logo/opielogo", Opie::Core::OResource::SmallIcon ) );
qpeDirButton->setAutoRaise( true );
menuBar->insertItem( qpeDirButton );
cfButton = new QToolButton( 0, "CFButton");
cfButton->setUsesBigPixmap( useBigIcon );
cfButton->setPixmap( Opie::Core::OResource::loadPixmap( "pcmcia", Opie::Core::OResource::SmallIcon ) );
cfButton->setAutoRaise( true );
menuBar->insertItem( cfButton );
sdButton = new QToolButton( 0, "SDButton");
sdButton->setUsesBigPixmap( useBigIcon );
sdButton->setPixmap( Opie::Core::OResource::loadPixmap( "advancedfm/sdcard", Opie::Core::OResource::SmallIcon ) );
sdButton->setAutoRaise( true );
menuBar->insertItem( sdButton );
docButton = new QToolButton( 0,"docsButton");
docButton->setUsesBigPixmap( useBigIcon );
docButton->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) );
docButton->setAutoRaise( true );
menuBar->insertItem( docButton );
homeButton = new QToolButton( 0, "homeButton");
homeButton->setUsesBigPixmap( useBigIcon );
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 80324eb..ed280aa 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -608,109 +608,123 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
void AdvancedFm::runCommand() {
if( !CurrentView()->currentItem()) return;
QDir *thisDir = CurrentDir();
QString curFile;
curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0);
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
fileDlg->setInputText(curFile);
fileDlg->exec();
//QString command;
if( fileDlg->result() == 1 ) {
// odebug << fileDlg->LineEdit1->text() << oendl;
QStringList command;
command << "/bin/sh";
command << "-c";
command << fileDlg->LineEdit1->text();
Output *outDlg;
outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
QPEApplication::execDialog( outDlg );
qApp->processEvents();
}
}
void AdvancedFm::runCommandStd() {
if( !CurrentView()->currentItem()) return;
QString curFile;
QDir *thisDir = CurrentDir();
QListView *thisView = CurrentView();
if( thisView->currentItem())
curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0);
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
fileDlg->setInputText(curFile);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
qApp->processEvents();
startProcess( (const QString)fileDlg->LineEdit1->text().latin1());
}
}
void AdvancedFm::fileStatus() {
- if( !CurrentView()->currentItem()) return;
- QString curFile;
- curFile = CurrentView()->currentItem()->text(0);
-
- QStringList command;
- command << "/bin/sh";
- command << "-c";
- command << "stat -l "+ curFile;
+ if( !CurrentView()->currentItem()) return;
+ QString curFile;
+ curFile = CurrentView()->currentItem()->text(0);
+ if(QFileInfo("/usr/bin/stat").exists()) {
+ QStringList command;
+ command << "/bin/sh";
+ command << "-c";
+ command << "stat -l "+ curFile;
+ Output *outDlg;
+ outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
+ QPEApplication::execDialog( outDlg );
+ } else {
+/* struct stat buf;
+ stat( curFile.local8bit(), &buf);
+
+ st_dev dev;
+ st_uid uid;
+ st_gid gid;
+ st_size size;
+ st_atime atime;
+ st_mtime mtime;
+ st_ctime ctime;
+ st_mode mode;
+*/
+ }
- Output *outDlg;
- outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
- QPEApplication::execDialog( outDlg );
- qApp->processEvents();
+ qApp->processEvents();
}
void AdvancedFm::mkDir() {
makeDir();
}
void AdvancedFm::rn() {
renameIt();
}
void AdvancedFm::del() {
doDelete();
}
void AdvancedFm::mkSym() {
QString cmd;
QStringList curFileList = getPath();
if( curFileList.count() > 0) {
QDir *thisDir = CurrentDir();
QDir * thatDir = OtherDir();
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
QString destName = thatDir->canonicalPath()+"/"+(*it);
if(destName.right(1) == "/") {
destName = destName.left( destName.length() -1);
}
QString curFile = thisDir->canonicalPath()+"/"+(*it);
if( curFile.right(1) == "/") {
curFile = curFile.left( curFile.length() -1);
}
cmd = "ln -s "+curFile+" "+destName;
// odebug << cmd << oendl;
startProcess( (const QString)cmd );
}
rePopulate();
setOtherTabCurrent();
}
}
void AdvancedFm::doBeam() {
Ir ir;
if(!ir.supported()) {
} else {