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
@@ -68,27 +68,23 @@ void AdvancedFm::cleanUp() {
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);
}
@@ -265,17 +261,17 @@ void AdvancedFm::refreshCurrentTab() {
// 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();
@@ -757,11 +753,17 @@ 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() {
if( !CurrentView()->currentItem()) return;
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
@@ -756,21 +756,23 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
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 );
}