-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 30 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 20 |
2 files changed, 27 insertions, 23 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 @@ -66,31 +66,27 @@ void AdvancedFm::cleanUp() { QFile file( sfile); if(file.exists()) file.remove(); } void AdvancedFm::tabChanged(QWidget *wd) { -// qDebug("tabChanged"); if(wd == tab) { whichTab = 1; viewMenu->setItemChecked(viewMenu->idAt(0), true); viewMenu->setItemChecked(viewMenu->idAt(1), false); // qDebug("tabchanged: LOCAL VIEW SHOWN"); } + else if(wd == tab_2) { whichTab = 2; viewMenu->setItemChecked(viewMenu->idAt(0), false); viewMenu->setItemChecked(viewMenu->idAt(1), true); // qDebug("tabchanged: REMOTE VIEW SHOWN"); } qApp->processEvents(); QString path = CurrentDir()->canonicalPath(); -// qDebug(path); - if ( TabWidget->currentWidget() == tab) { - } else { - } chdir( path.latin1()); currentPathCombo->lineEdit()->setText(path); } @@ -263,21 +259,21 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in void AdvancedFm::refreshCurrentTab() { populateView(); // if ( TabWidget->currentWidget() == tab) { } void AdvancedFm::switchToLocalTab() { - TabWidget->setCurrentWidget(0); -// Local_View->setFocus(); - whichTab = 1; + TabWidget->setCurrentWidget(tab); + Local_View->setFocus(); +// whichTab = 1; } void AdvancedFm::switchToRemoteTab() { - TabWidget->setCurrentWidget(1); -// Remote_View->setFocus(); - whichTab = 2; + TabWidget->setCurrentWidget(tab_2); + Remote_View->setFocus(); +// whichTab = 2; } void AdvancedFm::currentPathComboChanged() { QString pDir = currentPathCombo->lineEdit()->text(); if(QDir(pDir).exists()) { CurrentDir()->setPath(pDir ); @@ -755,15 +751,21 @@ void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { void AdvancedFm::setDocument(const QString &file) { changeTo( 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); + } } void AdvancedFm::navigateToSelected() { if( !CurrentView()->currentItem()) return; doDirChange(); } 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 @@ -754,25 +754,27 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { } else if ( e->type() == QEvent::FocusOut ) { cancelRename(); return true; } } -/* 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); + } } OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection } -*/ + return QWidget::eventFilter( o, e ); } void AdvancedFm::cancelRename() { // odebug << "cancel rename" << oendl; |