-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 | |||
@@ -69,13 +69,13 @@ void AdvancedFm::cleanUp() { | |||
69 | } | 69 | } |
70 | 70 | ||
71 | void AdvancedFm::tabChanged(QWidget *wd) { | 71 | void AdvancedFm::tabChanged(QWidget *wd) { |
72 | // qDebug("tabChanged"); | ||
73 | if(wd == tab) { | 72 | if(wd == tab) { |
74 | whichTab = 1; | 73 | whichTab = 1; |
75 | viewMenu->setItemChecked(viewMenu->idAt(0), true); | 74 | viewMenu->setItemChecked(viewMenu->idAt(0), true); |
76 | viewMenu->setItemChecked(viewMenu->idAt(1), false); | 75 | viewMenu->setItemChecked(viewMenu->idAt(1), false); |
77 | // qDebug("tabchanged: LOCAL VIEW SHOWN"); | 76 | // qDebug("tabchanged: LOCAL VIEW SHOWN"); |
78 | } | 77 | } |
78 | |||
79 | else if(wd == tab_2) { | 79 | else if(wd == tab_2) { |
80 | whichTab = 2; | 80 | whichTab = 2; |
81 | viewMenu->setItemChecked(viewMenu->idAt(0), false); | 81 | viewMenu->setItemChecked(viewMenu->idAt(0), false); |
@@ -84,10 +84,6 @@ void AdvancedFm::tabChanged(QWidget *wd) { | |||
84 | } | 84 | } |
85 | qApp->processEvents(); | 85 | qApp->processEvents(); |
86 | QString path = CurrentDir()->canonicalPath(); | 86 | QString path = CurrentDir()->canonicalPath(); |
87 | // qDebug(path); | ||
88 | if ( TabWidget->currentWidget() == tab) { | ||
89 | } else { | ||
90 | } | ||
91 | 87 | ||
92 | chdir( path.latin1()); | 88 | chdir( path.latin1()); |
93 | currentPathCombo->lineEdit()->setText(path); | 89 | currentPathCombo->lineEdit()->setText(path); |
@@ -266,15 +262,15 @@ void AdvancedFm::refreshCurrentTab() { | |||
266 | } | 262 | } |
267 | 263 | ||
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 | } |
273 | 269 | ||
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 | } |
279 | 275 | ||
280 | void AdvancedFm::currentPathComboChanged() { | 276 | void AdvancedFm::currentPathComboChanged() { |
@@ -758,9 +754,15 @@ void AdvancedFm::setDocument(const QString &file) { | |||
758 | 754 | ||
759 | 755 | ||
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 | } |
765 | 767 | ||
766 | void AdvancedFm::navigateToSelected() { | 768 | void AdvancedFm::navigateToSelected() { |
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 | |||
@@ -757,19 +757,21 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | |||
757 | return true; | 757 | return true; |
758 | } | 758 | } |
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 | } |
770 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection | 772 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection |
771 | } | 773 | } |
772 | */ | 774 | |
773 | return QWidget::eventFilter( o, e ); | 775 | return QWidget::eventFilter( o, e ); |
774 | } | 776 | } |
775 | 777 | ||