Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 74 |
1 files changed, 50 insertions, 24 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 @@ | |||
14 | 14 | ||
15 | #include <opie2/odebug.h> | ||
15 | #include <qpe/qpeapplication.h> | 16 | #include <qpe/qpeapplication.h> |
@@ -45,5 +46,7 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) | |||
45 | initConnections(); | 46 | initConnections(); |
47 | |||
46 | whichTab=1; | 48 | whichTab=1; |
47 | rePopulate(); | 49 | populateView(); |
48 | currentPathCombo->setFocus(); | 50 | // rePopulate(); |
51 | // currentPathCombo->setFocus(); | ||
49 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); | 52 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); |
@@ -51,2 +54,8 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) | |||
51 | this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); | 54 | this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); |
55 | |||
56 | // if( CurrentView() == Local_View) | ||
57 | // qDebug("LOCAL VIEW"); | ||
58 | // else | ||
59 | // qDebug("REMOTE VIEW"); | ||
60 | switchToLocalTab(); | ||
52 | } | 61 | } |
@@ -68,4 +77,8 @@ void AdvancedFm::cleanUp() { | |||
68 | 77 | ||
69 | void AdvancedFm::tabChanged(QWidget *) { | 78 | void AdvancedFm::tabChanged(QWidget *wd) { |
70 | // owarn << "tab changed" << oendl; | 79 | if(wd == tab) |
80 | odebug << "LOCAL VIEW SHOWN"<< oendl; | ||
81 | else if(wd == tab_2) | ||
82 | odebug<< "REMOTE VIEW SHOWN"<< oendl; | ||
83 | |||
71 | QString path = CurrentDir()->canonicalPath(); | 84 | QString path = CurrentDir()->canonicalPath(); |
@@ -73,3 +86,4 @@ void AdvancedFm::tabChanged(QWidget *) { | |||
73 | 86 | ||
74 | if(whichTab == 1) { | 87 | if ( TabWidget->currentWidget() == tab) { |
88 | // if(whichTab == 1) { | ||
75 | viewMenu->setItemChecked(viewMenu->idAt(0), true); | 89 | viewMenu->setItemChecked(viewMenu->idAt(0), true); |
@@ -86,2 +100,8 @@ void AdvancedFm::tabChanged(QWidget *) { | |||
86 | chdir( path.latin1()); | 100 | chdir( path.latin1()); |
101 | if( wd == Local_View) { | ||
102 | Remote_View->clearFocus(); | ||
103 | } else { | ||
104 | Local_View->clearFocus(); | ||
105 | } | ||
106 | |||
87 | } | 107 | } |
@@ -91,3 +111,2 @@ void AdvancedFm::populateView() { | |||
91 | 111 | ||
92 | // owarn << "PopulateView" << oendl; | ||
93 | QPixmap pm; | 112 | QPixmap pm; |
@@ -97,3 +116,2 @@ void AdvancedFm::populateView() { | |||
97 | 116 | ||
98 | //owarn << "path is "+path << oendl; | ||
99 | thisView->clear(); | 117 | thisView->clear(); |
@@ -217,3 +235,8 @@ void AdvancedFm::rePopulate() { | |||
217 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { | 235 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { |
218 | //owarn << "listclicked" << oendl; | 236 | if ( TabWidget->currentWidget() == tab) |
237 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); | ||
238 | else | ||
239 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); | ||
240 | |||
241 | |||
219 | if(selectedItem) { | 242 | if(selectedItem) { |
@@ -248,3 +271,3 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) { | |||
248 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { | 271 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { |
249 | dealWithSchmooSchmaa( item->listView()); | 272 | Q_UNUSED(item); |
250 | switch (mouse) { | 273 | switch (mouse) { |
@@ -257,2 +280,5 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in | |||
257 | break; | 280 | break; |
281 | // case 2: | ||
282 | // menuTimer.start( 50, TRUE ); | ||
283 | // break; | ||
258 | }; | 284 | }; |
@@ -262,5 +288,5 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in | |||
262 | void AdvancedFm::switchToLocalTab() { | 288 | void AdvancedFm::switchToLocalTab() { |
263 | //owarn << "switch to local view" << oendl; | ||
264 | TabWidget->setCurrentWidget(0); | 289 | TabWidget->setCurrentWidget(0); |
265 | Local_View->setFocus(); | 290 | Local_View->setFocus(); |
291 | |||
266 | } | 292 | } |
@@ -268,3 +294,2 @@ void AdvancedFm::switchToLocalTab() { | |||
268 | void AdvancedFm::switchToRemoteTab() { | 294 | void AdvancedFm::switchToRemoteTab() { |
269 | //owarn << "switch to local view" << oendl; | ||
270 | TabWidget->setCurrentWidget(1); | 295 | TabWidget->setCurrentWidget(1); |
@@ -292,3 +317,4 @@ void AdvancedFm::fillCombo(const QString ¤tPath) { | |||
292 | 317 | ||
293 | if ( whichTab == 1) { | 318 | if ( TabWidget->currentWidget() == tab) { |
319 | // if ( whichTab == 1) { | ||
294 | currentPathCombo->lineEdit()->setText( currentPath); | 320 | currentPathCombo->lineEdit()->setText( currentPath); |
@@ -759,2 +785,7 @@ QDir *AdvancedFm::CurrentDir() { | |||
759 | 785 | ||
786 | if ( TabWidget->currentWidget() == tab) | ||
787 | qDebug("CurrentTab is Local"); | ||
788 | else | ||
789 | qDebug("CurrentTab is Remote"); | ||
790 | |||
760 | if ( whichTab == 1) { | 791 | if ( whichTab == 1) { |
@@ -767,2 +798,3 @@ QDir *AdvancedFm::CurrentDir() { | |||
767 | QDir *AdvancedFm::OtherDir() { | 798 | QDir *AdvancedFm::OtherDir() { |
799 | // if ( TabWidget->currentWidget() == tab) { | ||
768 | if ( whichTab == 1) { | 800 | if ( whichTab == 1) { |
@@ -775,4 +807,7 @@ QDir *AdvancedFm::OtherDir() { | |||
775 | QListView * AdvancedFm::CurrentView() { | 807 | QListView * AdvancedFm::CurrentView() { |
808 | if ( TabWidget->currentWidget() == tab) | ||
809 | odebug << "CurrentView local" << oendl; | ||
810 | |||
811 | // if ( TabWidget->currentWidget() == tab) { | ||
776 | if ( whichTab == 1) { | 812 | if ( whichTab == 1) { |
777 | // owarn << "CurrentView Tab 1" << oendl; | ||
778 | return Local_View; | 813 | return Local_View; |
@@ -792,3 +827,3 @@ QListView * AdvancedFm::OtherView() { | |||
792 | void AdvancedFm::setOtherTabCurrent() { | 827 | void AdvancedFm::setOtherTabCurrent() { |
793 | // owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; | 828 | qDebug("setOtherTabCurrent() %d",whichTab); |
794 | if ( whichTab == 1) { | 829 | if ( whichTab == 1) { |
@@ -819,3 +854,3 @@ void AdvancedFm::setDocument(const QString &file) { | |||
819 | void AdvancedFm::gotoDirectory(const QString &file) { | 854 | void AdvancedFm::gotoDirectory(const QString &file) { |
820 | // owarn << "goto dir "+file << oendl; | 855 | qDebug("goto dir "+file); |
821 | QString curDir = file; | 856 | QString curDir = file; |
@@ -859,11 +894,2 @@ void AdvancedFm::slotSwitchMenu(int ) { | |||
859 | 894 | ||
860 | void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { | ||
861 | tabChanged( w); | ||
862 | if( w == Local_View) { | ||
863 | Remote_View->clearFocus(); | ||
864 | } else { | ||
865 | Local_View->clearFocus(); | ||
866 | } | ||
867 | } | ||
868 | |||
869 | void AdvancedFm::navigateToSelected() { | 895 | void AdvancedFm::navigateToSelected() { |