-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() { | |||
71 | void AdvancedFm::tabChanged(QWidget *wd) { | 71 | void AdvancedFm::tabChanged(QWidget *wd) { |
72 | // qDebug("tabChanged"); | ||
73 | if(wd == tab) { | 72 | if(wd == tab) { |
@@ -78,2 +77,3 @@ void AdvancedFm::tabChanged(QWidget *wd) { | |||
78 | } | 77 | } |
78 | |||
79 | else if(wd == tab_2) { | 79 | else if(wd == tab_2) { |
@@ -86,6 +86,2 @@ void AdvancedFm::tabChanged(QWidget *wd) { | |||
86 | QString path = CurrentDir()->canonicalPath(); | 86 | QString path = CurrentDir()->canonicalPath(); |
87 | // qDebug(path); | ||
88 | if ( TabWidget->currentWidget() == tab) { | ||
89 | } else { | ||
90 | } | ||
91 | 87 | ||
@@ -268,5 +264,5 @@ void AdvancedFm::refreshCurrentTab() { | |||
268 | void AdvancedFm::switchToLocalTab() { | 264 | void AdvancedFm::switchToLocalTab() { |
269 | TabWidget->setCurrentWidget(0); | 265 | TabWidget->setCurrentWidget(tab); |
270 | // Local_View->setFocus(); | 266 | Local_View->setFocus(); |
271 | whichTab = 1; | 267 | // whichTab = 1; |
272 | } | 268 | } |
@@ -274,5 +270,5 @@ void AdvancedFm::switchToLocalTab() { | |||
274 | void AdvancedFm::switchToRemoteTab() { | 270 | void AdvancedFm::switchToRemoteTab() { |
275 | TabWidget->setCurrentWidget(1); | 271 | TabWidget->setCurrentWidget(tab_2); |
276 | // Remote_View->setFocus(); | 272 | Remote_View->setFocus(); |
277 | whichTab = 2; | 273 | // whichTab = 2; |
278 | } | 274 | } |
@@ -760,5 +756,11 @@ void AdvancedFm::setDocument(const QString &file) { | |||
760 | void AdvancedFm::slotSwitchMenu(int item) { | 756 | void AdvancedFm::slotSwitchMenu(int item) { |
761 | Q_UNUSED(item); | 757 | if(item == -23) { |
762 | // qDebug( "Switch %d",item); | 758 | switchToLocalTab(); |
763 | // viewMenu->setItemChecked(item, true); | 759 | tabChanged( tab); |
760 | } | ||
761 | |||
762 | if(item == -24) { | ||
763 | switchToRemoteTab(); | ||
764 | tabChanged( tab_2); | ||
765 | } | ||
764 | } | 766 | } |
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() { | |||
46 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; | 46 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; |
47 | // owarn << pathItem << oendl; | 47 | // owarn << pathItem << oendl; |
48 | changeTo( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); | 48 | changeTo( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); |
@@ -97,3 +97,3 @@ void AdvancedFm::runThis() { | |||
97 | QFileInfo fileInfo( path + "/" + curFile); | 97 | QFileInfo fileInfo( path + "/" + curFile); |
98 | // odebug << fileInfo.owner() << oendl; | 98 | // odebug << fileInfo.owner() << oendl; |
99 | 99 | ||
@@ -109,3 +109,3 @@ void AdvancedFm::runThis() { | |||
109 | QString execStr = nf.exec(); | 109 | QString execStr = nf.exec(); |
110 | // odebug << execStr << oendl; | 110 | // odebug << execStr << oendl; |
111 | if( execStr.isEmpty() ) { | 111 | if( execStr.isEmpty() ) { |
@@ -207,3 +207,3 @@ void AdvancedFm::doDelete() { | |||
207 | if( fi.fileName().find("../",0,TRUE)==-1) { | 207 | if( fi.fileName().find("../",0,TRUE)==-1) { |
208 | // odebug << "remove link files "+myFile << oendl; | 208 | // odebug << "remove link files "+myFile << oendl; |
209 | 209 | ||
@@ -212,3 +212,3 @@ void AdvancedFm::doDelete() { | |||
212 | lnk = new DocLnk(f); | 212 | lnk = new DocLnk(f); |
213 | // odebug << "Deleting doclnk " + lnk->linkFile() << oendl; | 213 | // odebug << "Deleting doclnk " + lnk->linkFile() << oendl; |
214 | if(lnk->isValid()) | 214 | if(lnk->isValid()) |
@@ -248,6 +248,6 @@ void AdvancedFm::doProperties() { | |||
248 | 248 | ||
249 | // odebug << "" << curFileList.count() << "" << oendl; | 249 | // odebug << "" << curFileList.count() << "" << oendl; |
250 | 250 | ||
251 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 251 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
252 | // odebug << (filePath+*it) << oendl; | 252 | // odebug << (filePath+*it) << oendl; |
253 | DocLnk lnk( (filePath+*it)); | 253 | DocLnk lnk( (filePath+*it)); |
@@ -304,4 +304,4 @@ void AdvancedFm::copy() { | |||
304 | 304 | ||
305 | // odebug << "Destination file is "+destFile << oendl; | 305 | // odebug << "Destination file is "+destFile << oendl; |
306 | // odebug << "CurrentFile file is " + curFile << oendl; | 306 | // odebug << "CurrentFile file is " + curFile << oendl; |
307 | 307 | ||
@@ -428,3 +428,3 @@ void AdvancedFm::copySameDir() { | |||
428 | 428 | ||
429 | // odebug << "copy "+curFile+" as "+destFile << oendl; | 429 | // odebug << "copy "+curFile+" as "+destFile << oendl; |
430 | } | 430 | } |
@@ -454,3 +454,3 @@ void AdvancedFm::move() { | |||
454 | destFile += item; | 454 | destFile += item; |
455 | // odebug << "Destination file is "+destFile << oendl; | 455 | // odebug << "Destination file is "+destFile << oendl; |
456 | 456 | ||
@@ -460,3 +460,3 @@ void AdvancedFm::move() { | |||
460 | curFile+= item; | 460 | curFile+= item; |
461 | // odebug << "CurrentFile file is " + curFile << oendl; | 461 | // odebug << "CurrentFile file is " + curFile << oendl; |
462 | 462 | ||
@@ -506,3 +506,3 @@ bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { | |||
506 | QString cmd = "/bin/cp -fpR " + src + " " + dest; | 506 | QString cmd = "/bin/cp -fpR " + src + " " + dest; |
507 | owarn << cmd << oendl; | 507 | owarn << cmd << oendl; |
508 | int err = system( (const char *) cmd ); | 508 | int err = system( (const char *) cmd ); |
@@ -539,3 +539,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { | |||
539 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { | 539 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { |
540 | // owarn << "open failed" << oendl; | 540 | // owarn << "open failed" << oendl; |
541 | return success = false; | 541 | return success = false; |
@@ -546,3 +546,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { | |||
546 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { | 546 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { |
547 | // owarn << "destfile open failed" << oendl; | 547 | // owarn << "destfile open failed" << oendl; |
548 | return success = false; | 548 | return success = false; |
@@ -561,3 +561,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { | |||
561 | success = false; | 561 | success = false; |
562 | // owarn << msg << oendl; | 562 | // owarn << msg << oendl; |
563 | } | 563 | } |
@@ -593,3 +593,3 @@ void AdvancedFm::runCommand() { | |||
593 | if( fileDlg->result() == 1 ) { | 593 | if( fileDlg->result() == 1 ) { |
594 | // odebug << fileDlg->LineEdit1->text() << oendl; | 594 | // odebug << fileDlg->LineEdit1->text() << oendl; |
595 | QStringList command; | 595 | QStringList command; |
@@ -676,3 +676,3 @@ void AdvancedFm::mkSym() { | |||
676 | cmd = "ln -s "+curFile+" "+destName; | 676 | cmd = "ln -s "+curFile+" "+destName; |
677 | // odebug << cmd << oendl; | 677 | // odebug << cmd << oendl; |
678 | startProcess( (const QString)cmd ); | 678 | startProcess( (const QString)cmd ); |
@@ -726,3 +726,3 @@ void AdvancedFm::startProcess(const QString & cmd) { | |||
726 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) | 726 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) |
727 | odebug << "could not start process" << oendl; | 727 | odebug << "could not start process" << oendl; |
728 | } | 728 | } |
@@ -734,3 +734,3 @@ void AdvancedFm::processEnded(OProcess *) { | |||
734 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { | 734 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { |
735 | // owarn << "received stderrt " << buflen << " bytes" << oendl; | 735 | // owarn << "received stderrt " << buflen << " bytes" << oendl; |
736 | 736 | ||
@@ -759,11 +759,13 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | |||
759 | } | 759 | } |
760 | /* if ( o->inherits( "QListView" ) ) { | 760 | if ( o->inherits( "QListView" ) ) { |
761 | if ( e->type() == QEvent::FocusIn ) { | 761 | if ( e->type() == QEvent::FocusIn ) { |
762 | // if( o == Local_View) { //keep track of which view | 762 | if( o == Local_View) { //keep track of which view |
763 | // qDebug("local view"); | 763 | whichTab = 1; |
764 | // whichTab = 1; | 764 | viewMenu->setItemChecked(viewMenu->idAt(0), true); |
765 | // } else { | 765 | viewMenu->setItemChecked(viewMenu->idAt(1), false); |
766 | // whichTab = 2; | 766 | } else { |
767 | // qDebug("remote view"); | 767 | whichTab = 2; |
768 | // } | 768 | viewMenu->setItemChecked(viewMenu->idAt(0), false); |
769 | viewMenu->setItemChecked(viewMenu->idAt(1), true); | ||
770 | } | ||
769 | } | 771 | } |
@@ -771,3 +773,3 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | |||
771 | } | 773 | } |
772 | */ | 774 | |
773 | return QWidget::eventFilter( o, e ); | 775 | return QWidget::eventFilter( o, e ); |
@@ -777,3 +779,3 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | |||
777 | void AdvancedFm::cancelRename() { | 779 | void AdvancedFm::cancelRename() { |
778 | // odebug << "cancel rename" << oendl; | 780 | // odebug << "cancel rename" << oendl; |
779 | QListView * view; | 781 | QListView * view; |