summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
Unidiff
Diffstat (limited to 'noncore/apps/advancedfm') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp74
-rw-r--r--noncore/apps/advancedfm/advancedfm.h3
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro2
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp8
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
@@ -3,24 +3,25 @@
3 ------------------- 3 -------------------
4 ** Created: Sat Mar 9 23:33:09 2002 4 ** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#define DEVELOPERS_VERSION 12#define DEVELOPERS_VERSION
13#include "advancedfm.h" 13#include "advancedfm.h"
14 14
15#include <opie2/odebug.h>
15#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
16#include <qpe/config.h> 17#include <qpe/config.h>
17#include <qpe/mimetype.h> 18#include <qpe/mimetype.h>
18#include <qpe/applnk.h> 19#include <qpe/applnk.h>
19#include <qpe/resource.h> 20#include <qpe/resource.h>
20#include <qpe/menubutton.h> 21#include <qpe/menubutton.h>
21 22
22#include <qcombobox.h> 23#include <qcombobox.h>
23#include <qpopupmenu.h> 24#include <qpopupmenu.h>
24#include <qlistview.h> 25#include <qlistview.h>
25#include <qmessagebox.h> 26#include <qmessagebox.h>
26#include <qlineedit.h> 27#include <qlineedit.h>
@@ -34,77 +35,94 @@
34#include <mntent.h> 35#include <mntent.h>
35 36
36using namespace Opie::Ui; 37using namespace Opie::Ui;
37 38
38AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) 39AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
39 : QMainWindow( ) { 40 : QMainWindow( ) {
40 init(); 41 init();
41 renameBox = 0; 42 renameBox = 0;
42 43
43 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 44 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
44 45
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 );
50 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), 53 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
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}
53 62
54AdvancedFm::~AdvancedFm() { 63AdvancedFm::~AdvancedFm() {
55} 64}
56 65
57 66
58void AdvancedFm::cleanUp() { 67void AdvancedFm::cleanUp() {
59 QString sfile=QDir::homeDirPath(); 68 QString sfile=QDir::homeDirPath();
60 if(sfile.right(1) != "/") 69 if(sfile.right(1) != "/")
61 sfile+="/._temp"; 70 sfile+="/._temp";
62 else 71 else
63 sfile+="._temp"; 72 sfile+="._temp";
64 QFile file( sfile); 73 QFile file( sfile);
65 if(file.exists()) 74 if(file.exists())
66 file.remove(); 75 file.remove();
67} 76}
68 77
69void AdvancedFm::tabChanged(QWidget *) { 78void 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();
72 currentPathCombo->lineEdit()->setText( path ); 85 currentPathCombo->lineEdit()->setText( path );
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);
76 viewMenu->setItemChecked(viewMenu->idAt(1), false); 90 viewMenu->setItemChecked(viewMenu->idAt(1), false);
77 } else { 91 } else {
78 viewMenu->setItemChecked(viewMenu->idAt(0), false); 92 viewMenu->setItemChecked(viewMenu->idAt(0), false);
79 viewMenu->setItemChecked(viewMenu->idAt(1), true); 93 viewMenu->setItemChecked(viewMenu->idAt(1), true);
80 } 94 }
81 95
82 QString fs= getFileSystemType( (const QString &) path); 96 QString fs= getFileSystemType( (const QString &) path);
83 97
84 setCaption(tr("AdvancedFm :: ")+fs+" :: " 98 setCaption(tr("AdvancedFm :: ")+fs+" :: "
85 +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); 99 +checkDiskSpace( (const QString &) path )+ tr(" kB free") );
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}
88 108
89 109
90void AdvancedFm::populateView() { 110void AdvancedFm::populateView() {
91 111
92// owarn << "PopulateView" << oendl;
93 QPixmap pm; 112 QPixmap pm;
94 QListView *thisView = CurrentView(); 113 QListView *thisView = CurrentView();
95 QDir *thisDir = CurrentDir(); 114 QDir *thisDir = CurrentDir();
96 QString path = thisDir->canonicalPath(); 115 QString path = thisDir->canonicalPath();
97 116
98//owarn << "path is "+path << oendl;
99 thisView->clear(); 117 thisView->clear();
100 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 118 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
101 thisDir->setMatchAllDirs(TRUE); 119 thisDir->setMatchAllDirs(TRUE);
102 thisDir->setNameFilter(filterStr); 120 thisDir->setNameFilter(filterStr);
103 QString fileL, fileS, fileDate; 121 QString fileL, fileS, fileDate;
104 QString fs= getFileSystemType((const QString &) path); 122 QString fs= getFileSystemType((const QString &) path);
105 setCaption(tr("AdvancedFm :: ")+fs+" :: " 123 setCaption(tr("AdvancedFm :: ")+fs+" :: "
106 +checkDiskSpace((const QString &) path)+ tr(" kB free") ); 124 +checkDiskSpace((const QString &) path)+ tr(" kB free") );
107 bool isDir=FALSE; 125 bool isDir=FALSE;
108 const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 126 const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
109 QFileInfoListIterator it(*list); 127 QFileInfoListIterator it(*list);
110 QFileInfo *fi; 128 QFileInfo *fi;
@@ -206,25 +224,30 @@ void AdvancedFm::rePopulate() {
206 224
207// int tmpTab = whichTab; 225// int tmpTab = whichTab;
208// // odebug << "" << tmpTab << "" << oendl; 226// // odebug << "" << tmpTab << "" << oendl;
209 227
210// for(int i =1; i < 3; i++) { 228// for(int i =1; i < 3; i++) {
211// TabWidget->setCurrentWidget(i - 1); 229// TabWidget->setCurrentWidget(i - 1);
212// populateView(); 230// populateView();
213// } 231// }
214// TabWidget->setCurrentWidget( tmpTab - 1); 232// TabWidget->setCurrentWidget( tmpTab - 1);
215} 233}
216 234
217void AdvancedFm::ListClicked(QListViewItem *selectedItem) { 235void 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) {
220 QString strItem=selectedItem->text(0); 243 QString strItem=selectedItem->text(0);
221// owarn << strItem << oendl; 244// owarn << strItem << oendl;
222 QString strSize=selectedItem->text(1); 245 QString strSize=selectedItem->text(1);
223 strSize=strSize.stripWhiteSpace(); 246 strSize=strSize.stripWhiteSpace();
224 bool isDirectory = false; 247 bool isDirectory = false;
225 QString strItem2; 248 QString strItem2;
226 249
227 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink 250 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink
228 strItem2 = dealWithSymName((const QString&)strItem); 251 strItem2 = dealWithSymName((const QString&)strItem);
229 if(QDir(strItem2).exists() ) 252 if(QDir(strItem2).exists() )
230 strItem = strItem2; 253 strItem = strItem2;
@@ -237,69 +260,72 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) {
237 } 260 }
238 261
239 if( isDirectory ) { 262 if( isDirectory ) {
240 CurrentDir()->cd( strItem, TRUE); 263 CurrentDir()->cd( strItem, TRUE);
241 populateView(); 264 populateView();
242 CurrentView()->ensureItemVisible( CurrentView()->firstChild()); 265 CurrentView()->ensureItemVisible( CurrentView()->firstChild());
243 } 266 }
244 chdir( strItem.latin1()); 267 chdir( strItem.latin1());
245 } 268 }
246} 269}
247 270
248void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { 271void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) {
249 dealWithSchmooSchmaa( item->listView()); 272 Q_UNUSED(item);
250 switch (mouse) { 273 switch (mouse) {
251 case 1: 274 case 1:
252 { 275 {
253 if(renameBox != 0 ) { 276 if(renameBox != 0 ) {
254 cancelRename(); 277 cancelRename();
255 } 278 }
256 } 279 }
257 break; 280 break;
281// case 2:
282// menuTimer.start( 50, TRUE );
283// break;
258 }; 284 };
259} 285}
260 286
261 287
262void AdvancedFm::switchToLocalTab() { 288void 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}
267 293
268void AdvancedFm::switchToRemoteTab() { 294void AdvancedFm::switchToRemoteTab() {
269//owarn << "switch to local view" << oendl;
270 TabWidget->setCurrentWidget(1); 295 TabWidget->setCurrentWidget(1);
271 Remote_View->setFocus(); 296 Remote_View->setFocus();
272} 297}
273 298
274void AdvancedFm::readConfig() { 299void AdvancedFm::readConfig() {
275 Config cfg("AdvancedFm"); 300 Config cfg("AdvancedFm");
276} 301}
277 302
278void AdvancedFm::writeConfig() { 303void AdvancedFm::writeConfig() {
279 Config cfg("AdvancedFm"); 304 Config cfg("AdvancedFm");
280} 305}
281 306
282void AdvancedFm::currentPathComboChanged() { 307void AdvancedFm::currentPathComboChanged() {
283 if(QDir( currentPathCombo->lineEdit()->text()).exists()) { 308 if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
284 CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); 309 CurrentDir()->setPath( currentPathCombo->lineEdit()->text() );
285 populateView(); 310 populateView();
286 } else { 311 } else {
287 QMessageBox::message(tr("Note"),tr("That directory does not exist")); 312 QMessageBox::message(tr("Note"),tr("That directory does not exist"));
288 } 313 }
289} 314}
290 315
291void AdvancedFm::fillCombo(const QString &currentPath) { 316void AdvancedFm::fillCombo(const QString &currentPath) {
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);
295 if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { 321 if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) {
296 currentPathCombo->clear(); 322 currentPathCombo->clear();
297 localDirPathStringList.prepend( currentPath ); 323 localDirPathStringList.prepend( currentPath );
298 currentPathCombo->insertStringList( localDirPathStringList,-1); 324 currentPathCombo->insertStringList( localDirPathStringList,-1);
299 } 325 }
300 } else { 326 } else {
301 currentPathCombo->lineEdit()->setText( currentPath); 327 currentPathCombo->lineEdit()->setText( currentPath);
302 if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { 328 if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) {
303 currentPathCombo->clear(); 329 currentPathCombo->clear();
304 remoteDirPathStringList.prepend( currentPath ); 330 remoteDirPathStringList.prepend( currentPath );
305 currentPathCombo->insertStringList( remoteDirPathStringList,-1); 331 currentPathCombo->insertStringList( remoteDirPathStringList,-1);
@@ -748,58 +774,67 @@ void AdvancedFm::gotoCustomDir(const QString &dir) {
748// if(QDir( curDir).exists() ) 774// if(QDir( curDir).exists() )
749// { 775// {
750// thisDir->setPath( curDir ); 776// thisDir->setPath( curDir );
751// chdir( curDir.latin1() ); 777// chdir( curDir.latin1() );
752// thisDir->cd( curDir, TRUE); 778// thisDir->cd( curDir, TRUE);
753// populateView(); 779// populateView();
754// } 780// }
755 } 781 }
756} 782}
757 783
758QDir *AdvancedFm::CurrentDir() { 784QDir *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) {
761 return &currentDir; 792 return &currentDir;
762 } else { 793 } else {
763 return &currentRemoteDir; 794 return &currentRemoteDir;
764 } 795 }
765} 796}
766 797
767QDir *AdvancedFm::OtherDir() { 798QDir *AdvancedFm::OtherDir() {
799 // if ( TabWidget->currentWidget() == tab) {
768 if ( whichTab == 1) { 800 if ( whichTab == 1) {
769 return &currentRemoteDir; 801 return &currentRemoteDir;
770 } else { 802 } else {
771 return &currentDir; 803 return &currentDir;
772 } 804 }
773} 805}
774 806
775QListView * AdvancedFm::CurrentView() { 807QListView * 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;
779 } else { 814 } else {
780// owarn << "CurrentView Tab 2" << oendl; 815// owarn << "CurrentView Tab 2" << oendl;
781 return Remote_View; 816 return Remote_View;
782 } 817 }
783} 818}
784 819
785QListView * AdvancedFm::OtherView() { 820QListView * AdvancedFm::OtherView() {
786 if ( whichTab == 1) 821 if ( whichTab == 1)
787 return Remote_View; 822 return Remote_View;
788 else 823 else
789 return Local_View; 824 return Local_View;
790} 825}
791 826
792void AdvancedFm::setOtherTabCurrent() { 827void AdvancedFm::setOtherTabCurrent() {
793// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; 828 qDebug("setOtherTabCurrent() %d",whichTab);
794 if ( whichTab == 1) { 829 if ( whichTab == 1) {
795 TabWidget->setCurrentWidget(1); 830 TabWidget->setCurrentWidget(1);
796 } else { 831 } else {
797 TabWidget->setCurrentWidget(0); 832 TabWidget->setCurrentWidget(0);
798 } 833 }
799 OtherView()->setFocus(); 834 OtherView()->setFocus();
800 OtherView()->setSelected( CurrentView()->firstChild(), true); 835 OtherView()->setSelected( CurrentView()->firstChild(), true);
801} 836}
802 837
803void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { 838void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
804// odebug << "qcop message "+msg << oendl; 839// odebug << "qcop message "+msg << oendl;
805 QDataStream stream ( data, IO_ReadOnly ); 840 QDataStream stream ( data, IO_ReadOnly );
@@ -808,25 +843,25 @@ void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
808 QString file; 843 QString file;
809 stream >> file; 844 stream >> file;
810 gotoDirectory( (const QString &) file); 845 gotoDirectory( (const QString &) file);
811 } 846 }
812} 847}
813 848
814void AdvancedFm::setDocument(const QString &file) { 849void AdvancedFm::setDocument(const QString &file) {
815 gotoDirectory( file); 850 gotoDirectory( file);
816 851
817} 852}
818 853
819void AdvancedFm::gotoDirectory(const QString &file) { 854void AdvancedFm::gotoDirectory(const QString &file) {
820// owarn << "goto dir "+file << oendl; 855 qDebug("goto dir "+file);
821 QString curDir = file; 856 QString curDir = file;
822 QDir *thisDir = CurrentDir(); 857 QDir *thisDir = CurrentDir();
823 if(QDir( curDir).exists() ) { 858 if(QDir( curDir).exists() ) {
824 thisDir->setPath( curDir ); 859 thisDir->setPath( curDir );
825 chdir( curDir.latin1() ); 860 chdir( curDir.latin1() );
826 thisDir->cd( curDir, TRUE); 861 thisDir->cd( curDir, TRUE);
827 populateView(); 862 populateView();
828 } 863 }
829 else if(QFileInfo(curDir).exists()) { 864 else if(QFileInfo(curDir).exists()) {
830 QFileInfo fileInfo(curDir); 865 QFileInfo fileInfo(curDir);
831 curDir=fileInfo.dirPath(); 866 curDir=fileInfo.dirPath();
832 if(QDir( curDir).exists() ) { 867 if(QDir( curDir).exists() ) {
@@ -848,25 +883,16 @@ void AdvancedFm::findFile(const QString &fileName) {
848 if(it.current()->text(0) == fi.fileName()) { 883 if(it.current()->text(0) == fi.fileName()) {
849 it.current()->setSelected(true); 884 it.current()->setSelected(true);
850 thisView->ensureItemVisible(it.current()); 885 thisView->ensureItemVisible(it.current());
851 } 886 }
852 } 887 }
853} 888}
854 889
855void AdvancedFm::slotSwitchMenu(int ) { 890void AdvancedFm::slotSwitchMenu(int ) {
856// odebug << "Switch " << item << "" << oendl; 891// odebug << "Switch " << item << "" << oendl;
857 // viewMenu->setItemChecked(item, true); 892 // viewMenu->setItemChecked(item, true);
858} 893}
859 894
860void 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
869void AdvancedFm::navigateToSelected() { 895void AdvancedFm::navigateToSelected() {
870 if( !CurrentView()->currentItem()) return; 896 if( !CurrentView()->currentItem()) return;
871 doDirChange(); 897 doDirChange();
872} 898}
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
@@ -120,51 +120,52 @@ protected:
120 void keyReleaseEvent( QKeyEvent *); 120 void keyReleaseEvent( QKeyEvent *);
121 void keyPressEvent( QKeyEvent *); 121 void keyPressEvent( QKeyEvent *);
122 QString getFileSystemType(const QString &); 122 QString getFileSystemType(const QString &);
123 QString getDiskSpace(const QString &); 123 QString getDiskSpace(const QString &);
124 void parsetab(const QString &fileName); 124 void parsetab(const QString &fileName);
125 QString checkDiskSpace(const QString &); 125 QString checkDiskSpace(const QString &);
126 QString dealWithSymName(const QString &); 126 QString dealWithSymName(const QString &);
127 QDir *CurrentDir(); 127 QDir *CurrentDir();
128 QDir *OtherDir(); 128 QDir *OtherDir();
129 QListView *CurrentView(); 129 QListView *CurrentView();
130 QListView *OtherView(); 130 QListView *OtherView();
131 void setOtherTabCurrent(); 131 void setOtherTabCurrent();
132 void dealWithSchmooSchmaa(QWidget *);
133 132
134protected slots: 133protected slots:
134
135 void openSearch(); 135 void openSearch();
136 void dirMenuSelected(int); 136 void dirMenuSelected(int);
137 void showFileMenu(); 137 void showFileMenu();
138 void homeButtonPushed(); 138 void homeButtonPushed();
139 void docButtonPushed(); 139 void docButtonPushed();
140 void SDButtonPushed(); 140 void SDButtonPushed();
141 void CFButtonPushed(); 141 void CFButtonPushed();
142 void QPEButtonPushed(); 142 void QPEButtonPushed();
143 void upDir(); 143 void upDir();
144 void currentPathComboChanged(); 144 void currentPathComboChanged();
145 void copy(); 145 void copy();
146 void copyAs(); 146 void copyAs();
147 void copySameDir(); 147 void copySameDir();
148 void currentPathComboActivated(const QString &); 148 void currentPathComboActivated(const QString &);
149 void fillCombo(const QString &); 149 void fillCombo(const QString &);
150 bool copyFile( const QString & , const QString & ); 150 bool copyFile( const QString & , const QString & );
151 void move(); 151 void move();
152 void fileStatus(); 152 void fileStatus();
153 void doAbout(); 153 void doAbout();
154 void doBeam(); 154 void doBeam();
155 void fileBeamFinished( Ir *); 155 void fileBeamFinished( Ir *);
156 bool copyDirectory( const QString & , const QString & ); 156 bool copyDirectory( const QString & , const QString & );
157// void navigateToSelected(); 157// void navigateToSelected();
158 bool moveDirectory( const QString & , const QString & ); 158 bool moveDirectory( const QString & , const QString & );
159
159// void slotSwitchtoLocal(int); 160// void slotSwitchtoLocal(int);
160 161
161private: 162private:
162 MenuButton *menuButton; 163 MenuButton *menuButton;
163 QString oldName; 164 QString oldName;
164 void startProcess(const QString &); 165 void startProcess(const QString &);
165 bool eventFilter( QObject * , QEvent * ); 166 bool eventFilter( QObject * , QEvent * );
166 void cancelRename(); 167 void cancelRename();
167 void doRename(QListView *); 168 void doRename(QListView *);
168 void okRename(); 169 void okRename();
169 void customDirsToMenu(); 170 void customDirsToMenu();
170 void addCustomDir(); 171 void addCustomDir();
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
@@ -1,15 +1,15 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qt warn_on quick-app 2CONFIG += qt warn_on quick-app
3HEADERS = advancedfm.h filePermissions.h output.h 3HEADERS = advancedfm.h filePermissions.h output.h
4SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp 4SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp
5TARGET = advancedfm 5TARGET = advancedfm
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
7DEPENDPATH += $(OPIEDIR)/include 7DEPENDPATH += $(OPIEDIR)/include
8LIBS += -lqpe -lopiecore2 -lopieui2 8LIBS += -lqpe -lqte -lopiecore2 -lopieui2
9 9
10!contains(CONFIG,quick-app) { 10!contains(CONFIG,quick-app) {
11 DESTDIR = $(OPIEDIR)/bin 11 DESTDIR = $(OPIEDIR)/bin
12 DEFINES += NOQUICKLAUNCH 12 DEFINES += NOQUICKLAUNCH
13} 13}
14 14
15include ( $(OPIEDIR)/include.pro ) 15include ( $(OPIEDIR)/include.pro )
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
@@ -325,25 +325,24 @@ void AdvancedFm::copy() {
325 if( !copyFile( curFile, destFile) ) { 325 if( !copyFile( curFile, destFile) ) {
326 QMessageBox::message("AdvancedFm", 326 QMessageBox::message("AdvancedFm",
327 tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); 327 tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) );
328 return; 328 return;
329 } 329 }
330 } 330 }
331 setOtherTabCurrent(); 331 setOtherTabCurrent();
332 rePopulate(); 332 rePopulate();
333 } 333 }
334} 334}
335 335
336void AdvancedFm::copyAs() { 336void AdvancedFm::copyAs() {
337 qApp->processEvents();
338 337
339 QStringList curFileList = getPath(); 338 QStringList curFileList = getPath();
340 QString curFile, item; 339 QString curFile, item;
341 InputDialog *fileDlg; 340 InputDialog *fileDlg;
342 341
343 QDir *thisDir = CurrentDir(); 342 QDir *thisDir = CurrentDir();
344 QDir *thatDir = OtherDir(); 343 QDir *thatDir = OtherDir();
345 344
346 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 345 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
347 QString destFile; 346 QString destFile;
348 item=(*it); 347 item=(*it);
349 curFile = thisDir->canonicalPath()+"/"+(*it); 348 curFile = thisDir->canonicalPath()+"/"+(*it);
@@ -371,24 +370,26 @@ void AdvancedFm::copyAs() {
371 } 370 }
372 if( !copyFile( curFile, destFile) ) { 371 if( !copyFile( curFile, destFile) ) {
373 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 372 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
374 +curFile +tr("to\n")+destFile); 373 +curFile +tr("to\n")+destFile);
375 return; 374 return;
376 } 375 }
377 } 376 }
378 delete fileDlg; 377 delete fileDlg;
379 378
380 } 379 }
381 rePopulate(); 380 rePopulate();
382 setOtherTabCurrent(); 381 setOtherTabCurrent();
382 qApp->processEvents();
383
383} 384}
384 385
385void AdvancedFm::copySameDir() { 386void AdvancedFm::copySameDir() {
386 qApp->processEvents(); 387 qApp->processEvents();
387 QStringList curFileList = getPath(); 388 QStringList curFileList = getPath();
388 QString curFile, item, destFile; 389 QString curFile, item, destFile;
389 InputDialog *fileDlg; 390 InputDialog *fileDlg;
390 391
391 QDir *thisDir = CurrentDir(); 392 QDir *thisDir = CurrentDir();
392 393
393 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 394 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
394 item=(*it); 395 item=(*it);
@@ -745,28 +746,29 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
745 cancelRename(); 746 cancelRename();
746 return true; 747 return true;
747 } 748 }
748 } 749 }
749 else if ( e->type() == QEvent::FocusOut ) { 750 else if ( e->type() == QEvent::FocusOut ) {
750 cancelRename(); 751 cancelRename();
751 return true; 752 return true;
752 } 753 }
753 } 754 }
754 if ( o->inherits( "QListView" ) ) { 755 if ( o->inherits( "QListView" ) ) {
755 if ( e->type() == QEvent::FocusIn ) { 756 if ( e->type() == QEvent::FocusIn ) {
756 if( o == Local_View) { //keep track of which view 757 if( o == Local_View) { //keep track of which view
758 qDebug("local view");
757 whichTab=1; 759 whichTab=1;
758 } 760 } else {
759 else {
760 whichTab=2; 761 whichTab=2;
762 qDebug("remote view");
761 } 763 }
762 } 764 }
763 OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection 765 OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection
764 } 766 }
765 767
766 return QWidget::eventFilter( o, e ); 768 return QWidget::eventFilter( o, e );
767} 769}
768 770
769 771
770void AdvancedFm::cancelRename() { 772void AdvancedFm::cancelRename() {
771// odebug << "cancel rename" << oendl; 773// odebug << "cancel rename" << oendl;
772 QListView * view; 774 QListView * view;