summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
Unidiff
Diffstat (limited to 'noncore/apps/advancedfm') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp118
-rw-r--r--noncore/apps/advancedfm/advancedfm.h3
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 @@
30#include <qpe/applnk.h> 30#include <qpe/applnk.h>
31#include <qpe/ir.h>
31 32
@@ -94,3 +95,3 @@ AdvancedFm::AdvancedFm( )
94 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); 95 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
95 96
96 cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); 97 cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton");
@@ -212,3 +213,3 @@ AdvancedFm::AdvancedFm( )
212// tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); 213// tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 );
213 214
214// TabWidget->insertTab( tab_3, tr( "Files" ) ); 215// TabWidget->insertTab( tab_3, tr( "Files" ) );
@@ -286,3 +287,3 @@ void AdvancedFm::populateLocalView()
286 QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); 287 QString fs= getFileSystemType((const QString &) currentDir.canonicalPath());
287 setCaption("AdvancedFm :: "+fs); 288 setCaption("AdvancedFm :: "+fs);
288 bool isDir=FALSE; 289 bool isDir=FALSE;
@@ -312,5 +313,5 @@ void AdvancedFm::populateLocalView()
312 item= new QListViewItem( Local_View, fileL, fileS , fileDate); 313 item= new QListViewItem( Local_View, fileL, fileS , fileDate);
313 314
314 if(isDir || fileL.find("/",0,TRUE) != -1) { 315 if(isDir || fileL.find("/",0,TRUE) != -1) {
315 316
316 if( !QDir( fi->filePath() ).isReadable()) //is directory 317 if( !QDir( fi->filePath() ).isReadable()) //is directory
@@ -330,3 +331,3 @@ void AdvancedFm::populateLocalView()
330// // item->setPixmap( 0,pm); 331// // item->setPixmap( 0,pm);
331 } else if( !fi->isReadable() ) { 332 } else if( !fi->isReadable() ) {
332 pm = Resource::loadPixmap( "locked" ); 333 pm = Resource::loadPixmap( "locked" );
@@ -381,6 +382,6 @@ void AdvancedFm::populateLocalView()
381 } 382 }
382 383
383 closedir(dir); 384 closedir(dir);
384 } 385 }
385 386
386 Local_View->setSorting( 3,FALSE); 387 Local_View->setSorting( 3,FALSE);
@@ -409,3 +410,3 @@ void AdvancedFm::populateRemoteView()
409 QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); 410 QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath());
410 setCaption("AdvancedFm :: "+fs); 411 setCaption("AdvancedFm :: "+fs);
411 bool isDir=FALSE; 412 bool isDir=FALSE;
@@ -499,3 +500,3 @@ void AdvancedFm::populateRemoteView()
499 } 500 }
500 501
501 closedir(dir); 502 closedir(dir);
@@ -616,3 +617,3 @@ void AdvancedFm::showHidden()
616 populateLocalView(); 617 populateLocalView();
617 618
618} 619}
@@ -693,2 +694,4 @@ void AdvancedFm::showLocalMenu(QListViewItem * item)
693 m.setItemChecked(m.idAt(0),FALSE); 694 m.setItemChecked(m.idAt(0),FALSE);
695 if(Ir::supported())
696 m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
694 m.exec( QCursor::pos() ); 697 m.exec( QCursor::pos() );
@@ -730,4 +733,6 @@ void AdvancedFm::showRemoteMenu(QListViewItem * item)
730 m.setItemChecked(m.idAt(0),FALSE); 733 m.setItemChecked(m.idAt(0),FALSE);
734 if(Ir::supported())
735 m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
731 m.exec( QCursor::pos() ); 736 m.exec( QCursor::pos() );
732 } 737 }
733} 738}
@@ -736,3 +741,3 @@ void AdvancedFm::runThis() {
736// QFileInfo *fi; 741// QFileInfo *fi;
737QString fs; 742QString fs;
738 if (TabWidget->currentPageIndex() == 0) { 743 if (TabWidget->currentPageIndex() == 0) {
@@ -833,3 +838,3 @@ void AdvancedFm::localDelete()
833 myFile = myFile.left( myFile.find(" -> ",0,TRUE)); 838 myFile = myFile.left( myFile.find(" -> ",0,TRUE));
834 839
835 QString f = currentDir.canonicalPath(); 840 QString f = currentDir.canonicalPath();
@@ -939,3 +944,3 @@ void AdvancedFm::remoteRename()
939{ 944{
940 QString curFile = Remote_View->currentItem()->text(0); 945 QString curFile = Local_View->currentItem()->text(0);
941 InputDialog *fileDlg; 946 InputDialog *fileDlg;
@@ -1053,3 +1058,3 @@ void AdvancedFm::filePerms() {
1053 1058
1054 1059
1055} 1060}
@@ -1060,3 +1065,3 @@ void AdvancedFm::doProperties() {
1060 if (TabWidget->currentPageIndex() == 0) { 1065 if (TabWidget->currentPageIndex() == 0) {
1061 1066
1062 filePath = currentDir.canonicalPath()+"/"; 1067 filePath = currentDir.canonicalPath()+"/";
@@ -1185,3 +1190,3 @@ void AdvancedFm::copy()
1185 1190
1186 QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it); 1191 QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it);
1187// if(destFile.right(1).find("/",0,TRUE) == -1) 1192// if(destFile.right(1).find("/",0,TRUE) == -1)
@@ -1254,3 +1259,3 @@ void AdvancedFm::copyAs()
1254 } 1259 }
1255 1260
1256 populateRemoteView(); 1261 populateRemoteView();
@@ -1381,3 +1386,3 @@ void AdvancedFm::runCommand() {
1381 } 1386 }
1382 1387
1383 InputDialog *fileDlg; 1388 InputDialog *fileDlg;
@@ -1401,7 +1406,7 @@ void AdvancedFm::runCommand() {
1401 command +=" 2>&1"; 1406 command +=" 2>&1";
1402 fp = popen( (const char *) command, "r"); 1407 fp = popen( (const char *) command, "r");
1403 if ( !fp ) { 1408 if ( !fp ) {
1404 qDebug("Could not execute '" + command + "'! err=%d", fp); 1409 qDebug("Could not execute '" + command + "'! err=%d", fp);
1405 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1410 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1406 pclose(fp); 1411 pclose(fp);
1407 return; 1412 return;
@@ -1427,3 +1432,3 @@ void AdvancedFm::runCommandStd() {
1427 } 1432 }
1428 1433
1429 InputDialog *fileDlg; 1434 InputDialog *fileDlg;
@@ -1457,7 +1462,7 @@ void AdvancedFm::fileStatus() {
1457 sleep(1); 1462 sleep(1);
1458 fp = popen( (const char *) command, "r"); 1463 fp = popen( (const char *) command, "r");
1459 if ( !fp ) { 1464 if ( !fp ) {
1460 qDebug("Could not execute '" + command + "'! err=%d", fp); 1465 qDebug("Could not execute '" + command + "'! err=%d", fp);
1461 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1466 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1462 pclose(fp); 1467 pclose(fp);
1463 return; 1468 return;
@@ -1467,5 +1472,5 @@ void AdvancedFm::fileStatus() {
1467 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 1472 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
1468 1473
1469 } 1474 }
1470 1475
1471 } 1476 }
@@ -1474,3 +1479,3 @@ void AdvancedFm::fileStatus() {
1474void AdvancedFm::mkDir() { 1479void AdvancedFm::mkDir() {
1475 if (TabWidget->currentPageIndex() == 0) 1480 if (TabWidget->currentPageIndex() == 0)
1476 localMakDir(); 1481 localMakDir();
@@ -1478,3 +1483,3 @@ void AdvancedFm::mkDir() {
1478 remoteMakDir(); 1483 remoteMakDir();
1479 1484
1480} 1485}
@@ -1550,17 +1555,17 @@ void AdvancedFm::keyReleaseEvent( QKeyEvent *e)
1550 SDButtonPushed(); 1555 SDButtonPushed();
1551 break; 1556 break;
1552 case Key_5: 1557 case Key_5:
1553 homeButtonPushed(); 1558 homeButtonPushed();
1554 break; 1559 break;
1555 case Key_6: 1560 case Key_6:
1556 docButtonPushed(); 1561 docButtonPushed();
1557 break; 1562 break;
1558 case Key_7: 1563 case Key_7:
1559 break; 1564 break;
1560 case Key_8: 1565 case Key_8:
1561 break; 1566 break;
1562 case Key_9: 1567 case Key_9:
1563 break; 1568 break;
1564 case Key_0: 1569 case Key_0:
1565 break; 1570 break;
1566 } 1571 }
@@ -1659,2 +1664,39 @@ QString AdvancedFm::getFileSystemType(const QString &currentText) {
1659 1664
1665void AdvancedFm::doBeam() {
1666 Ir ir;
1667 if(!ir.supported()){
1668 } else {
1669
1670 QStringList curFileList = getPath();
1671
1672 if (TabWidget->currentPageIndex() == 0) {
1673 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1674
1675 QString curFile = currentDir.canonicalPath()+"/"+(*it);
1676 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
1677 Ir *file = new Ir(this, "IR");
1678 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
1679 file->send( curFile, curFile );
1680 }
1681
1682 } else {
1683 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1684
1685 QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
1686 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
1687 Ir *file = new Ir(this, "IR");
1688 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
1689 file->send( curFile, curFile );
1690
1691 }
1692 }
1693 }
1694}
1695
1696void AdvancedFm::fileBeamFinished( Ir *ir) {
1697 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
1698
1699}
1700
1701
1660// QList<QListViewItem> * getSelectedItems( QListView * Local_View ); 1702// 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 @@
21#include <qstringlist.h> 21#include <qstringlist.h>
22#include <qpe/ir.h>
22 23
@@ -125,2 +126,4 @@ protected slots:
125 void doAbout(); 126 void doAbout();
127 void doBeam();
128 void fileBeamFinished( Ir *ir);
126}; 129};