-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 118 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 3 |
2 files changed, 83 insertions, 38 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 3a8c22d..f32031b 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -30,2 +30,3 @@ #include <qpe/applnk.h> +#include <qpe/ir.h> @@ -94,3 +95,3 @@ AdvancedFm::AdvancedFm( ) layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); - + cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); @@ -212,3 +213,3 @@ AdvancedFm::AdvancedFm( ) // tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); - + // TabWidget->insertTab( tab_3, tr( "Files" ) ); @@ -286,3 +287,3 @@ void AdvancedFm::populateLocalView() QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); - setCaption("AdvancedFm :: "+fs); + setCaption("AdvancedFm :: "+fs); bool isDir=FALSE; @@ -312,5 +313,5 @@ void AdvancedFm::populateLocalView() item= new QListViewItem( Local_View, fileL, fileS , fileDate); - + if(isDir || fileL.find("/",0,TRUE) != -1) { - + if( !QDir( fi->filePath() ).isReadable()) //is directory @@ -330,3 +331,3 @@ void AdvancedFm::populateLocalView() // // item->setPixmap( 0,pm); - } else if( !fi->isReadable() ) { + } else if( !fi->isReadable() ) { pm = Resource::loadPixmap( "locked" ); @@ -381,6 +382,6 @@ void AdvancedFm::populateLocalView() } - + closedir(dir); } - + Local_View->setSorting( 3,FALSE); @@ -409,3 +410,3 @@ void AdvancedFm::populateRemoteView() QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); - setCaption("AdvancedFm :: "+fs); + setCaption("AdvancedFm :: "+fs); bool isDir=FALSE; @@ -499,3 +500,3 @@ void AdvancedFm::populateRemoteView() } - + closedir(dir); @@ -616,3 +617,3 @@ void AdvancedFm::showHidden() populateLocalView(); - + } @@ -693,2 +694,4 @@ void AdvancedFm::showLocalMenu(QListViewItem * item) m.setItemChecked(m.idAt(0),FALSE); + if(Ir::supported()) + m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); m.exec( QCursor::pos() ); @@ -730,4 +733,6 @@ void AdvancedFm::showRemoteMenu(QListViewItem * item) m.setItemChecked(m.idAt(0),FALSE); + if(Ir::supported()) + m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); m.exec( QCursor::pos() ); - } + } } @@ -736,3 +741,3 @@ void AdvancedFm::runThis() { // QFileInfo *fi; -QString fs; +QString fs; if (TabWidget->currentPageIndex() == 0) { @@ -833,3 +838,3 @@ void AdvancedFm::localDelete() myFile = myFile.left( myFile.find(" -> ",0,TRUE)); - + QString f = currentDir.canonicalPath(); @@ -939,3 +944,3 @@ void AdvancedFm::remoteRename() { - QString curFile = Remote_View->currentItem()->text(0); + QString curFile = Local_View->currentItem()->text(0); InputDialog *fileDlg; @@ -1053,3 +1058,3 @@ void AdvancedFm::filePerms() { - + } @@ -1060,3 +1065,3 @@ void AdvancedFm::doProperties() { if (TabWidget->currentPageIndex() == 0) { - + filePath = currentDir.canonicalPath()+"/"; @@ -1185,3 +1190,3 @@ void AdvancedFm::copy() - QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it); + QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it); // if(destFile.right(1).find("/",0,TRUE) == -1) @@ -1254,3 +1259,3 @@ void AdvancedFm::copyAs() } - + populateRemoteView(); @@ -1381,3 +1386,3 @@ void AdvancedFm::runCommand() { } - + InputDialog *fileDlg; @@ -1401,7 +1406,7 @@ void AdvancedFm::runCommand() { command +=" 2>&1"; - fp = popen( (const char *) command, "r"); + fp = popen( (const char *) command, "r"); if ( !fp ) { - qDebug("Could not execute '" + command + "'! err=%d", fp); + qDebug("Could not execute '" + command + "'! err=%d", fp); QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); - pclose(fp); + pclose(fp); return; @@ -1427,3 +1432,3 @@ void AdvancedFm::runCommandStd() { } - + InputDialog *fileDlg; @@ -1457,7 +1462,7 @@ void AdvancedFm::fileStatus() { sleep(1); - fp = popen( (const char *) command, "r"); + fp = popen( (const char *) command, "r"); if ( !fp ) { - qDebug("Could not execute '" + command + "'! err=%d", fp); + qDebug("Could not execute '" + command + "'! err=%d", fp); QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); - pclose(fp); + pclose(fp); return; @@ -1467,5 +1472,5 @@ void AdvancedFm::fileStatus() { outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); - + } - + } @@ -1474,3 +1479,3 @@ void AdvancedFm::fileStatus() { void AdvancedFm::mkDir() { - if (TabWidget->currentPageIndex() == 0) + if (TabWidget->currentPageIndex() == 0) localMakDir(); @@ -1478,3 +1483,3 @@ void AdvancedFm::mkDir() { remoteMakDir(); - + } @@ -1550,17 +1555,17 @@ void AdvancedFm::keyReleaseEvent( QKeyEvent *e) SDButtonPushed(); - break; + break; case Key_5: homeButtonPushed(); - break; + break; case Key_6: docButtonPushed(); - break; + break; case Key_7: - break; + break; case Key_8: - break; + break; case Key_9: - break; + break; case Key_0: - break; + break; } @@ -1659,2 +1664,39 @@ QString AdvancedFm::getFileSystemType(const QString ¤tText) { +void AdvancedFm::doBeam() { + Ir ir; + if(!ir.supported()){ + } else { + + QStringList curFileList = getPath(); + + if (TabWidget->currentPageIndex() == 0) { + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + + QString curFile = currentDir.canonicalPath()+"/"+(*it); + if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); + Ir *file = new Ir(this, "IR"); + connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); + file->send( curFile, curFile ); + } + + } else { + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + + QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); + if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); + Ir *file = new Ir(this, "IR"); + connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); + file->send( curFile, curFile ); + + } + } + } +} + +void AdvancedFm::fileBeamFinished( Ir *ir) { + QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); + +} + + // QList<QListViewItem> * getSelectedItems( QListView * Local_View ); diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 90619ba..5817fca 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -21,2 +21,3 @@ #include <qstringlist.h> +#include <qpe/ir.h> @@ -125,2 +126,4 @@ protected slots: void doAbout(); + void doBeam(); + void fileBeamFinished( Ir *ir); }; |