author | llornkcor <llornkcor> | 2002-04-28 13:20:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-28 13:20:23 (UTC) |
commit | 495103fd36f52dad3a564b924326519c9f52ccaf (patch) (side-by-side diff) | |
tree | 22a26ab944ee236c5df7cc2fe8f394fee7b91236 | |
parent | ee6fdf8783f7a2fa91792e2f0ce0f8350f8cac0d (diff) | |
download | opie-495103fd36f52dad3a564b924326519c9f52ccaf.zip opie-495103fd36f52dad3a564b924326519c9f52ccaf.tar.gz opie-495103fd36f52dad3a564b924326519c9f52ccaf.tar.bz2 |
added qpeDir icon, added ability to execute with 'open'
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 91 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 3 |
2 files changed, 69 insertions, 25 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 @@ -86,2 +86,8 @@ AdvancedFm::AdvancedFm( ) + 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"); @@ -90,3 +96,3 @@ AdvancedFm::AdvancedFm( ) cfButton->setFlat(TRUE); - layout->addMultiCellWidget( cfButton , 0, 0, 2, 2); + layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); @@ -96,3 +102,3 @@ AdvancedFm::AdvancedFm( ) sdButton->setFlat(TRUE); - layout->addMultiCellWidget( sdButton , 0, 0, 3, 3); + layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); @@ -102,3 +108,3 @@ AdvancedFm::AdvancedFm( ) cdUpButton ->setFlat(TRUE); - layout->addMultiCellWidget( cdUpButton , 0, 0, 4, 4); + layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); @@ -108,3 +114,3 @@ AdvancedFm::AdvancedFm( ) docButton->setFlat(TRUE); - layout->addMultiCellWidget( docButton, 0, 0, 5, 5); + layout->addMultiCellWidget( docButton, 0, 0, 6, 6); @@ -114,3 +120,3 @@ AdvancedFm::AdvancedFm( ) homeButton->setFlat(TRUE); - layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); + layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); @@ -137,3 +143,3 @@ AdvancedFm::AdvancedFm( ) TabWidget = new QTabWidget( this, "TabWidget" ); - layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); + layout->addMultiCellWidget( TabWidget, 1, 1, 0, 7); @@ -215,3 +221,3 @@ AdvancedFm::AdvancedFm( ) currentPathCombo->setEditable(TRUE); - layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); + layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); @@ -226,3 +232,3 @@ AdvancedFm::AdvancedFm( ) - layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); + layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7); @@ -308,3 +314,2 @@ void AdvancedFm::populateLocalView() item= new QListViewItem( Local_View, fileL, fileS , fileDate); - if(isDir || fileL.find("/",0,TRUE) != -1) { @@ -316,4 +321,11 @@ void AdvancedFm::populateLocalView() } 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 { @@ -425,5 +437,10 @@ void AdvancedFm::populateRemoteView() } 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()); @@ -700,9 +717,15 @@ void AdvancedFm::runThis() { QString curFile = Local_View->currentItem()->text(0); - curFile = currentDir.canonicalPath()+"/"+curFile; - DocLnk nf(curFile); - QString execStr = nf.exec(); - qDebug( execStr); - if( execStr.isEmpty() ) { + QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile); + if(fileInfo.isExecutable()) { + QCopEnvelope e("QPE/System", "execute(QString)" ); + e << curFile; } else { - nf.execute(); + curFile = currentDir.canonicalPath()+"/"+curFile; + DocLnk nf(curFile); + QString execStr = nf.exec(); + qDebug( execStr); + if( execStr.isEmpty() ) { + } else { + nf.execute(); + } } @@ -711,9 +734,15 @@ void AdvancedFm::runThis() { QString curFile = Remote_View->currentItem()->text(0); - curFile = currentRemoteDir.canonicalPath()+"/"+curFile; - DocLnk nf(curFile); - QString execStr = nf.exec(); - qDebug(execStr); - if( execStr.isEmpty() ) { + QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile); + if(fileInfo.isExecutable()) { + QCopEnvelope e("QPE/System", "execute(QString)" ); + e << curFile; } else { - nf.execute(); + curFile = currentRemoteDir.canonicalPath()+"/"+curFile; + DocLnk nf(curFile); + QString execStr = nf.exec(); + qDebug(execStr); + if( execStr.isEmpty() ) { + } else { + nf.execute(); + } } @@ -1480 +1509,15 @@ void AdvancedFm::mkSym() { } + +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 @@ -54,3 +54,3 @@ public: QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; - QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton; + QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; QDir currentDir, currentRemoteDir; @@ -110,2 +110,3 @@ protected slots: void CFButtonPushed(); + void QPEButtonPushed(); void upDir(); |