-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 3aa516c..ec475a4 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -291,124 +291,129 @@ void AdvancedFm::populateRemoteView() { if( fileL.find(".") == -1 ){ item= new QListViewItem( Remote_View, fileL, fileS, fileDate); pm = Resource::loadPixmap( "UnknownDocument-14" ); item->setPixmap( 0,pm); } } closedir(dir); } Remote_View->setSorting( 3,FALSE); fillCombo( (const QString &) currentRemoteDir.canonicalPath() ); } void AdvancedFm::localListClicked(QListViewItem *selectedItem) { if(selectedItem) { QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); strSize=strSize.stripWhiteSpace(); if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); if(QDir(strItem2).exists() ) { currentDir.cd(strItem2, TRUE); populateLocalView(); } } else { // not a symlink if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); currentDir.cd(strItem,FALSE); populateLocalView(); + Local_View->ensureItemVisible(Local_View->firstChild()); + } else { currentDir.cdUp(); populateLocalView(); + Local_View->ensureItemVisible(Local_View->firstChild()); } if(QDir(strItem).exists()){ currentDir.cd(strItem, TRUE); + Local_View->ensureItemVisible(Local_View->firstChild()); populateLocalView(); } } else { strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); if( QFile::exists(strItem ) ) { // qDebug("clicked item "+strItem); // DocLnk doc( strItem, FALSE ); // doc.execute(); // Local_View->clearSelection(); } } //end not symlink chdir(strItem.latin1()); } - Local_View->ensureItemVisible(Local_View->firstChild()); } } void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) { if(selectedItem) { QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); strSize=strSize.stripWhiteSpace(); if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); currentRemoteDir.cd(strItem2, TRUE); populateRemoteView(); } else { // not a symlink if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) { strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); currentRemoteDir.cd(strItem,FALSE); populateRemoteView(); + Remote_View->ensureItemVisible(Remote_View->firstChild()); } else { currentRemoteDir.cdUp(); populateRemoteView(); + Remote_View->ensureItemVisible(Remote_View->firstChild()); } if(QDir(strItem).exists()){ currentRemoteDir.cd(strItem, TRUE); populateRemoteView(); + Remote_View->ensureItemVisible(Remote_View->firstChild()); } } else { strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); if( QFile::exists(strItem ) ) { // qDebug("clicked item "+strItem); // DocLnk doc( strItem, FALSE ); // doc.execute(); // Remote_View->clearSelection(); } } //end not symlink chdir(strItem.latin1()); } - Remote_View->ensureItemVisible(Remote_View->firstChild()); } } void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) { // qDebug("list pressed"); switch (mouse) { case 1: break; case 2: menuTimer.start( 750, TRUE ); qDebug("Start menu timer\n"); break; }; } void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) { switch (mouse) { case 1: break; case 2: menuTimer.start( 750, TRUE ); qDebug("Start menu timer"); break; }; } void AdvancedFm::switchToLocalTab() { TabWidget->setCurrentPage(0); Local_View->setFocus(); @@ -751,65 +756,67 @@ void AdvancedFm::showFileMenu() { m->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); m->insertSeparator(); if(isLocalView) m->insertItem( tr( "Rename" ), this, SLOT( localRename() )); else m->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); m->insertItem( tr( "Copy" ), this, SLOT( copy() )); m->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); m->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); m->insertItem( tr( "Move" ), this, SLOT( move() )); m->insertSeparator(); m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); // if(isLocalView) // m->insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() )); // else // m->insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() )); m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); m->insertSeparator(); if(isLocalView) m->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); else m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); m->insertSeparator(); m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); +#if defined(QT_QWS_OPIE) m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); +#endif m->setCheckable(TRUE); if (!b) m->setItemChecked(m->idAt(0),TRUE); else m->setItemChecked(m->idAt(0),FALSE); if(Ir::supported()) m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); m->setFocus(); m->exec( QCursor::pos() ); sleep(1); if(m) delete m; } void AdvancedFm::cancelMenuTimer() { // qDebug("selectionChanged: cancel menu timer"); if( menuTimer.isActive() ) menuTimer.stop(); } QString AdvancedFm::checkDiskSpace(const QString &path) { struct statfs fss; if ( !statfs( path.latin1(), &fss ) ) { int blkSize = fss.f_bsize; // int totalBlks = fs.f_blocks; int availBlks = fss.f_bavail; long mult = blkSize / 1024; long div = 1024 / blkSize; if ( !mult ) mult = 1; |