summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp30
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp20
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() {
}
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);
@@ -84,10 +84,6 @@ void AdvancedFm::tabChanged(QWidget *wd) {
}
qApp->processEvents();
QString path = CurrentDir()->canonicalPath();
-// qDebug(path);
- if ( TabWidget->currentWidget() == tab) {
- } else {
- }
chdir( path.latin1());
currentPathCombo->lineEdit()->setText(path);
@@ -266,15 +262,15 @@ void AdvancedFm::refreshCurrentTab() {
}
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() {
@@ -758,9 +754,15 @@ 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);
+ }
}
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 ) {
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 );
}