summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp67
-rw-r--r--noncore/apps/advancedfm/advancedfm.h3
2 files changed, 57 insertions, 13 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index bb932c5..ab31c91 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -81,41 +81,47 @@ AdvancedFm::AdvancedFm( )
layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 );
menuBar->insertItem( tr( "File" ), fileMenu);
menuBar->insertItem( tr( "View" ), viewMenu);
+ qpeDirButton= new QPushButton(Resource::loadIconSet("go"),"",this,"QPEButton");
+ qpeDirButton ->setFixedSize( QSize( 20, 20 ) );
+ connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) );
+ qpeDirButton->setFlat(TRUE);
+ layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
+
cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton");
cfButton ->setFixedSize( QSize( 20, 20 ) );
connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) );
cfButton->setFlat(TRUE);
- layout->addMultiCellWidget( cfButton , 0, 0, 2, 2);
+ layout->addMultiCellWidget( cfButton , 0, 0, 3, 3);
sdButton = new QPushButton(Resource::loadIconSet("sdmon/sdcard"),"",this,"SDButton");
sdButton->setFixedSize( QSize( 20, 20 ) );
connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) );
sdButton->setFlat(TRUE);
- layout->addMultiCellWidget( sdButton , 0, 0, 3, 3);
+ layout->addMultiCellWidget( sdButton , 0, 0, 4, 4);
cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton");
cdUpButton ->setFixedSize( QSize( 20, 20 ) );
connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) );
cdUpButton ->setFlat(TRUE);
- layout->addMultiCellWidget( cdUpButton , 0, 0, 4, 4);
+ layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5);
docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
docButton->setFixedSize( QSize( 20, 20 ) );
connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
docButton->setFlat(TRUE);
- layout->addMultiCellWidget( docButton, 0, 0, 5, 5);
+ layout->addMultiCellWidget( docButton, 0, 0, 6, 6);
homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton");
homeButton->setFixedSize( QSize( 20, 20 ) );
connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
homeButton->setFlat(TRUE);
- layout->addMultiCellWidget( homeButton, 0, 0, 6, 6);
+ layout->addMultiCellWidget( homeButton, 0, 0, 7, 7);
// fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() ));
// fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() ));
// fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() ));
fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
@@ -132,13 +138,13 @@ AdvancedFm::AdvancedFm( )
viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
viewMenu->insertSeparator();
viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
viewMenu->setCheckable(TRUE);
TabWidget = new QTabWidget( this, "TabWidget" );
- layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6);
+ layout->addMultiCellWidget( TabWidget, 1, 1, 0, 7);
tab = new QWidget( TabWidget, "tab" );
tabLayout = new QGridLayout( tab );
tabLayout->setSpacing( 2);
tabLayout->setMargin( 2);
@@ -210,24 +216,24 @@ AdvancedFm::AdvancedFm( )
currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
currentRemoteDir.setPath( QDir::currentDirPath());
b = TRUE;
currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" );
currentPathCombo->setEditable(TRUE);
- layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6);
+ layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7);
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
connect( currentPathCombo, SIGNAL( activated( const QString & ) ),
this, SLOT( currentPathComboActivated( const QString & ) ) );
connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
this,SLOT(currentPathComboChanged()));
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
- layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6);
+ layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7);
filterStr="*";
b=FALSE;
populateLocalView();
populateRemoteView();
}
@@ -303,22 +309,28 @@ void AdvancedFm::populateLocalView()
isDir=TRUE;
// qDebug( fileL);
}
}
if(fileL !="./" && fi->exists()) {
item= new QListViewItem( Local_View, fileL, fileS , fileDate);
-
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable())
pm = Resource::loadPixmap( "lockedfolder" );
else
pm= Resource::loadPixmap( "folder" );
item->setPixmap( 0,pm );
} else {
- if( !fi->isReadable() )
+ if(fi->isExecutable()) {
+ pm = Resource::loadPixmap( "exec");
+ item->setPixmap( 0,pm);
+ }
+ else if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
+ item->setPixmap( 0,pm);
+
+ }
else {
MimeType mt(fi->filePath());
pm=mt.pixmap(); //sets the correct pixmap for mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
item->setPixmap( 0,pm);
@@ -420,15 +432,20 @@ void AdvancedFm::populateRemoteView()
if( !QDir( fi->filePath() ).isReadable())
pm = Resource::loadPixmap( "lockedfolder" );
else
pm= Resource::loadPixmap( "folder" );
item->setPixmap( 0,pm );
} else {
- if( !fi->isReadable() )
+ if(fi->isExecutable()) {
+ pm = Resource::loadPixmap( "exec");
+ item->setPixmap( 0,pm);
+ }
+ else if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
- else {
+ item->setPixmap( 0,pm);
+ } else {
MimeType mt(fi->filePath());
pm=mt.pixmap(); //sets the correct pixmap for mimetype
if(pm.isNull())
pm = Resource::loadPixmap( "UnknownDocument-14" );
item->setPixmap( 0,pm);
}
@@ -695,31 +712,43 @@ void AdvancedFm::showRemoteMenu(QListViewItem * item)
}
void AdvancedFm::runThis() {
// QFileInfo *fi;
if (TabWidget->currentPageIndex() == 0) {
QString curFile = Local_View->currentItem()->text(0);
+ QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile);
+ if(fileInfo.isExecutable()) {
+ QCopEnvelope e("QPE/System", "execute(QString)" );
+ e << curFile;
+ } else {
curFile = currentDir.canonicalPath()+"/"+curFile;
DocLnk nf(curFile);
QString execStr = nf.exec();
qDebug( execStr);
if( execStr.isEmpty() ) {
} else {
nf.execute();
}
+ }
// MimeType mt( curFile);
} else {
QString curFile = Remote_View->currentItem()->text(0);
+ QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile);
+ if(fileInfo.isExecutable()) {
+ QCopEnvelope e("QPE/System", "execute(QString)" );
+ e << curFile;
+ } else {
curFile = currentRemoteDir.canonicalPath()+"/"+curFile;
DocLnk nf(curFile);
QString execStr = nf.exec();
qDebug(execStr);
if( execStr.isEmpty() ) {
} else {
nf.execute();
}
+ }
// MimeType mt( curFile);
}
}
void AdvancedFm::runText() {
if (TabWidget->currentPageIndex() == 0) {
@@ -1475,6 +1504,20 @@ void AdvancedFm::mkSym() {
curFile = currentRemoteDir.canonicalPath()+"/"+curFile;
cmd = "ln -s "+curFile+" "+destName;
system(cmd.latin1() );
populateLocalView();
}
}
+
+void AdvancedFm::QPEButtonPushed() {
+ QString current = QPEApplication::qpeDir();
+ chdir( current.latin1() );
+ if (TabWidget->currentPageIndex() == 0) {
+ currentDir.cd( current, TRUE);
+ populateLocalView();
+ } else {
+ currentRemoteDir.cd( current, TRUE);
+ populateRemoteView();
+ }
+ update();
+
+}
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index c00713f..5c2719e 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -49,13 +49,13 @@ public:
QTabWidget *TabWidget;
QWidget *tab, *tab_2, *tab_3;
QListView *Local_View, *Remote_View;
QLineEdit *currentPathEdit;
QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu;
- QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton;
+ QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
QDir currentDir, currentRemoteDir;
QComboBox *currentPathCombo;
QString filterStr;
QListViewItem * item;
bool b;
int currentServerConfig;
@@ -105,12 +105,13 @@ protected:
void keyReleaseEvent( QKeyEvent *);
protected slots:
void homeButtonPushed();
void docButtonPushed();
void SDButtonPushed();
void CFButtonPushed();
+ void QPEButtonPushed();
void upDir();
void currentPathComboChanged();
void copy();
void copyAs();
void currentPathComboActivated(const QString &);
void fillCombo(const QString &);