author | llornkcor <llornkcor> | 2004-09-18 09:05:57 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-18 09:05:57 (UTC) |
commit | eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63 (patch) (side-by-side diff) | |
tree | ee914747ae2494d50716ab3cda866613d4eb134c | |
parent | 5096f9bd9f1a06e5238e2206eee195c43a2bdb6b (diff) | |
download | opie-eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63.zip opie-eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63.tar.gz opie-eaf09b9b6e1abbe36e814a8e4da315ac8d96bd63.tar.bz2 |
fix stuff, including #1404
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 88 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 3 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.pro | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 20 |
4 files changed, 71 insertions, 42 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 @@ -13,4 +13,5 @@ #include "advancedfm.h" +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> @@ -43,11 +44,19 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); - 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(); } @@ -67,10 +76,15 @@ 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); viewMenu->setItemChecked(viewMenu->idAt(1), false); @@ -85,4 +99,10 @@ void AdvancedFm::tabChanged(QWidget *) { +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); chdir( path.latin1()); + if( wd == Local_View) { + Remote_View->clearFocus(); + } else { + Local_View->clearFocus(); + } + } @@ -90,5 +110,4 @@ void AdvancedFm::tabChanged(QWidget *) { void AdvancedFm::populateView() { -// owarn << "PopulateView" << oendl; QPixmap pm; QListView *thisView = CurrentView(); @@ -96,5 +115,4 @@ void AdvancedFm::populateView() { QString path = thisDir->canonicalPath(); -//owarn << "path is "+path << oendl; thisView->clear(); thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); @@ -216,6 +234,11 @@ 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); // owarn << strItem << oendl; @@ -247,5 +270,5 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) { void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { - dealWithSchmooSchmaa( item->listView()); + Q_UNUSED(item); switch (mouse) { case 1: @@ -256,4 +279,7 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in } break; +// case 2: +// menuTimer.start( 50, TRUE ); +// break; }; } @@ -261,11 +287,10 @@ 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(); + } void AdvancedFm::switchToRemoteTab() { -//owarn << "switch to local view" << oendl; TabWidget->setCurrentWidget(1); Remote_View->setFocus(); @@ -291,5 +316,6 @@ void AdvancedFm::currentPathComboChanged() { void AdvancedFm::fillCombo(const QString ¤tPath) { - if ( whichTab == 1) { + if ( TabWidget->currentWidget() == tab) { +// if ( whichTab == 1) { currentPathCombo->lineEdit()->setText( currentPath); if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { @@ -758,4 +784,9 @@ void AdvancedFm::gotoCustomDir(const QString &dir) { QDir *AdvancedFm::CurrentDir() { + if ( TabWidget->currentWidget() == tab) + qDebug("CurrentTab is Local"); + else + qDebug("CurrentTab is Remote"); + if ( whichTab == 1) { return ¤tDir; @@ -766,4 +797,5 @@ QDir *AdvancedFm::CurrentDir() { QDir *AdvancedFm::OtherDir() { +// if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { return ¤tRemoteDir; @@ -774,6 +806,9 @@ 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; } else { @@ -791,5 +826,5 @@ QListView * AdvancedFm::OtherView() { void AdvancedFm::setOtherTabCurrent() { -// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; + qDebug("setOtherTabCurrent() %d",whichTab); if ( whichTab == 1) { TabWidget->setCurrentWidget(1); @@ -818,5 +853,5 @@ void AdvancedFm::setDocument(const QString &file) { void AdvancedFm::gotoDirectory(const QString &file) { -// owarn << "goto dir "+file << oendl; + qDebug("goto dir "+file); QString curDir = file; QDir *thisDir = CurrentDir(); @@ -858,13 +893,4 @@ 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() { if( !CurrentView()->currentItem()) return; diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index effda0b..e596977 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -130,7 +130,7 @@ protected: QListView *OtherView(); void setOtherTabCurrent(); - void dealWithSchmooSchmaa(QWidget *); protected slots: + void openSearch(); void dirMenuSelected(int); @@ -157,4 +157,5 @@ protected slots: // void navigateToSelected(); bool moveDirectory( const QString & , const QString & ); + // void slotSwitchtoLocal(int); diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index f1c518e..0644edb 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro @@ -6,5 +6,5 @@ TARGET = advancedfm INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 -lopieui2 +LIBS += -lqpe -lqte -lopiecore2 -lopieui2 !contains(CONFIG,quick-app) { diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 4628170..8d04c68 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -335,5 +335,4 @@ void AdvancedFm::copy() { void AdvancedFm::copyAs() { - qApp->processEvents(); QStringList curFileList = getPath(); @@ -379,6 +378,8 @@ void AdvancedFm::copyAs() { } - rePopulate(); - setOtherTabCurrent(); + rePopulate(); + setOtherTabCurrent(); + qApp->processEvents(); + } @@ -754,10 +755,11 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { if ( o->inherits( "QListView" ) ) { if ( e->type() == QEvent::FocusIn ) { - if( o == Local_View) { //keep track of which view - whichTab=1; - } - else { - whichTab=2; - } + if( o == Local_View) { //keep track of which view + qDebug("local view"); + whichTab = 1; + } else { + whichTab = 2; + qDebug("remote view"); + } } OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection |