-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 1 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 220 |
3 files changed, 139 insertions, 83 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 12ebbf2..7bccce9 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -27,96 +27,97 @@ #include <qtimer.h> class OTabWidget; class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QComboBox; class QListView; class QListviewItem; class QLabel; class QProgressBar; class QSpinBox; class QTabWidget; class QWidget; class QPEToolBar; class QPEMenuBar; class QPopupMenu; class QFile; class QListViewItem; class QLineEdit; //class QPushButton; class QToolButton; class Ir; class AdvancedFm : public QMainWindow { Q_OBJECT public: AdvancedFm(); ~AdvancedFm(); OTabWidget *TabWidget; // QTabWidget *TabWidget; QWidget *tab, *tab_2, *tab_3; QListView *Local_View, *Remote_View; QLineEdit *currentPathEdit; QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; QDir currentDir, currentRemoteDir; QComboBox *currentPathCombo; QString filterStr; QListViewItem * item; bool b; QStringList fileSystemTypeList, fsList; int currentServerConfig; protected slots: + void selectAll(); void addToDocs(); void doLocalCd(); void doRemoteCd(); // void copy(); void mkDir(); void del(); void rn(); void populateLocalView(); void populateRemoteView(); void showHidden(); void showMenuHidden(); void showRemoteHidden(); void writeConfig(); void readConfig(); void localListClicked(QListViewItem *); void remoteListClicked(QListViewItem *); void localListPressed( int, QListViewItem *, const QPoint&, int); void remoteListPressed( int, QListViewItem *, const QPoint&, int); void localMakDir(); void localDelete(); void remoteMakDir(); void remoteDelete(); /* bool remoteDirList(const QString &); */ /* bool remoteChDir(const QString &); */ void tabChanged(QWidget*); void cleanUp(); void remoteRename(); void localRename(); void runThis(); void runText(); void filePerms(); void doProperties(); void runCommand(); void runCommandStd(); QStringList getPath(); void mkSym(); void switchToLocalTab(); void switchToRemoteTab(); protected: bool zaurusDevice; QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; QStringList remoteDirPathStringList, localDirPathStringList; void init(); void initConnections(); void keyReleaseEvent( QKeyEvent *); QString getFileSystemType(const QString &); diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 7188640..f0a0a35 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp @@ -42,96 +42,97 @@ void AdvancedFm::init() { QPEMenuBar *menuBar = new QPEMenuBar(this); fileMenu = new QPopupMenu( this ); viewMenu = new QPopupMenu( this ); layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); menuBar->insertItem( tr( "File" ), fileMenu); menuBar->insertItem( tr( "View" ), viewMenu); qpeDirButton= new QToolButton(this,"QPEButton"); qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); cfButton = new QToolButton( this,"CFButton"); cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); cfButton ->setFixedSize( QSize( 20, 20 ) ); layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); sdButton = new QToolButton( this,"SDButton"); sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); sdButton->setFixedSize( QSize( 20, 20 ) ); layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); cdUpButton = new QToolButton( this,"cdUpButton"); cdUpButton->setPixmap(Resource::loadPixmap("up")); cdUpButton ->setFixedSize( QSize( 20, 20 ) ); layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); docButton = new QToolButton( this,"docsButton"); docButton->setPixmap(Resource::loadPixmap("DocsIcon")); docButton->setFixedSize( QSize( 20, 20 ) ); layout->addMultiCellWidget( docButton, 0, 0, 6, 6); homeButton = new QToolButton( this,"homeButton"); homeButton->setPixmap(Resource::loadPixmap("home")); homeButton->setFixedSize( QSize( 20, 20 ) ); layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); fileMenu->insertSeparator(); fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); fileMenu->insertSeparator(); + fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); fileMenu->setCheckable(TRUE); viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); viewMenu->insertSeparator(); viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); viewMenu->setCheckable(TRUE); currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); currentPathCombo->setEditable(TRUE); layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); // TabWidget = new QTabWidget( this, "TabWidget" ); layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); tab = new QWidget( TabWidget, "tab" ); tabLayout = new QGridLayout( tab ); tabLayout->setSpacing( 2); tabLayout->setMargin( 2); Local_View = new QListView( tab, "Local_View" ); Local_View->addColumn( tr("File"),130); Local_View->addColumn( tr("Size"),-1); Local_View->setColumnAlignment(1,QListView::AlignRight); Local_View->addColumn( tr("Date"),-1); Local_View->setColumnAlignment(2,QListView::AlignRight); Local_View->setAllColumnsShowFocus(TRUE); Local_View->setMultiSelection( TRUE ); Local_View->setSelectionMode(QListView::Extended); QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); tabLayout->addWidget( Local_View, 0, 0 ); TabWidget->addTab( tab,"advancedfm/smFileBrowser.png", tr("1")); // TabWidget->insertTab( tab, tr("1")); tab_2 = new QWidget( TabWidget, "tab_2" ); diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 27a119f..bef701a 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -154,190 +154,222 @@ void AdvancedFm::runThis() { } } } } void AdvancedFm::runText() { if (TabWidget->getCurrentTab() == 0) { QString curFile = Local_View->currentItem()->text(0); if(curFile != "../") { curFile = currentDir.canonicalPath()+"/"+curFile; QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); e << curFile; } } else { QString curFile = Remote_View->currentItem()->text(0); if(curFile != "../") { curFile = currentRemoteDir.canonicalPath()+"/"+curFile; DocLnk nf(curFile); QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); e << curFile; } } } void AdvancedFm::localMakDir() { InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString filename = fileDlg->LineEdit1->text(); currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); } populateLocalView(); } void AdvancedFm::remoteMakDir() { InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString filename = fileDlg->LineEdit1->text(); currentRemoteDir.mkdir( currentRemoteDir.canonicalPath()+"/"+filename); } populateRemoteView(); } void AdvancedFm::localDelete() { QStringList curFileList = getPath(); - if(curFileList.count() > 0) { - QString myFile; + bool doMsg=true; + int count=curFileList.count(); + if( count > 0) { + if(count > 1 ){ + QString msg; + msg=tr("Really delete\n%1 files?").arg(count); + switch ( QMessageBox::warning(this,tr("Delete"),msg + ,tr("Yes"),tr("No"),0,0,1) ) { + case 0: + doMsg=false; + break; + case 1: + return; + break; + }; + } + + QString myFile; for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { myFile = (*it); if( myFile.find(" -> ",0,TRUE) != -1) myFile = myFile.left( myFile.find(" -> ",0,TRUE)); QString f = currentDir.canonicalPath(); if(f.right(1).find("/",0,TRUE) == -1) f+="/"; f+=myFile; if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { - switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ + switch ( QMessageBox::warning(this,tr("Delete Directory?"),tr("Really delete\n")+f+ "\nand all it's contents ?" ,tr("Yes"),tr("No"),0,0,1) ) { case 0: { f=f.left(f.length()-1); QString cmd="rm -rf "+f; system( cmd.latin1()); populateLocalView(); } break; case 1: // exit break; }; } else { - switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f + if(doMsg) { + switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f +" ?",tr("Yes"),tr("No"),0,0,1) ) { - case 0: { - QString cmd="rm "+f; - QFile file(f); - file.remove(); - // system( cmd.latin1()); - populateLocalView(); - } - break; - case 1: - // exit - break; + case 1: + return; + break; }; + } + QString cmd="rm "+f; + QFile file(f); + if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) + file.remove(); + // system( cmd.latin1()); } } } + populateLocalView(); } void AdvancedFm::remoteDelete() { - QStringList curFileList = getPath(); - if( curFileList.count() > 0) { - QString myFile; - - for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - myFile = (*it); - if(myFile.find(" -> ",0,TRUE) != -1) - myFile = myFile.left(myFile.find(" -> ",0,TRUE)); - QString f = currentRemoteDir.canonicalPath(); - if(f.right(1).find("/",0,TRUE) == -1) - f+="/"; - f+=myFile; - if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { - switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ - "\nand all it's contents ?", - tr("Yes"),tr("No"),0,0,1) ) { - case 0: { - f=f.left(f.length()-1); - QString cmd="rm -rf "+f; - system( cmd.latin1()); - populateRemoteView(); + QStringList curFileList = getPath(); + bool doMsg=true; + int count=curFileList.count(); + if( count > 0) { + if(count > 1 ){ + QString msg; + msg=tr("Really delete\n%1 files?").arg(count); + switch ( QMessageBox::warning(this,tr("Delete"),msg + ,tr("Yes"),tr("No"),0,0,1) ) { + case 0: + doMsg=false; + break; + case 1: + return; + break; + }; } - break; - case 1: - // exit - break; - }; - } else { - switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f - +" ?",tr("Yes"),tr("No"),0,0,1) ) { - case 0: { - QString cmd="rm "+f; - QFile file(f); - file.remove(); - // system( cmd.latin1()); - populateRemoteView(); + QString myFile; + + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + myFile = (*it); + if(myFile.find(" -> ",0,TRUE) != -1) + myFile = myFile.left(myFile.find(" -> ",0,TRUE)); + QString f = currentRemoteDir.canonicalPath(); + if(f.right(1).find("/",0,TRUE) == -1) + f+="/"; + f+=myFile; + if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { + switch ( QMessageBox::warning(this,tr("Delete Directory"),tr("Really delete\n")+f+ + "\nand all it's contents ?", + tr("Yes"),tr("No"),0,0,1) ) { + case 0: { + f=f.left(f.length()-1); + QString cmd="rm -rf "+f; + system( cmd.latin1()); + populateRemoteView(); + } + break; + case 1: + // exit + break; + }; + + } else { + if(doMsg) { + switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f + +" ?",tr("Yes"),tr("No"),0,0,1) ) { + case 1: + return; + break; + }; + } + QString cmd="rm "+f; + QFile file(f); + if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) + file.remove(); + // system( cmd.latin1()); + } } - break; - case 1: - // exit - break; - }; - } } - } + populateRemoteView(); } void AdvancedFm::localRename() { QString curFile = Local_View->currentItem()->text(0); qDebug("currentItem "+curFile); if( curFile !="../") { InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); fileDlg->setInputText((const QString &)curFile); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString oldname = currentDir.canonicalPath() + "/" + curFile; QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text(); //+".playlist"; if( rename(oldname.latin1(), newName.latin1())== -1) QMessageBox::message(tr("Note"),tr("Could not rename")); } populateLocalView(); } } void AdvancedFm::remoteRename() { QString curFile = Remote_View->currentItem()->text(0); if( curFile !="../") { InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); fileDlg->setInputText((const QString &)curFile); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString oldname = currentRemoteDir.canonicalPath() + "/" + curFile; QString newName = currentRemoteDir.canonicalPath() + "/" + fileDlg->LineEdit1->text(); //+".playlist"; if( rename(oldname.latin1(), newName.latin1())== -1) QMessageBox::message(tr("Note"),tr("Could not rename")); } populateRemoteView(); } } void AdvancedFm::filePerms() { QStringList curFileList = getPath(); QString filePath; if (TabWidget->getCurrentTab() == 0) { filePath = currentDir.canonicalPath()+"/"; @@ -364,235 +396,247 @@ void AdvancedFm::doProperties() { #if defined(QT_QWS_OPIE) QStringList curFileList = getPath(); QString filePath; if (TabWidget->getCurrentTab() == 0) { filePath = currentDir.canonicalPath()+"/"; } else { filePath= currentRemoteDir.canonicalPath()+"/"; } qDebug("%d",curFileList.count()); for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { qDebug((filePath+*it)); DocLnk lnk( (filePath+*it)); LnkProperties prop( &lnk ); prop.showMaximized(); prop.exec(); } #endif } void AdvancedFm::upDir() { if (TabWidget->getCurrentTab() == 0) { QString current = currentDir.canonicalPath(); QDir dir(current); dir.cdUp(); current = dir.canonicalPath(); chdir( current.latin1() ); currentDir.cd( current, TRUE); populateLocalView(); update(); } else { QString current = currentRemoteDir.canonicalPath(); QDir dir(current); dir.cdUp(); current = dir.canonicalPath(); chdir( current.latin1() ); currentRemoteDir.cd( current, TRUE); populateRemoteView(); update(); } } void AdvancedFm::copy() { qApp->processEvents(); QStringList curFileList = getPath(); - if( curFileList.count() > 0) { + bool doMsg=true; + int count=curFileList.count(); + if( count > 0) { + if(count > 1 ){ + QString msg; + msg=tr("Really copy\n%1 files?").arg(count); + switch ( QMessageBox::warning(this,tr("Delete"),msg + ,tr("Yes"),tr("No"),0,0,1) ) { + case 0: + doMsg=false; + break; + case 1: + return; + break; + }; + } + QString curFile, item, destFile; if (TabWidget->getCurrentTab() == 0) { - for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { item=(*it); - if(item.find("->",0,TRUE)) //symlink item = item.left(item.find("->",0,TRUE)); destFile = currentRemoteDir.canonicalPath()+"/"+ item; qDebug("Destination file is "+destFile); curFile = currentDir.canonicalPath()+"/"+ item; qDebug("CurrentFile file is " + curFile); QFile f(destFile); if( f.exists()) { - switch ( QMessageBox::warning(this,tr("Delete"), - destFile+tr(" already exists\nDo you really want to delete it?"), - tr("Yes"),tr("No"),0,0,1) ) { - case 0: - f.remove(); - break; - case 1: - return; - break; - }; - } - if(!copyFile(destFile, curFile) ) { - QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile); + if(doMsg) { + switch ( QMessageBox::warning(this,tr("File Exists!"), + item+tr("\nexists. Ok to overwrite?"), + tr("Yes"),tr("No"),0,0,1) ) { + case 1: + return; + break; + }; + } + f.remove(); + } + if(!copyFile(destFile, curFile) ) { + QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile); return; } } populateRemoteView(); TabWidget->setCurrentTab(1); } else { for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { item= (*it); - if(item.find("->",0,TRUE)) //symlink item = item.left(item.find("->",0,TRUE)); destFile = currentDir.canonicalPath()+"/"+ item; qDebug("Destination file is "+destFile); curFile = currentRemoteDir.canonicalPath()+"/"+ item;; qDebug("CurrentFile file is " + curFile); QFile f(destFile); if( f.exists()) { - switch ( QMessageBox::warning(this,tr("Delete"), - destFile+tr(" already exists\nDo you really want to delete it?"), + switch ( QMessageBox::warning(this,tr("File Exists!"), + item+tr("\nexists. Ok to overwrite?"), tr("Yes"),tr("No"),0,0,1) ) { - case 0: - f.remove(); - break; case 1: return; break; }; + f.remove(); } if(!copyFile(destFile, curFile) ) { QMessageBox::message("AdvancedFm",tr("Could not copy\n") +curFile +tr("to\n")+destFile); return; } } populateLocalView(); TabWidget->setCurrentTab(0); } } } void AdvancedFm::copyAs() { qApp->processEvents(); QStringList curFileList = getPath(); QString curFile; InputDialog *fileDlg; if (TabWidget->getCurrentTab() == 0) { qDebug("tab 1"); for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { QString destFile; curFile = currentDir.canonicalPath()+"/"+(*it); fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); fileDlg->setInputText((const QString &) destFile ); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString filename = fileDlg->LineEdit1->text(); destFile = currentRemoteDir.canonicalPath()+"/"+filename; QFile f(destFile); if( f.exists()) { - switch (QMessageBox::warning(this,tr("Delete"), - destFile+tr(" already exists\nDo you really want to delete it?"), + switch (QMessageBox::warning(this,tr("File Exists!"), + item+tr("\nexists. Ok to overwrite?"), tr("Yes"),tr("No"),0,0,1) ) { case 0: f.remove(); break; case 1: return; break; }; } if(!copyFile(destFile, curFile) ) { QMessageBox::message("AdvancedFm",tr("Could not copy\n") +curFile +tr("to\n")+destFile); return; } } delete fileDlg; } populateRemoteView(); TabWidget->setCurrentTab(1); } else { for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { curFile = currentRemoteDir.canonicalPath()+"/"+(*it); fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0); QString destFile; fileDlg->setInputText((const QString &) destFile); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString filename = fileDlg->LineEdit1->text(); destFile = currentDir.canonicalPath()+"/"+filename; QFile f( destFile); if( f.exists()) { - switch ( QMessageBox::warning(this,tr("Delete"), - destFile+tr(" already exists\nDo you really want to delete it?"), + switch ( QMessageBox::warning(this,tr("File Exists!"), + item+tr("\nexists. Ok to overwrite?"), tr("Yes"),tr("No"),0,0,1) ) { case 0: f.remove(); break; case 1: return; break; }; } if(!copyFile(destFile, curFile) ) { QMessageBox::message("AdvancedFm",tr("Could not copy\n") +curFile +tr("to\n")+destFile); return; } } delete fileDlg; } populateLocalView(); TabWidget->setCurrentTab(0); } } void AdvancedFm::copySameDir() { qApp->processEvents(); QStringList curFileList = getPath(); QString curFile, item, destFile; InputDialog *fileDlg; if (TabWidget->getCurrentTab() == 0) { for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { item=(*it); curFile = currentDir.canonicalPath()+"/"+ item; fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); fileDlg->setInputText((const QString &) destFile ); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString filename = fileDlg->LineEdit1->text(); destFile = currentDir.canonicalPath()+"/"+filename; QFile f(destFile); if( f.exists()) { switch (QMessageBox::warning(this,tr("Delete"), @@ -917,48 +961,58 @@ void AdvancedFm::mkSym() { cmd = "ln -s "+curFile+" "+destName; qDebug(cmd); system(cmd.latin1() ); } populateLocalView(); TabWidget->setCurrentTab(0); } } } void AdvancedFm::doBeam() { Ir ir; if(!ir.supported()){ } else { QStringList curFileList = getPath(); if( curFileList.count() > 0) { if (TabWidget->getCurrentTab() == 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 *) { QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); } + +void AdvancedFm::selectAll() { + if (TabWidget->getCurrentTab() == 0) { + Local_View->selectAll(true); + Local_View->setSelected( Local_View->firstChild(),false); + } else { + Remote_View->selectAll(true); + Remote_View->setSelected( Remote_View->firstChild(),false); + } +} |