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 /noncore | |
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 | 74 | ||||
-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 | 8 |
4 files changed, 58 insertions, 29 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 @@ -11,8 +11,9 @@ ***************************************************************************/ #define DEVELOPERS_VERSION #include "advancedfm.h" +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/mimetype.h> #include <qpe/applnk.h> @@ -42,14 +43,22 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); initConnections(); + whichTab=1; - rePopulate(); - currentPathCombo->setFocus(); + 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(); } AdvancedFm::~AdvancedFm() { } @@ -65,14 +74,19 @@ void AdvancedFm::cleanUp() { if(file.exists()) file.remove(); } -void AdvancedFm::tabChanged(QWidget *) { -// owarn << "tab changed" << oendl; +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); } else { viewMenu->setItemChecked(viewMenu->idAt(0), false); @@ -83,20 +97,24 @@ void AdvancedFm::tabChanged(QWidget *) { setCaption(tr("AdvancedFm :: ")+fs+" :: " +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); chdir( path.latin1()); + if( wd == Local_View) { + Remote_View->clearFocus(); + } else { + Local_View->clearFocus(); + } + } void AdvancedFm::populateView() { -// owarn << "PopulateView" << oendl; QPixmap pm; QListView *thisView = CurrentView(); QDir *thisDir = CurrentDir(); QString path = thisDir->canonicalPath(); -//owarn << "path is "+path << oendl; thisView->clear(); thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); thisDir->setMatchAllDirs(TRUE); thisDir->setNameFilter(filterStr); @@ -214,9 +232,14 @@ void AdvancedFm::rePopulate() { // TabWidget->setCurrentWidget( tmpTab - 1); } void AdvancedFm::ListClicked(QListViewItem *selectedItem) { -//owarn << "listclicked" << oendl; + if ( TabWidget->currentWidget() == tab) + qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); + else + qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); + + if(selectedItem) { QString strItem=selectedItem->text(0); // owarn << strItem << oendl; QString strSize=selectedItem->text(1); @@ -245,29 +268,31 @@ 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: { if(renameBox != 0 ) { cancelRename(); } } break; +// case 2: +// menuTimer.start( 50, TRUE ); +// break; }; } 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(); } @@ -289,9 +314,10 @@ 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() ) { currentPathCombo->clear(); localDirPathStringList.prepend( currentPath ); @@ -756,26 +782,35 @@ 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; } else { return ¤tRemoteDir; } } QDir *AdvancedFm::OtherDir() { +// if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { return ¤tRemoteDir; } else { return ¤tDir; } } 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 { // owarn << "CurrentView Tab 2" << oendl; return Remote_View; @@ -789,9 +824,9 @@ QListView * AdvancedFm::OtherView() { return Local_View; } void AdvancedFm::setOtherTabCurrent() { -// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; + qDebug("setOtherTabCurrent() %d",whichTab); if ( whichTab == 1) { TabWidget->setCurrentWidget(1); } else { TabWidget->setCurrentWidget(0); @@ -816,9 +851,9 @@ 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(); if(QDir( curDir).exists() ) { thisDir->setPath( curDir ); @@ -856,17 +891,8 @@ void AdvancedFm::slotSwitchMenu(int ) { // odebug << "Switch " << item << "" << oendl; // viewMenu->setItemChecked(item, true); } -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; doDirChange(); } 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 @@ -128,11 +128,11 @@ protected: QDir *OtherDir(); QListView *CurrentView(); QListView *OtherView(); void setOtherTabCurrent(); - void dealWithSchmooSchmaa(QWidget *); protected slots: + void openSearch(); void dirMenuSelected(int); void showFileMenu(); void homeButtonPushed(); @@ -155,8 +155,9 @@ protected slots: void fileBeamFinished( Ir *); bool copyDirectory( const QString & , const QString & ); // void navigateToSelected(); bool moveDirectory( const QString & , const QString & ); + // void slotSwitchtoLocal(int); private: MenuButton *menuButton; 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 @@ -4,9 +4,9 @@ HEADERS = advancedfm.h filePermissions.h output.h SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp TARGET = advancedfm INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 -lopieui2 +LIBS += -lqpe -lqte -lopiecore2 -lopieui2 !contains(CONFIG,quick-app) { DESTDIR = $(OPIEDIR)/bin DEFINES += NOQUICKLAUNCH 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 @@ -333,9 +333,8 @@ void AdvancedFm::copy() { } } void AdvancedFm::copyAs() { - qApp->processEvents(); QStringList curFileList = getPath(); QString curFile, item; InputDialog *fileDlg; @@ -379,8 +378,10 @@ void AdvancedFm::copyAs() { } rePopulate(); setOtherTabCurrent(); + qApp->processEvents(); + } void AdvancedFm::copySameDir() { qApp->processEvents(); @@ -753,12 +754,13 @@ 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 + qDebug("local view"); whichTab=1; - } - else { + } else { whichTab=2; + qDebug("remote view"); } } OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection } |