Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 88 |
1 files changed, 57 insertions, 31 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index afb44f5..b4461cb 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -14,2 +14,3 @@ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> @@ -44,9 +45,17 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) - initConnections(); - whichTab=1; - rePopulate(); - currentPathCombo->setFocus(); - channel = new QCopChannel( "QPE/Application/advancedfm", this ); - connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), - this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); + initConnections(); + + whichTab = 1; + populateView(); +// rePopulate(); +// currentPathCombo->setFocus(); + channel = new QCopChannel( "QPE/Application/advancedfm", this ); + connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), + this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); + +// if( CurrentView() == Local_View) +// qDebug("LOCAL VIEW"); +// else +// qDebug("REMOTE VIEW"); + switchToLocalTab(); } @@ -68,8 +77,13 @@ void AdvancedFm::cleanUp() { -void AdvancedFm::tabChanged(QWidget *) { -// owarn << "tab changed" << oendl; - QString path = CurrentDir()->canonicalPath(); +void AdvancedFm::tabChanged(QWidget *wd) { + if(wd == tab) + odebug << "LOCAL VIEW SHOWN"<< oendl; + else if(wd == tab_2) + odebug<< "REMOTE VIEW SHOWN"<< oendl; + + QString path = CurrentDir()->canonicalPath(); currentPathCombo->lineEdit()->setText( path ); - if(whichTab == 1) { + if ( TabWidget->currentWidget() == tab) { +// if(whichTab == 1) { viewMenu->setItemChecked(viewMenu->idAt(0), true); @@ -86,2 +100,8 @@ void AdvancedFm::tabChanged(QWidget *) { chdir( path.latin1()); + if( wd == Local_View) { + Remote_View->clearFocus(); + } else { + Local_View->clearFocus(); + } + } @@ -91,3 +111,2 @@ void AdvancedFm::populateView() { -// owarn << "PopulateView" << oendl; QPixmap pm; @@ -97,3 +116,2 @@ void AdvancedFm::populateView() { -//owarn << "path is "+path << oendl; thisView->clear(); @@ -217,4 +235,9 @@ void AdvancedFm::rePopulate() { void AdvancedFm::ListClicked(QListViewItem *selectedItem) { -//owarn << "listclicked" << oendl; - if(selectedItem) { + if ( TabWidget->currentWidget() == tab) + qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); + else + qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); + + + if(selectedItem) { QString strItem=selectedItem->text(0); @@ -248,3 +271,3 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) { void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { - dealWithSchmooSchmaa( item->listView()); + Q_UNUSED(item); switch (mouse) { @@ -257,2 +280,5 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in break; +// case 2: +// menuTimer.start( 50, TRUE ); +// break; }; @@ -262,5 +288,5 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in void AdvancedFm::switchToLocalTab() { -//owarn << "switch to local view" << oendl; TabWidget->setCurrentWidget(0); Local_View->setFocus(); + } @@ -268,3 +294,2 @@ void AdvancedFm::switchToLocalTab() { void AdvancedFm::switchToRemoteTab() { -//owarn << "switch to local view" << oendl; TabWidget->setCurrentWidget(1); @@ -292,3 +317,4 @@ void AdvancedFm::fillCombo(const QString ¤tPath) { - if ( whichTab == 1) { + if ( TabWidget->currentWidget() == tab) { +// if ( whichTab == 1) { currentPathCombo->lineEdit()->setText( currentPath); @@ -759,2 +785,7 @@ QDir *AdvancedFm::CurrentDir() { + if ( TabWidget->currentWidget() == tab) + qDebug("CurrentTab is Local"); + else + qDebug("CurrentTab is Remote"); + if ( whichTab == 1) { @@ -767,2 +798,3 @@ QDir *AdvancedFm::CurrentDir() { QDir *AdvancedFm::OtherDir() { +// if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { @@ -775,4 +807,7 @@ QDir *AdvancedFm::OtherDir() { QListView * AdvancedFm::CurrentView() { + if ( TabWidget->currentWidget() == tab) + odebug << "CurrentView local" << oendl; + +// if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { -// owarn << "CurrentView Tab 1" << oendl; return Local_View; @@ -792,3 +827,3 @@ QListView * AdvancedFm::OtherView() { void AdvancedFm::setOtherTabCurrent() { -// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; + qDebug("setOtherTabCurrent() %d",whichTab); if ( whichTab == 1) { @@ -819,3 +854,3 @@ void AdvancedFm::setDocument(const QString &file) { void AdvancedFm::gotoDirectory(const QString &file) { -// owarn << "goto dir "+file << oendl; + qDebug("goto dir "+file); QString curDir = file; @@ -859,11 +894,2 @@ void AdvancedFm::slotSwitchMenu(int ) { -void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { - tabChanged( w); - if( w == Local_View) { - Remote_View->clearFocus(); - } else { - Local_View->clearFocus(); - } -} - void AdvancedFm::navigateToSelected() { |