-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 30 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 62 |
2 files changed, 48 insertions, 44 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 9aa0c77..8cc5d7b 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -71,3 +71,2 @@ void AdvancedFm::cleanUp() { void AdvancedFm::tabChanged(QWidget *wd) { -// qDebug("tabChanged"); if(wd == tab) { @@ -78,2 +77,3 @@ void AdvancedFm::tabChanged(QWidget *wd) { } + else if(wd == tab_2) { @@ -86,6 +86,2 @@ void AdvancedFm::tabChanged(QWidget *wd) { QString path = CurrentDir()->canonicalPath(); -// qDebug(path); - if ( TabWidget->currentWidget() == tab) { - } else { - } @@ -268,5 +264,5 @@ void AdvancedFm::refreshCurrentTab() { void AdvancedFm::switchToLocalTab() { - TabWidget->setCurrentWidget(0); -// Local_View->setFocus(); - whichTab = 1; + TabWidget->setCurrentWidget(tab); + Local_View->setFocus(); +// whichTab = 1; } @@ -274,5 +270,5 @@ void AdvancedFm::switchToLocalTab() { void AdvancedFm::switchToRemoteTab() { - TabWidget->setCurrentWidget(1); -// Remote_View->setFocus(); - whichTab = 2; + TabWidget->setCurrentWidget(tab_2); + Remote_View->setFocus(); +// whichTab = 2; } @@ -760,5 +756,11 @@ void AdvancedFm::setDocument(const QString &file) { void AdvancedFm::slotSwitchMenu(int item) { - Q_UNUSED(item); -// qDebug( "Switch %d",item); - // viewMenu->setItemChecked(item, true); + if(item == -23) { + switchToLocalTab(); + tabChanged( tab); + } + + if(item == -24) { + switchToRemoteTab(); + tabChanged( tab_2); + } } diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 171e7c4..4802771 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -46,3 +46,3 @@ void AdvancedFm::doDirChange() { pathItem = dealWithSymName((const QString&)pathItem)+"/"; -// owarn << pathItem << oendl; +// owarn << pathItem << oendl; changeTo( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); @@ -97,3 +97,3 @@ void AdvancedFm::runThis() { QFileInfo fileInfo( path + "/" + curFile); -// odebug << fileInfo.owner() << oendl; +// odebug << fileInfo.owner() << oendl; @@ -109,3 +109,3 @@ void AdvancedFm::runThis() { QString execStr = nf.exec(); -// odebug << execStr << oendl; +// odebug << execStr << oendl; if( execStr.isEmpty() ) { @@ -207,3 +207,3 @@ void AdvancedFm::doDelete() { if( fi.fileName().find("../",0,TRUE)==-1) { -// odebug << "remove link files "+myFile << oendl; +// odebug << "remove link files "+myFile << oendl; @@ -212,3 +212,3 @@ void AdvancedFm::doDelete() { lnk = new DocLnk(f); -// odebug << "Deleting doclnk " + lnk->linkFile() << oendl; +// odebug << "Deleting doclnk " + lnk->linkFile() << oendl; if(lnk->isValid()) @@ -248,6 +248,6 @@ void AdvancedFm::doProperties() { -// odebug << "" << curFileList.count() << "" << oendl; +// odebug << "" << curFileList.count() << "" << oendl; for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { -// odebug << (filePath+*it) << oendl; +// odebug << (filePath+*it) << oendl; DocLnk lnk( (filePath+*it)); @@ -304,4 +304,4 @@ void AdvancedFm::copy() { -// odebug << "Destination file is "+destFile << oendl; -// odebug << "CurrentFile file is " + curFile << oendl; +// odebug << "Destination file is "+destFile << oendl; +// odebug << "CurrentFile file is " + curFile << oendl; @@ -428,3 +428,3 @@ void AdvancedFm::copySameDir() { -// odebug << "copy "+curFile+" as "+destFile << oendl; +// odebug << "copy "+curFile+" as "+destFile << oendl; } @@ -454,3 +454,3 @@ void AdvancedFm::move() { destFile += item; -// odebug << "Destination file is "+destFile << oendl; +// odebug << "Destination file is "+destFile << oendl; @@ -460,3 +460,3 @@ void AdvancedFm::move() { curFile+= item; -// odebug << "CurrentFile file is " + curFile << oendl; +// odebug << "CurrentFile file is " + curFile << oendl; @@ -506,3 +506,3 @@ bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { QString cmd = "/bin/cp -fpR " + src + " " + dest; - owarn << cmd << oendl; + owarn << cmd << oendl; int err = system( (const char *) cmd ); @@ -539,3 +539,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { if(!srcFile.open( IO_ReadOnly|IO_Raw)) { -// owarn << "open failed" << oendl; +// owarn << "open failed" << oendl; return success = false; @@ -546,3 +546,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { -// owarn << "destfile open failed" << oendl; +// owarn << "destfile open failed" << oendl; return success = false; @@ -561,3 +561,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { success = false; -// owarn << msg << oendl; +// owarn << msg << oendl; } @@ -593,3 +593,3 @@ void AdvancedFm::runCommand() { if( fileDlg->result() == 1 ) { -// odebug << fileDlg->LineEdit1->text() << oendl; +// odebug << fileDlg->LineEdit1->text() << oendl; QStringList command; @@ -676,3 +676,3 @@ void AdvancedFm::mkSym() { cmd = "ln -s "+curFile+" "+destName; -// odebug << cmd << oendl; +// odebug << cmd << oendl; startProcess( (const QString)cmd ); @@ -726,3 +726,3 @@ void AdvancedFm::startProcess(const QString & cmd) { if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) - odebug << "could not start process" << oendl; + odebug << "could not start process" << oendl; } @@ -734,3 +734,3 @@ void AdvancedFm::processEnded(OProcess *) { void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { -// owarn << "received stderrt " << buflen << " bytes" << oendl; +// owarn << "received stderrt " << buflen << " bytes" << oendl; @@ -759,11 +759,13 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { } -/* if ( o->inherits( "QListView" ) ) { + if ( o->inherits( "QListView" ) ) { if ( e->type() == QEvent::FocusIn ) { -// if( o == Local_View) { //keep track of which view -// qDebug("local view"); -// whichTab = 1; -// } else { -// whichTab = 2; -// qDebug("remote view"); -// } + if( o == Local_View) { //keep track of which view + whichTab = 1; + viewMenu->setItemChecked(viewMenu->idAt(0), true); + viewMenu->setItemChecked(viewMenu->idAt(1), false); + } else { + whichTab = 2; + viewMenu->setItemChecked(viewMenu->idAt(0), false); + viewMenu->setItemChecked(viewMenu->idAt(1), true); + } } @@ -771,3 +773,3 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { } -*/ + return QWidget::eventFilter( o, e ); @@ -777,3 +779,3 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { void AdvancedFm::cancelRename() { -// odebug << "cancel rename" << oendl; +// odebug << "cancel rename" << oendl; QListView * view; |