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 @@ -85,9 +85,15 @@ AdvancedFm::AdvancedFm( ) 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"); @@ -95,5 +101,5 @@ AdvancedFm::AdvancedFm( ) 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"); @@ -101,5 +107,5 @@ AdvancedFm::AdvancedFm( ) 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"); @@ -107,5 +113,5 @@ AdvancedFm::AdvancedFm( ) 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"); @@ -113,5 +119,5 @@ AdvancedFm::AdvancedFm( ) 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() )); @@ -136,5 +142,5 @@ AdvancedFm::AdvancedFm( ) TabWidget = new QTabWidget( this, "TabWidget" ); - layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); + layout->addMultiCellWidget( TabWidget, 1, 1, 0, 7); tab = new QWidget( TabWidget, "tab" ); @@ -214,5 +220,5 @@ AdvancedFm::AdvancedFm( ) 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()); @@ -225,5 +231,5 @@ AdvancedFm::AdvancedFm( ) currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); - layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); + layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7); filterStr="*"; @@ -307,5 +313,4 @@ void AdvancedFm::populateLocalView() if(fileL !="./" && fi->exists()) { item= new QListViewItem( Local_View, fileL, fileS , fileDate); - if(isDir || fileL.find("/",0,TRUE) != -1) { if( !QDir( fi->filePath() ).isReadable()) @@ -315,6 +320,13 @@ void AdvancedFm::populateLocalView() 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()); @@ -424,7 +436,12 @@ void AdvancedFm::populateRemoteView() 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 @@ -699,22 +716,34 @@ void AdvancedFm::runThis() { if (TabWidget->currentPageIndex() == 0) { 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(); + } } // MimeType mt( curFile); } else { 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(); + } } // MimeType mt( curFile); @@ -1479,2 +1508,16 @@ 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 @@ -53,5 +53,5 @@ public: 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; @@ -109,4 +109,5 @@ protected slots: void SDButtonPushed(); void CFButtonPushed(); + void QPEButtonPushed(); void upDir(); void currentPathComboChanged(); |