-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 399 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 79 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.pro | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 60 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 197 |
5 files changed, 361 insertions, 376 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 4de7d38..02898de 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -1,904 +1,897 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | AdvancedFm.cpp | 2 | AdvancedFm.cpp |
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 <opie2/odebug.h> |
16 | #include <qpe/qpeapplication.h> | 16 | #include <qpe/qpeapplication.h> |
17 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
18 | #include <qpe/mimetype.h> | 18 | #include <qpe/mimetype.h> |
19 | #include <qpe/applnk.h> | 19 | #include <qpe/applnk.h> |
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | #include <qpe/menubutton.h> | 21 | #include <qpe/menubutton.h> |
22 | 22 | ||
23 | #include <qcombobox.h> | 23 | #include <qcombobox.h> |
24 | #include <qpopupmenu.h> | 24 | #include <qpopupmenu.h> |
25 | #include <qlistview.h> | 25 | #include <qlistview.h> |
26 | #include <qmessagebox.h> | 26 | #include <qmessagebox.h> |
27 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
28 | 28 | ||
29 | 29 | ||
30 | #include <sys/stat.h> | 30 | #include <sys/stat.h> |
31 | #include <time.h> | 31 | #include <time.h> |
32 | #include <dirent.h> | 32 | #include <dirent.h> |
33 | #include <fcntl.h> | 33 | #include <fcntl.h> |
34 | #include <sys/vfs.h> | 34 | #include <sys/vfs.h> |
35 | #include <mntent.h> | 35 | #include <mntent.h> |
36 | 36 | ||
37 | using namespace Opie::Ui; | 37 | using namespace Opie::Ui; |
38 | 38 | ||
39 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) | 39 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) |
40 | : QMainWindow( ) { | 40 | : QMainWindow( ) { |
41 | init(); | 41 | init(); |
42 | renameBox = 0; | 42 | renameBox = 0; |
43 | 43 | ||
44 | unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 44 | unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() ); |
45 | 45 | ||
46 | initConnections(); | 46 | initConnections(); |
47 | 47 | ||
48 | whichTab = 1; | 48 | whichTab = 1; |
49 | populateView(); | 49 | populateView(); |
50 | // rePopulate(); | 50 | // rePopulate(); |
51 | // currentPathCombo->setFocus(); | 51 | // currentPathCombo->setFocus(); |
52 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); | 52 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); |
53 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 53 | connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&))); |
54 | this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); | ||
55 | 54 | ||
56 | // if( CurrentView() == Local_View) | 55 | // if( CurrentView() == Local_View) |
57 | // qDebug("LOCAL VIEW"); | 56 | // qDebug("LOCAL VIEW"); |
58 | // else | 57 | // else |
59 | // qDebug("REMOTE VIEW"); | 58 | // qDebug("REMOTE VIEW"); |
60 | switchToLocalTab(); | 59 | switchToLocalTab(); |
61 | } | 60 | } |
62 | 61 | ||
63 | AdvancedFm::~AdvancedFm() { | 62 | AdvancedFm::~AdvancedFm() { |
64 | } | 63 | } |
65 | 64 | ||
66 | 65 | ||
67 | void AdvancedFm::cleanUp() { | 66 | void AdvancedFm::cleanUp() { |
68 | QString sfile=QDir::homeDirPath(); | 67 | QString sfile=QDir::homeDirPath(); |
69 | if(sfile.right(1) != "/") | 68 | if(sfile.right(1) != "/") |
70 | sfile+="/._temp"; | 69 | sfile+="/._temp"; |
71 | else | 70 | else |
72 | sfile+="._temp"; | 71 | sfile+="._temp"; |
73 | QFile file( sfile); | 72 | QFile file( sfile); |
74 | if(file.exists()) | 73 | if(file.exists()) |
75 | file.remove(); | 74 | file.remove(); |
76 | } | 75 | } |
77 | 76 | ||
78 | void AdvancedFm::tabChanged(QWidget *wd) { | 77 | void AdvancedFm::tabChanged(QWidget *wd) { |
79 | if(wd == tab) | 78 | // qDebug("tabChanged"); |
80 | odebug << "LOCAL VIEW SHOWN"<< oendl; | 79 | if(wd == tab) { |
81 | else if(wd == tab_2) | 80 | whichTab = 1; |
82 | odebug<< "REMOTE VIEW SHOWN"<< oendl; | 81 | // qDebug("tabchanged: LOCAL VIEW SHOWN"); |
83 | 82 | } | |
84 | QString path = CurrentDir()->canonicalPath(); | 83 | else if(wd == tab_2) { |
85 | currentPathCombo->lineEdit()->setText( path ); | 84 | whichTab = 2; |
86 | 85 | // qDebug("tabchanged: REMOTE VIEW SHOWN"); | |
87 | if ( TabWidget->currentWidget() == tab) { | 86 | } |
88 | // if(whichTab == 1) { | 87 | qApp->processEvents(); |
89 | viewMenu->setItemChecked(viewMenu->idAt(0), true); | 88 | QString path = CurrentDir()->canonicalPath(); |
90 | viewMenu->setItemChecked(viewMenu->idAt(1), false); | 89 | // qDebug(path); |
91 | } else { | 90 | if ( TabWidget->currentWidget() == tab) { |
92 | viewMenu->setItemChecked(viewMenu->idAt(0), false); | 91 | viewMenu->setItemChecked(viewMenu->idAt(0), true); |
93 | viewMenu->setItemChecked(viewMenu->idAt(1), true); | 92 | viewMenu->setItemChecked(viewMenu->idAt(1), false); |
94 | } | 93 | } else { |
95 | 94 | viewMenu->setItemChecked(viewMenu->idAt(0), false); | |
96 | QString fs= getFileSystemType( (const QString &) path); | 95 | viewMenu->setItemChecked(viewMenu->idAt(1), true); |
97 | 96 | } | |
98 | setCaption(tr("AdvancedFm :: ")+fs+" :: " | 97 | |
99 | +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); | 98 | QString fs= getFileSystemType( (const QString &) path); |
100 | chdir( path.latin1()); | 99 | |
101 | if( wd == Local_View) { | 100 | setCaption(tr("AdvancedFm :: ")+fs+" :: " |
102 | Remote_View->clearFocus(); | 101 | +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); |
103 | } else { | 102 | chdir( path.latin1()); |
104 | Local_View->clearFocus(); | 103 | currentPathCombo->lineEdit()->setText(path); |
105 | } | ||
106 | |||
107 | } | 104 | } |
108 | 105 | ||
109 | 106 | ||
110 | void AdvancedFm::populateView() { | 107 | void AdvancedFm::populateView() { |
111 | 108 | ||
112 | QPixmap pm; | 109 | QPixmap pm; |
113 | QListView *thisView = CurrentView(); | 110 | QListView *thisView = CurrentView(); |
114 | QDir *thisDir = CurrentDir(); | 111 | QDir *thisDir = CurrentDir(); |
115 | QString path = thisDir->canonicalPath(); | 112 | QString path = thisDir->canonicalPath(); |
116 | 113 | ||
117 | thisView->clear(); | 114 | thisView->clear(); |
118 | thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 115 | thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
119 | thisDir->setMatchAllDirs(TRUE); | 116 | thisDir->setMatchAllDirs(TRUE); |
120 | thisDir->setNameFilter(filterStr); | 117 | thisDir->setNameFilter(filterStr); |
121 | QString fileL, fileS, fileDate; | 118 | QString fileL, fileS, fileDate; |
122 | QString fs= getFileSystemType((const QString &) path); | 119 | QString fs= getFileSystemType((const QString &) path); |
123 | setCaption(tr("AdvancedFm :: ")+fs+" :: " | 120 | setCaption(tr("AdvancedFm :: ")+fs+" :: " |
124 | +checkDiskSpace((const QString &) path)+ tr(" kB free") ); | 121 | +checkDiskSpace((const QString &) path)+ tr(" kB free") ); |
125 | bool isDir=FALSE; | 122 | bool isDir=FALSE; |
126 | const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); | 123 | const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); |
127 | QFileInfoListIterator it(*list); | 124 | QFileInfoListIterator it(*list); |
128 | QFileInfo *fi; | 125 | QFileInfo *fi; |
129 | while ( (fi=it.current()) ) { | 126 | while ( (fi=it.current()) ) { |
130 | if (fi->isSymLink() ) { | 127 | if (fi->isSymLink() ) { |
131 | QString symLink=fi->readLink(); | 128 | QString symLink=fi->readLink(); |
132 | QFileInfo sym( symLink); | 129 | QFileInfo sym( symLink); |
133 | fileS.sprintf( "%10i", sym.size() ); | 130 | fileS.sprintf( "%10i", sym.size() ); |
134 | fileL = fi->fileName() +" -> " + sym.filePath().data(); | 131 | fileL = fi->fileName() +" -> " + sym.filePath().data(); |
135 | fileDate = sym.lastModified().toString(); | 132 | fileDate = sym.lastModified().toString(); |
136 | } else { | 133 | } else { |
137 | fileS.sprintf( "%10i", fi->size() ); | 134 | fileS.sprintf( "%10i", fi->size() ); |
138 | fileL = fi->fileName(); | 135 | fileL = fi->fileName(); |
139 | fileDate= fi->lastModified().toString(); | 136 | fileDate= fi->lastModified().toString(); |
140 | if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) { | 137 | if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) { |
141 | // if(fileL == "..") | 138 | // if(fileL == "..") |
142 | fileL += "/"; | 139 | fileL += "/"; |
143 | isDir=TRUE; | 140 | isDir=TRUE; |
144 | } | 141 | } |
145 | } | 142 | } |
146 | QFileInfo fileInfo( path + "/" + fileL); | 143 | QFileInfo fileInfo( path + "/" + fileL); |
147 | 144 | ||
148 | if(fileL !="./" && fi->exists()) { | 145 | if(fileL !="./" && fi->exists()) { |
149 | item = new QListViewItem( thisView, fileL, fileS , fileDate); | 146 | item = new QListViewItem( thisView, fileL, fileS , fileDate); |
150 | 147 | ||
151 | if(isDir || fileL.find("/",0,TRUE) != -1) { | 148 | if(isDir || fileL.find("/",0,TRUE) != -1) { |
152 | 149 | ||
153 | if( !QDir( fi->filePath() ).isReadable()) //is directory | 150 | if( !QDir( fi->filePath() ).isReadable()) //is directory |
154 | pm = Resource::loadPixmap( "lockedfolder" ); | 151 | pm = Resource::loadPixmap( "lockedfolder" ); |
155 | else | 152 | else |
156 | pm= Resource::loadPixmap( "folder" ); | 153 | pm= Resource::loadPixmap( "folder" ); |
157 | } | 154 | } |
158 | else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) { | 155 | else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) { |
159 | pm = Resource::loadPixmap( "exec"); | 156 | pm = Resource::loadPixmap( "exec"); |
160 | } | 157 | } |
161 | else if( (fileInfo.permission( QFileInfo::ExeUser) | 158 | else if( (fileInfo.permission( QFileInfo::ExeUser) |
162 | | fileInfo.permission( QFileInfo::ExeGroup) | 159 | | fileInfo.permission( QFileInfo::ExeGroup) |
163 | | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) { | 160 | | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) { |
164 | pm = Resource::loadPixmap( "exec"); | 161 | pm = Resource::loadPixmap( "exec"); |
165 | } | 162 | } |
166 | else if( !fi->isReadable() ) { | 163 | else if( !fi->isReadable() ) { |
167 | pm = Resource::loadPixmap( "locked" ); | 164 | pm = Resource::loadPixmap( "locked" ); |
168 | } | 165 | } |
169 | else { //everything else goes by mimetype | 166 | else { //everything else goes by mimetype |
170 | MimeType mt(fi->filePath()); | 167 | MimeType mt(fi->filePath()); |
171 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | 168 | pm=mt.pixmap(); //sets the correct pixmap for mimetype |
172 | if(pm.isNull()) { | 169 | if(pm.isNull()) { |
173 | pm = unknownXpm; | 170 | pm = unknownXpm; |
174 | } | 171 | } |
175 | } | 172 | } |
176 | if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { | 173 | if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { |
177 | // odebug << " overlay link image" << oendl; | 174 | // odebug << " overlay link image" << oendl; |
178 | pm= Resource::loadPixmap( "advancedfm/symlink" ); | 175 | pm= Resource::loadPixmap( "advancedfm/symlink" ); |
179 | // pm= Resource::loadPixmap( "folder" ); | 176 | // pm= Resource::loadPixmap( "folder" ); |
180 | // QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 177 | // QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
181 | // QPainter painter( &pm ); | 178 | // QPainter painter( &pm ); |
182 | // painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 179 | // painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
183 | // pm.setMask( pm.createHeuristicMask( FALSE ) ); | 180 | // pm.setMask( pm.createHeuristicMask( FALSE ) ); |
184 | } | 181 | } |
185 | item->setPixmap( 0,pm); | 182 | item->setPixmap( 0,pm); |
186 | 183 | ||
187 | } | 184 | } |
188 | isDir=FALSE; | 185 | isDir=FALSE; |
189 | ++it; | 186 | ++it; |
190 | } | 187 | } |
191 | 188 | ||
192 | if( path.find("dev",0,TRUE) != -1) { | 189 | if( path.find("dev",0,TRUE) != -1) { |
193 | struct stat buf; | 190 | struct stat buf; |
194 | dev_t devT; | 191 | dev_t devT; |
195 | DIR *dir; | 192 | DIR *dir; |
196 | struct dirent *mydirent; | 193 | struct dirent *mydirent; |
197 | 194 | ||
198 | if((dir = opendir( path.latin1())) != NULL) | 195 | if((dir = opendir( path.latin1())) != NULL) |
199 | while ((mydirent = readdir(dir)) != NULL) { | 196 | while ((mydirent = readdir(dir)) != NULL) { |
200 | lstat( mydirent->d_name, &buf); | 197 | lstat( mydirent->d_name, &buf); |
201 | // odebug << mydirent->d_name << oendl; | 198 | // odebug << mydirent->d_name << oendl; |
202 | fileL.sprintf("%s", mydirent->d_name); | 199 | fileL.sprintf("%s", mydirent->d_name); |
203 | devT = buf.st_dev; | 200 | devT = buf.st_dev; |
204 | fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); | 201 | fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); |
205 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); | 202 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); |
206 | if( fileL.find(".") == -1 ) { | 203 | if( fileL.find(".") == -1 ) { |
207 | item= new QListViewItem( thisView, fileL, fileS, fileDate); | 204 | item= new QListViewItem( thisView, fileL, fileS, fileDate); |
208 | pm = unknownXpm; | 205 | pm = unknownXpm; |
209 | item->setPixmap( 0,pm); | 206 | item->setPixmap( 0,pm); |
210 | } | 207 | } |
211 | } | 208 | } |
212 | 209 | ||
213 | closedir(dir); | 210 | closedir(dir); |
214 | } | 211 | } |
215 | 212 | ||
216 | thisView->setSorting( 3,FALSE); | 213 | thisView->setSorting( 3,FALSE); |
217 | fillCombo( (const QString &) path ); | 214 | fillCombo( (const QString &) path ); |
218 | } | 215 | } |
219 | 216 | ||
220 | void AdvancedFm::rePopulate() { | 217 | void AdvancedFm::rePopulate() { |
221 | populateView(); | 218 | // qDebug("repopulate views"); |
222 | setOtherTabCurrent(); | 219 | populateView(); |
223 | populateView(); | 220 | setOtherTabCurrent(); |
221 | populateView(); | ||
224 | 222 | ||
225 | // int tmpTab = whichTab; | 223 | // int tmpTab = whichTab; |
226 | // // odebug << "" << tmpTab << "" << oendl; | 224 | // // odebug << "" << tmpTab << "" << oendl; |
227 | 225 | ||
228 | // for(int i =1; i < 3; i++) { | 226 | // for(int i =1; i < 3; i++) { |
229 | // TabWidget->setCurrentWidget(i - 1); | 227 | // TabWidget->setCurrentWidget(i - 1); |
230 | // populateView(); | 228 | // populateView(); |
231 | // } | 229 | // } |
232 | // TabWidget->setCurrentWidget( tmpTab - 1); | 230 | // TabWidget->setCurrentWidget( tmpTab - 1); |
233 | } | 231 | } |
234 | 232 | ||
235 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { | 233 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { |
236 | if ( TabWidget->currentWidget() == tab) | 234 | // if ( TabWidget->currentWidget() == tab) |
237 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); | 235 | // qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); |
238 | else | 236 | // else |
239 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); | 237 | // qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); |
240 | 238 | ||
241 | 239 | ||
242 | if(selectedItem) { | 240 | if(selectedItem) { |
243 | QString strItem=selectedItem->text(0); | 241 | QString strItem=selectedItem->text(0); |
244 | // owarn << strItem << oendl; | 242 | // owarn << strItem << oendl; |
245 | QString strSize=selectedItem->text(1); | 243 | QString strSize=selectedItem->text(1); |
246 | strSize=strSize.stripWhiteSpace(); | 244 | strSize=strSize.stripWhiteSpace(); |
247 | bool isDirectory = false; | 245 | bool isDirectory = false; |
248 | QString strItem2; | 246 | QString strItem2; |
249 | |||
250 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink | ||
251 | strItem2 = dealWithSymName((const QString&)strItem); | ||
252 | if(QDir(strItem2).exists() ) | ||
253 | strItem = strItem2; | ||
254 | } | ||
255 | 247 | ||
256 | if( strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { | 248 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink |
249 | strItem2 = dealWithSymName((const QString&)strItem); | ||
250 | if(QDir(strItem2).exists() ) | ||
251 | strItem = strItem2; | ||
252 | } | ||
257 | 253 | ||
258 | if(QDir(strItem).exists()) | 254 | if( strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { |
259 | isDirectory = true; | ||
260 | } | ||
261 | 255 | ||
262 | if( isDirectory ) { | 256 | if(QDir(strItem).exists()) |
263 | CurrentDir()->cd( strItem, TRUE); | 257 | isDirectory = true; |
264 | populateView(); | 258 | } |
265 | CurrentView()->ensureItemVisible( CurrentView()->firstChild()); | 259 | |
266 | } | 260 | if( isDirectory ) { |
267 | chdir( strItem.latin1()); | 261 | CurrentDir()->cd( strItem, TRUE); |
268 | } | 262 | populateView(); |
263 | CurrentView()->ensureItemVisible( CurrentView()->firstChild()); | ||
264 | } | ||
265 | chdir( strItem.latin1()); | ||
266 | } | ||
269 | } | 267 | } |
270 | 268 | ||
271 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { | 269 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { |
272 | Q_UNUSED(item); | 270 | Q_UNUSED(item); |
273 | switch (mouse) { | 271 | switch (mouse) { |
274 | case 1: | 272 | case 1: |
275 | { | 273 | { |
276 | if(renameBox != 0 ) { | 274 | if(renameBox != 0 ) { |
277 | cancelRename(); | 275 | cancelRename(); |
278 | } | 276 | } |
279 | } | 277 | } |
280 | break; | 278 | break; |
281 | // case 2: | 279 | // case 2: |
282 | // menuTimer.start( 50, TRUE ); | 280 | // menuTimer.start( 50, TRUE ); |
283 | // break; | 281 | // break; |
284 | }; | 282 | }; |
285 | } | 283 | } |
286 | 284 | ||
287 | 285 | ||
288 | void AdvancedFm::refreshCurrentTab() { | 286 | void AdvancedFm::refreshCurrentTab() { |
289 | populateView(); | 287 | populateView(); |
290 | // if ( TabWidget->currentWidget() == tab) { | 288 | // if ( TabWidget->currentWidget() == tab) { |
291 | 289 | ||
292 | } | 290 | } |
293 | 291 | ||
294 | void AdvancedFm::switchToLocalTab() { | 292 | void AdvancedFm::switchToLocalTab() { |
293 | qDebug("switchToLocal "); | ||
295 | TabWidget->setCurrentWidget(0); | 294 | TabWidget->setCurrentWidget(0); |
296 | Local_View->setFocus(); | 295 | Local_View->setFocus(); |
296 | whichTab = 1; | ||
297 | 297 | ||
298 | } | 298 | } |
299 | 299 | ||
300 | void AdvancedFm::switchToRemoteTab() { | 300 | void AdvancedFm::switchToRemoteTab() { |
301 | qDebug("switchToRemoteTab() "); | ||
301 | TabWidget->setCurrentWidget(1); | 302 | TabWidget->setCurrentWidget(1); |
302 | Remote_View->setFocus(); | 303 | Remote_View->setFocus(); |
304 | whichTab = 2; | ||
303 | } | 305 | } |
304 | 306 | ||
305 | void AdvancedFm::readConfig() { | 307 | void AdvancedFm::readConfig() { |
306 | Config cfg("AdvancedFm"); | 308 | Config cfg("AdvancedFm"); |
307 | } | 309 | } |
308 | 310 | ||
309 | void AdvancedFm::writeConfig() { | 311 | void AdvancedFm::writeConfig() { |
310 | Config cfg("AdvancedFm"); | 312 | Config cfg("AdvancedFm"); |
311 | } | 313 | } |
312 | 314 | ||
313 | void AdvancedFm::currentPathComboChanged() { | 315 | void AdvancedFm::currentPathComboChanged() { |
314 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { | 316 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { |
315 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); | 317 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); |
316 | populateView(); | 318 | populateView(); |
317 | } else { | 319 | } else { |
318 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); | 320 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); |
319 | } | 321 | } |
320 | } | 322 | } |
321 | 323 | ||
322 | void AdvancedFm::fillCombo(const QString ¤tPath) { | 324 | void AdvancedFm::fillCombo(const QString ¤tPath) { |
323 | 325 | ||
324 | if ( TabWidget->currentWidget() == tab) { | 326 | if ( TabWidget->currentWidget() == tab) { |
325 | // if ( whichTab == 1) { | 327 | // if ( whichTab == 1) { |
326 | currentPathCombo->lineEdit()->setText( currentPath); | 328 | currentPathCombo->lineEdit()->setText( currentPath); |
327 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { | 329 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
328 | currentPathCombo->clear(); | 330 | currentPathCombo->clear(); |
329 | localDirPathStringList.prepend( currentPath ); | 331 | localDirPathStringList.prepend( currentPath ); |
330 | currentPathCombo->insertStringList( localDirPathStringList,-1); | 332 | currentPathCombo->insertStringList( localDirPathStringList,-1); |
331 | } | 333 | } |
332 | } else { | 334 | } else { |
333 | currentPathCombo->lineEdit()->setText( currentPath); | 335 | currentPathCombo->lineEdit()->setText( currentPath); |
334 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { | 336 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
335 | currentPathCombo->clear(); | 337 | currentPathCombo->clear(); |
336 | remoteDirPathStringList.prepend( currentPath ); | 338 | remoteDirPathStringList.prepend( currentPath ); |
337 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); | 339 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); |
338 | } | 340 | } |
339 | } | 341 | } |
340 | } | 342 | } |
341 | 343 | ||
342 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { | 344 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { |
343 | chdir( currentPath.latin1() ); | 345 | chdir( currentPath.latin1() ); |
344 | CurrentDir()->cd( currentPath, TRUE); | 346 | CurrentDir()->cd( currentPath, TRUE); |
345 | populateView(); | 347 | populateView(); |
346 | update(); | 348 | update(); |
347 | } | 349 | } |
348 | 350 | ||
349 | QStringList AdvancedFm::getPath() { | 351 | QStringList AdvancedFm::getPath() { |
350 | QStringList strList; | 352 | QStringList strList; |
351 | QListView *thisView=CurrentView(); | 353 | QListView *thisView=CurrentView(); |
352 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); | 354 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); |
353 | QListViewItemIterator it( thisView ); | 355 | QListViewItemIterator it( thisView ); |
354 | for ( ; it.current(); ++it ) { | 356 | for ( ; it.current(); ++it ) { |
355 | if ( it.current()->isSelected() ) { | 357 | if ( it.current()->isSelected() ) { |
356 | strList << it.current()->text(0); | 358 | strList << it.current()->text(0); |
357 | // odebug << it.current()->text(0) << oendl; | 359 | // odebug << it.current()->text(0) << oendl; |
358 | } | 360 | } |
359 | } | 361 | } |
360 | return strList; | 362 | return strList; |
361 | } | 363 | } |
362 | 364 | ||
363 | void AdvancedFm::homeButtonPushed() { | 365 | void AdvancedFm::homeButtonPushed() { |
364 | QString current = QDir::homeDirPath(); | 366 | QString current = QDir::homeDirPath(); |
365 | chdir( current.latin1() ); | 367 | chdir( current.latin1() ); |
366 | CurrentDir()->cd( current, TRUE); | 368 | CurrentDir()->cd( current, TRUE); |
367 | populateView(); | 369 | populateView(); |
368 | update(); | 370 | update(); |
369 | } | 371 | } |
370 | 372 | ||
371 | void AdvancedFm::docButtonPushed() { | 373 | void AdvancedFm::docButtonPushed() { |
372 | QString current = QPEApplication::documentDir(); | 374 | QString current = QPEApplication::documentDir(); |
373 | chdir( current.latin1() ); | 375 | chdir( current.latin1() ); |
374 | CurrentDir()->cd( current, TRUE); | 376 | CurrentDir()->cd( current, TRUE); |
375 | populateView(); | 377 | populateView(); |
376 | update(); | 378 | update(); |
377 | } | 379 | } |
378 | 380 | ||
379 | void AdvancedFm::SDButtonPushed() { | 381 | void AdvancedFm::SDButtonPushed() { |
380 | QString current = "/mnt/card";// this can change so fix | 382 | QString current = "/mnt/card";// this can change so fix |
381 | chdir( current.latin1() ); | 383 | chdir( current.latin1() ); |
382 | CurrentDir()->cd( current, TRUE); | 384 | CurrentDir()->cd( current, TRUE); |
383 | populateView(); | 385 | populateView(); |
384 | update(); | 386 | update(); |
385 | } | 387 | } |
386 | 388 | ||
387 | void AdvancedFm::CFButtonPushed() { | 389 | void AdvancedFm::CFButtonPushed() { |
388 | QString current; | 390 | QString current; |
389 | if(zaurusDevice) | 391 | if(zaurusDevice) |
390 | current= "/mnt/cf"; //zaurus | 392 | current= "/mnt/cf"; //zaurus |
391 | else | 393 | else |
392 | current = "/mnt/hda"; //ipaq | 394 | current = "/mnt/hda"; //ipaq |
393 | chdir( current.latin1() ); | 395 | chdir( current.latin1() ); |
394 | CurrentDir()->cd( current, TRUE); | 396 | CurrentDir()->cd( current, TRUE); |
395 | populateView(); | 397 | populateView(); |
396 | update(); | 398 | update(); |
397 | } | 399 | } |
398 | 400 | ||
399 | 401 | ||
400 | void AdvancedFm::doAbout() { | 402 | void AdvancedFm::doAbout() { |
401 | QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n" | 403 | QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); |
402 | "is copyright 2002-2003 by\n" | ||
403 | "L.J.Potter<llornkcor@handhelds.org>\n" | ||
404 | "and is licensed by the GPL")); | ||
405 | } | 404 | } |
406 | 405 | ||
407 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { | 406 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { |
408 | // owarn << "key " << e->key() << "" << oendl; | 407 | // owarn << "key " << e->key() << "" << oendl; |
409 | // if( CurrentView()->hasFocus() ) | 408 | // if( CurrentView()->hasFocus() ) |
410 | { | 409 | { |
411 | switch ( e->key() ) { | 410 | switch ( e->key() ) { |
412 | case Key_Left: | 411 | case Key_Left: |
413 | upDir(); | 412 | upDir(); |
414 | break; | 413 | break; |
415 | case Key_Next: | 414 | case Key_Next: |
416 | break; | 415 | break; |
417 | case Key_Return: | 416 | case Key_Return: |
418 | case Key_Enter: | 417 | case Key_Enter: |
419 | navigateToSelected(); | 418 | navigateToSelected(); |
420 | break; | 419 | break; |
421 | case Key_Tab: { | 420 | case Key_Tab: { |
422 | setOtherTabCurrent(); | 421 | setOtherTabCurrent(); |
423 | } | 422 | } |
424 | break; | 423 | break; |
425 | case Key_Delete: | 424 | case Key_Delete: |
426 | del(); | 425 | del(); |
427 | break; | 426 | break; |
428 | case Key_A: | 427 | case Key_A: |
429 | copyAs(); | 428 | copyAs(); |
430 | break; | 429 | break; |
431 | case Key_C: | 430 | case Key_C: |
432 | copy(); | 431 | copy(); |
433 | break; | 432 | break; |
434 | case Key_E: | 433 | case Key_E: |
435 | runThis(); | 434 | runThis(); |
436 | break; | 435 | break; |
437 | case Key_G: | 436 | case Key_G: |
438 | { | 437 | { |
439 | currentPathCombo->lineEdit()->setFocus(); | 438 | currentPathCombo->lineEdit()->setFocus(); |
440 | } | 439 | } |
441 | break; | 440 | break; |
442 | 441 | ||
443 | case Key_H: | 442 | case Key_H: |
444 | showHidden(); | 443 | showHidden(); |
445 | break; | 444 | break; |
446 | case Key_I: | 445 | case Key_I: |
447 | fileStatus(); | 446 | fileStatus(); |
448 | break; | 447 | break; |
449 | case Key_M: | 448 | case Key_M: |
450 | move(); | 449 | move(); |
451 | break; | 450 | break; |
452 | case Key_N: | 451 | case Key_N: |
453 | mkDir(); | 452 | mkDir(); |
454 | break; | 453 | break; |
455 | case Key_P: | 454 | case Key_P: |
456 | filePerms(); | 455 | filePerms(); |
457 | break; | 456 | break; |
458 | case Key_R: | 457 | case Key_R: |
459 | rn(); | 458 | rn(); |
460 | break; | 459 | break; |
461 | case Key_U: | 460 | case Key_U: |
462 | upDir(); | 461 | upDir(); |
463 | break; | 462 | break; |
464 | case Key_1: | 463 | case Key_1: |
465 | switchToLocalTab(); | 464 | switchToLocalTab(); |
466 | break; | 465 | break; |
467 | case Key_2: | 466 | case Key_2: |
468 | switchToRemoteTab(); | 467 | switchToRemoteTab(); |
469 | break; | 468 | break; |
470 | case Key_3: | 469 | case Key_3: |
471 | CFButtonPushed(); | 470 | CFButtonPushed(); |
472 | break; | 471 | break; |
473 | case Key_4: | 472 | case Key_4: |
474 | SDButtonPushed(); | 473 | SDButtonPushed(); |
475 | break; | 474 | break; |
476 | case Key_5: | 475 | case Key_5: |
477 | homeButtonPushed(); | 476 | homeButtonPushed(); |
478 | break; | 477 | break; |
479 | case Key_6: | 478 | case Key_6: |
480 | docButtonPushed(); | 479 | docButtonPushed(); |
481 | break; | 480 | break; |
482 | case Key_7: | 481 | case Key_7: |
483 | break; | 482 | break; |
484 | case Key_8: | 483 | case Key_8: |
485 | break; | 484 | break; |
486 | case Key_9: | 485 | case Key_9: |
487 | break; | 486 | break; |
488 | case Key_0: | 487 | case Key_0: |
489 | break; | 488 | break; |
490 | }; | 489 | }; |
491 | e->accept(); | 490 | e->accept(); |
492 | } | 491 | } |
493 | } | 492 | } |
494 | 493 | ||
495 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { | 494 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { |
496 | if( CurrentView()->hasFocus() ) | 495 | if( CurrentView()->hasFocus() ) |
497 | e->ignore(); | 496 | e->ignore(); |
498 | } | 497 | } |
499 | 498 | ||
500 | 499 | ||
501 | void AdvancedFm::QPEButtonPushed() { | 500 | void AdvancedFm::QPEButtonPushed() { |
502 | QString current = QPEApplication::qpeDir(); | 501 | QString current = QPEApplication::qpeDir(); |
503 | chdir( current.latin1() ); | 502 | chdir( current.latin1() ); |
504 | CurrentDir()->cd( current, TRUE); | 503 | CurrentDir()->cd( current, TRUE); |
505 | populateView(); | 504 | populateView(); |
506 | update(); | 505 | update(); |
507 | } | 506 | } |
508 | 507 | ||
509 | void AdvancedFm::parsetab(const QString &fileName) { | 508 | void AdvancedFm::parsetab(const QString &fileName) { |
510 | 509 | ||
511 | fileSystemTypeList.clear(); | 510 | fileSystemTypeList.clear(); |
512 | fsList.clear(); | 511 | fsList.clear(); |
513 | struct mntent *me; | 512 | struct mntent *me; |
514 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); | 513 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); |
515 | if ( mntfp ) { | 514 | if ( mntfp ) { |
516 | while ( (me = getmntent( mntfp )) != 0 ) { | 515 | while ( (me = getmntent( mntfp )) != 0 ) { |
517 | QString deviceName = me->mnt_fsname; | 516 | QString deviceName = me->mnt_fsname; |
518 | QString filesystemType = me->mnt_type; | 517 | QString filesystemType = me->mnt_type; |
519 | QString mountDir = me->mnt_dir; | 518 | QString mountDir = me->mnt_dir; |
520 | if(deviceName != "none") { | 519 | if(deviceName != "none") { |
521 | if( fsList.contains(filesystemType) == 0 | 520 | if( fsList.contains(filesystemType) == 0 |
522 | & filesystemType.find("proc",0,TRUE) == -1 | 521 | & filesystemType.find("proc",0,TRUE) == -1 |
523 | & filesystemType.find("cramfs",0,TRUE) == -1 | 522 | & filesystemType.find("cramfs",0,TRUE) == -1 |
524 | & filesystemType.find("auto",0,TRUE) == -1) | 523 | & filesystemType.find("auto",0,TRUE) == -1) |
525 | fsList << filesystemType; | 524 | fsList << filesystemType; |
526 | fileSystemTypeList << mountDir+"::"+filesystemType; | 525 | fileSystemTypeList << mountDir+"::"+filesystemType; |
527 | } | 526 | } |
528 | } | 527 | } |
529 | } | 528 | } |
530 | endmntent( mntfp ); | 529 | endmntent( mntfp ); |
531 | } | 530 | } |
532 | 531 | ||
533 | QString AdvancedFm::getFileSystemType(const QString ¤tText) { | 532 | QString AdvancedFm::getFileSystemType(const QString ¤tText) { |
534 | parsetab("/etc/mtab"); //why did TT forget filesystem type? | 533 | parsetab("/etc/mtab"); //why did TT forget filesystem type? |
535 | QString current = currentText;//.right( currentText.length()-1); | 534 | QString current = currentText;//.right( currentText.length()-1); |
536 | QString baseFs; | 535 | QString baseFs; |
537 | for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) { | 536 | for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) { |
538 | QString temp = (*it); | 537 | QString temp = (*it); |
539 | QString path = temp.left(temp.find("::",0,TRUE) ); | 538 | QString path = temp.left(temp.find("::",0,TRUE) ); |
540 | path = path.right( path.length()-1); | 539 | path = path.right( path.length()-1); |
541 | if(path.isEmpty()) baseFs = temp.right( temp.length() - temp.find("::",0,TRUE) - 2); | 540 | if(path.isEmpty()) baseFs = temp.right( temp.length() - temp.find("::",0,TRUE) - 2); |
542 | if( current.find( path,0,TRUE) != -1 && !path.isEmpty()) { | 541 | if( current.find( path,0,TRUE) != -1 && !path.isEmpty()) { |
543 | return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); | 542 | return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); |
544 | } | 543 | } |
545 | } | 544 | } |
546 | return baseFs; | 545 | return baseFs; |
547 | } | 546 | } |
548 | 547 | ||
549 | QString AdvancedFm::getDiskSpace( const QString &path) { | 548 | QString AdvancedFm::getDiskSpace( const QString &path) { |
550 | struct statfs fss; | 549 | struct statfs fss; |
551 | if ( !statfs( path.latin1(), &fss ) ) { | 550 | if ( !statfs( path.latin1(), &fss ) ) { |
552 | int blkSize = fss.f_bsize; | 551 | int blkSize = fss.f_bsize; |
553 | // int totalBlks = fs.f_blocks; | 552 | // int totalBlks = fs.f_blocks; |
554 | int availBlks = fss.f_bavail; | 553 | int availBlks = fss.f_bavail; |
555 | 554 | ||
556 | long mult = blkSize / 1024; | 555 | long mult = blkSize / 1024; |
557 | long div = 1024 / blkSize; | 556 | long div = 1024 / blkSize; |
558 | if ( !mult ) mult = 1; | 557 | if ( !mult ) mult = 1; |
559 | if ( !div ) div = 1; | 558 | if ( !div ) div = 1; |
560 | 559 | ||
561 | return QString::number(availBlks * mult / div); | 560 | return QString::number(availBlks * mult / div); |
562 | } | 561 | } |
563 | return ""; | 562 | return ""; |
564 | } | 563 | } |
565 | 564 | ||
566 | 565 | ||
567 | void AdvancedFm::showFileMenu() { | 566 | void AdvancedFm::showFileMenu() { |
568 | QString curApp; | 567 | QString curApp; |
569 | curApp = CurrentView()->currentItem()->text(0); | 568 | curApp = CurrentView()->currentItem()->text(0); |
570 | 569 | ||
571 | MimeType mt( curApp ); | 570 | MimeType mt(curApp); |
572 | const AppLnk* app = mt.application(); | 571 | const AppLnk* app = mt.application(); |
573 | QFile fi(curApp); | 572 | QFile fi(curApp); |
574 | QPopupMenu *m = new QPopupMenu(0); | 573 | QPopupMenu *m = new QPopupMenu(0); |
575 | QPopupMenu *n = new QPopupMenu(0); | 574 | QPopupMenu *n = new QPopupMenu(0); |
576 | // QPopupMenu *o = new QPopupMenu(0); | 575 | // QPopupMenu *o = new QPopupMenu(0); |
577 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 576 | m->insertItem(tr("Show Hidden Files"),this,SLOT(showHidden())); |
578 | 577 | ||
579 | if ( QFileInfo(fi).isDir() ) { | 578 | if ( QFileInfo(fi).isDir()) { |
580 | m->insertSeparator(); | 579 | m->insertSeparator(); |
581 | m->insertItem( tr( "Change Directory" ), this, SLOT( doDirChange() )); | 580 | m->insertItem(tr("Change Directory"),this,SLOT(doDirChange())); |
582 | } else { | 581 | } else { |
583 | 582 | ||
584 | if ( app ) | 583 | if (app) |
585 | m->insertItem( app->pixmap(), tr( "Open in " | 584 | m->insertItem(app->pixmap(),tr("Open in " + app->name()),this,SLOT(runThis())); |
586 | + app->name() ), this, SLOT( runThis() ) ); | 585 | else if(QFileInfo(fi).isExecutable() ) //damn opie doesnt like this |
587 | else if( QFileInfo(fi).isExecutable() ) //damn opie doesnt like this | 586 | m->insertItem(tr("Execute"),this,SLOT(runThis())); |
588 | m->insertItem( tr( "Execute" ), this, SLOT( runThis() ) ); | 587 | m->insertItem(Resource::loadPixmap("txt"),tr("Open as text"),this,SLOT(runText())); |
589 | m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) ); | ||
590 | } | 588 | } |
591 | 589 | ||
592 | m->insertItem(tr("Actions"),n); | 590 | m->insertItem(tr("Actions"),n); |
593 | n->insertItem( tr( "Make Directory" ), this, SLOT( makeDir() )); | 591 | n->insertItem(tr("Make Directory"),this,SLOT(makeDir())); |
594 | 592 | ||
595 | n->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 593 | n->insertItem(tr("Make Symlink"),this,SLOT(mkSym())); |
596 | 594 | ||
597 | n->insertSeparator(); | 595 | n->insertSeparator(); |
598 | n->insertItem( tr( "Rename" ), this, SLOT( renameIt() )); | 596 | n->insertItem(tr("Rename"),this,SLOT(renameIt())); |
599 | 597 | ||
600 | n->insertItem( tr( "Copy" ), this, SLOT( copy() )); | 598 | n->insertItem(tr("Copy"),this,SLOT(copyTimer())); |
601 | n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); | 599 | n->insertItem(tr("Copy As"),this,SLOT(copyAsTimer())); |
602 | n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); | 600 | n->insertItem(tr("Copy Same Dir"),this,SLOT(copySameDirTimer())); |
603 | n->insertItem( tr( "Move" ), this, SLOT( move() )); | 601 | n->insertItem(tr("Move"),this,SLOT(moveTimer())); |
604 | 602 | ||
605 | n->insertSeparator(); | 603 | n->insertSeparator(); |
606 | n->insertItem( tr( "Delete" ), this, SLOT( doDelete() )); | 604 | n->insertItem(tr("Delete"),this,SLOT(doDelete())); |
607 | m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 605 | m->insertItem(tr("Add To Documents"),this,SLOT(addToDocs())); |
608 | 606 | ||
609 | m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); | 607 | m->insertItem(tr("Run Command"),this,SLOT(runCommand())); |
610 | m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); | 608 | m->insertItem(tr("File Info"),this,SLOT(fileStatus())); |
611 | 609 | ||
612 | m->insertSeparator(); | 610 | m->insertSeparator(); |
613 | m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); | 611 | m->insertItem(tr("Set Permissions"),this,SLOT(filePerms())); |
614 | 612 | ||
615 | #if defined(QT_QWS_OPIE) | 613 | #if defined(QT_QWS_OPIE) |
616 | m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); | 614 | m->insertItem(tr("Properties"),this,SLOT(doProperties())); |
617 | #endif | 615 | #endif |
618 | m->setCheckable(TRUE); | 616 | m->setCheckable(TRUE); |
619 | if (!b) | 617 | if (!b) |
620 | m->setItemChecked(m->idAt(0),TRUE); | 618 | m->setItemChecked(m->idAt(0),TRUE); |
621 | else | 619 | else |
622 | m->setItemChecked(m->idAt(0),FALSE); | 620 | m->setItemChecked(m->idAt(0),FALSE); |
623 | 621 | ||
624 | if(Ir::supported()) | 622 | if(Ir::supported()) |
625 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); | 623 | m->insertItem(tr("Beam File"),this,SLOT(doBeam())); |
626 | m->setFocus(); | 624 | m->setFocus(); |
627 | 625 | ||
628 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 626 | m->exec(QPoint(QCursor::pos().x(),QCursor::pos().y())); |
629 | 627 | ||
630 | if(m) delete m; | 628 | if(m) delete m; |
631 | } | 629 | } |
632 | 630 | ||
633 | 631 | ||
634 | QString AdvancedFm::checkDiskSpace(const QString &path) { | 632 | QString AdvancedFm::checkDiskSpace(const QString &path) { |
635 | struct statfs fss; | 633 | struct statfs fss; |
636 | if ( !statfs( path.latin1(), &fss ) ) { | 634 | if ( !statfs( path.latin1(), &fss ) ) { |
637 | int blkSize = fss.f_bsize; | 635 | int blkSize = fss.f_bsize; |
638 | // int totalBlks = fs.f_blocks; | 636 | // int totalBlks = fs.f_blocks; |
639 | int availBlks = fss.f_bavail; | 637 | int availBlks = fss.f_bavail; |
640 | 638 | ||
641 | long mult = blkSize / 1024; | 639 | long mult = blkSize / 1024; |
642 | long div = 1024 / blkSize; | 640 | long div = 1024 / blkSize; |
643 | if ( !mult ) mult = 1; | 641 | if ( !mult ) mult = 1; |
644 | if ( !div ) div = 1; | 642 | if ( !div ) div = 1; |
645 | 643 | ||
646 | 644 | ||
647 | return QString::number(availBlks * mult / div); | 645 | return QString::number(availBlks * mult / div); |
648 | } | 646 | } |
649 | return ""; | 647 | return ""; |
650 | } | 648 | } |
651 | 649 | ||
652 | void AdvancedFm::addToDocs() { | 650 | void AdvancedFm::addToDocs() { |
653 | QStringList strListPaths = getPath(); | 651 | QStringList strListPaths = getPath(); |
654 | QDir *thisDir = CurrentDir(); | 652 | QDir *thisDir = CurrentDir(); |
655 | 653 | ||
656 | if( strListPaths.count() > 0) { | 654 | if( strListPaths.count() > 0) { |
657 | QString curFile; | 655 | QString curFile; |
658 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { | 656 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { |
659 | curFile = thisDir->canonicalPath()+"/"+(*it); | 657 | curFile = thisDir->canonicalPath()+"/"+(*it); |
660 | // odebug << curFile << oendl; | 658 | // odebug << curFile << oendl; |
661 | QFileInfo fi(curFile); | 659 | QFileInfo fi(curFile); |
662 | DocLnk f; | 660 | DocLnk f; |
663 | // curFile.replace(QRegExp("\\..*"),""); | 661 | // curFile.replace(QRegExp("\\..*"),""); |
664 | f.setName(fi.baseName() ); | 662 | f.setName(fi.baseName() ); |
665 | f.setFile( curFile); | 663 | f.setFile( curFile); |
666 | f.writeLink(); | 664 | f.writeLink(); |
667 | } | 665 | } |
668 | } | 666 | } |
669 | } | 667 | } |
670 | 668 | ||
671 | 669 | ||
672 | void AdvancedFm::customDirsToMenu() { | 670 | void AdvancedFm::customDirsToMenu() { |
673 | 671 | ||
674 | Config cfg("AdvancedFm"); | 672 | Config cfg("AdvancedFm"); |
675 | cfg.setGroup("Menu"); | 673 | cfg.setGroup("Menu"); |
676 | 674 | ||
677 | QStringList list = cfg.readListEntry( "CustomDir", ','); | 675 | QStringList list = cfg.readListEntry( "CustomDir", ','); |
678 | menuButton->insertItems(list ); | 676 | menuButton->insertItems(list ); |
679 | 677 | ||
680 | // for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 678 | // for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
681 | // { | 679 | // { |
682 | // customDirMenu->insertItem(*it ); | 680 | // customDirMenu->insertItem(*it ); |
683 | // } | 681 | // } |
684 | } | 682 | } |
685 | 683 | ||
686 | void AdvancedFm::dirMenuSelected(int item) { | 684 | void AdvancedFm::dirMenuSelected(int item) { |
687 | switch(item) | 685 | switch(item) |
688 | { | 686 | { |
689 | 687 | ||
690 | case -21: | 688 | case -21: |
691 | case 0: | 689 | case 0: |
692 | addCustomDir(); | 690 | addCustomDir(); |
693 | break; | 691 | break; |
694 | case -22: | 692 | case -22: |
695 | case 1: | 693 | case 1: |
696 | removeCustomDir(); | 694 | removeCustomDir(); |
697 | break; | 695 | break; |
698 | default: | 696 | default: |
699 | { | 697 | { |
700 | // gotoCustomDir( menuButton->text(item)); | 698 | // gotoCustomDir( menuButton->text(item)); |
701 | // gotoCustomDir( customDirMenu->text(item)); | 699 | // gotoCustomDir( customDirMenu->text(item)); |
702 | } | 700 | } |
703 | break; | 701 | break; |
704 | 702 | ||
705 | }; | 703 | }; |
706 | } | 704 | } |
707 | 705 | ||
708 | void AdvancedFm::addCustomDir() { | 706 | void AdvancedFm::addCustomDir() { |
709 | Config cfg("AdvancedFm"); | 707 | Config cfg("AdvancedFm"); |
710 | cfg.setGroup("Menu"); | 708 | cfg.setGroup("Menu"); |
711 | QString dir; | 709 | QString dir; |
712 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); | 710 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); |
713 | 711 | ||
714 | dir = CurrentDir()->canonicalPath(); | 712 | dir = CurrentDir()->canonicalPath(); |
715 | 713 | ||
716 | bool addIt=true; | 714 | bool addIt=true; |
717 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 715 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
718 | if( dir == (*it)) { | 716 | if( dir == (*it)) { |
719 | addIt=false; | 717 | addIt=false; |
720 | } | 718 | } |
721 | } | 719 | } |
722 | if(addIt) { | 720 | if(addIt) { |
723 | menuButton->insertItem(dir); | 721 | menuButton->insertItem(dir); |
724 | // customDirMenu->insertItem(dir); | 722 | // customDirMenu->insertItem(dir); |
725 | list << dir; | 723 | list << dir; |
726 | } | 724 | } |
727 | 725 | ||
728 | cfg.writeEntry("CustomDir", list, ','); | 726 | cfg.writeEntry("CustomDir", list, ','); |
729 | cfg.write(); | 727 | cfg.write(); |
730 | } | 728 | } |
731 | 729 | ||
732 | void AdvancedFm::removeCustomDir() { | 730 | void AdvancedFm::removeCustomDir() { |
733 | // odebug << "remove custom dir" << oendl; | 731 | // odebug << "remove custom dir" << oendl; |
734 | Config cfg("AdvancedFm"); | 732 | Config cfg("AdvancedFm"); |
735 | cfg.setGroup("Menu"); | 733 | cfg.setGroup("Menu"); |
736 | QString dir; | 734 | QString dir; |
737 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); | 735 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); |
738 | QStringList list2; | 736 | QStringList list2; |
739 | dir = CurrentDir()->canonicalPath(); | 737 | dir = CurrentDir()->canonicalPath(); |
740 | int ramble=2; | 738 | int ramble=2; |
741 | // int ramble=-24; | 739 | // int ramble=-24; |
742 | //first remove list | 740 | //first remove list |
743 | if(list.grep(dir,true).isEmpty()) { | 741 | if(list.grep(dir,true).isEmpty()) { |
744 | QMessageBox::message(tr( "AdvancedFm" ), | 742 | QMessageBox::message(tr( "AdvancedFm" ), |
745 | tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!")); | 743 | tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!")); |
746 | } else { | 744 | } else { |
747 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | 745 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
748 | if((*it) != dir) { | 746 | if((*it) != dir) { |
749 | //current item is not our current dir, so add it to temp list | 747 | //current item is not our current dir, so add it to temp list |
750 | list2 <<(*it); | 748 | list2 <<(*it); |
751 | } else { | 749 | } else { |
752 | // customDirMenu->removeItem( ramble); | 750 | // customDirMenu->removeItem( ramble); |
753 | menuButton->remove( ramble); | 751 | menuButton->remove( ramble); |
754 | 752 | ||
755 | } | 753 | } |
756 | ramble++; | 754 | ramble++; |
757 | // ramble--; | 755 | // ramble--; |
758 | } | 756 | } |
759 | 757 | ||
760 | cfg.writeEntry("CustomDir", list2, ','); | 758 | cfg.writeEntry("CustomDir", list2, ','); |
761 | cfg.write(); | 759 | cfg.write(); |
762 | } | 760 | } |
763 | // customDirsToMenu(); | 761 | // customDirsToMenu(); |
764 | 762 | ||
765 | } | 763 | } |
766 | 764 | ||
767 | void AdvancedFm::gotoCustomDir(const QString &dir) { | 765 | void AdvancedFm::gotoCustomDir(const QString &dir) { |
768 | // odebug << "gotoCustomDir(const QString &dir) " +dir << oendl; | 766 | // odebug << "gotoCustomDir(const QString &dir) " +dir << oendl; |
769 | // QString curDir = dir; | 767 | // QString curDir = dir; |
770 | // QDir *thisDir = CurrentDir(); | 768 | // QDir *thisDir = CurrentDir(); |
771 | // if( curDir.isEmpty()) { | 769 | // if( curDir.isEmpty()) { |
772 | // } | 770 | // } |
773 | if( dir == s_addBookmark) { | 771 | if( dir == s_addBookmark) { |
774 | addCustomDir(); | 772 | addCustomDir(); |
775 | } | 773 | } |
776 | if( dir == s_removeBookmark) { | 774 | if( dir == s_removeBookmark) { |
777 | removeCustomDir( ); | 775 | removeCustomDir( ); |
778 | } else { | 776 | } else { |
779 | gotoDirectory( dir); | 777 | gotoDirectory( dir); |
780 | // if(QDir( curDir).exists() ) | 778 | // if(QDir( curDir).exists() ) |
781 | // { | 779 | // { |
782 | // thisDir->setPath( curDir ); | 780 | // thisDir->setPath( curDir ); |
783 | // chdir( curDir.latin1() ); | 781 | // chdir( curDir.latin1() ); |
784 | // thisDir->cd( curDir, TRUE); | 782 | // thisDir->cd( curDir, TRUE); |
785 | // populateView(); | 783 | // populateView(); |
786 | // } | 784 | // } |
787 | } | 785 | } |
788 | } | 786 | } |
789 | 787 | ||
790 | QDir *AdvancedFm::CurrentDir() { | 788 | QDir *AdvancedFm::CurrentDir() { |
791 | |||
792 | if ( TabWidget->currentWidget() == tab) | ||
793 | qDebug("CurrentTab is Local"); | ||
794 | else | ||
795 | qDebug("CurrentTab is Remote"); | ||
796 | |||
797 | if ( whichTab == 1) { | 789 | if ( whichTab == 1) { |
790 | // qDebug("CurrentTab is Local"); | ||
798 | return ¤tDir; | 791 | return ¤tDir; |
799 | } else { | 792 | } else { |
793 | // qDebug("CurrentTab is Remote"); | ||
800 | return ¤tRemoteDir; | 794 | return ¤tRemoteDir; |
801 | } | 795 | } |
802 | } | 796 | } |
803 | 797 | ||
804 | QDir *AdvancedFm::OtherDir() { | 798 | QDir *AdvancedFm::OtherDir() { |
805 | // if ( TabWidget->currentWidget() == tab) { | 799 | // if ( TabWidget->currentWidget() == tab) { |
806 | if ( whichTab == 1) { | 800 | if ( whichTab == 1) { |
807 | return ¤tRemoteDir; | 801 | return ¤tRemoteDir; |
808 | } else { | 802 | } else { |
809 | return ¤tDir; | 803 | return ¤tDir; |
810 | } | 804 | } |
811 | } | 805 | } |
812 | 806 | ||
813 | QListView * AdvancedFm::CurrentView() { | 807 | QListView * AdvancedFm::CurrentView() { |
814 | if ( TabWidget->currentWidget() == tab) | ||
815 | odebug << "CurrentView local" << oendl; | ||
816 | |||
817 | // if ( TabWidget->currentWidget() == tab) { | 808 | // if ( TabWidget->currentWidget() == tab) { |
818 | if ( whichTab == 1) { | 809 | if ( whichTab == 1) { |
810 | // qDebug("CurrentView: local"); | ||
819 | return Local_View; | 811 | return Local_View; |
820 | } else { | 812 | } else { |
821 | // owarn << "CurrentView Tab 2" << oendl; | 813 | // owarn << "CurrentView Tab 2" << oendl; |
814 | // qDebug("CurrentView: remote"); | ||
822 | return Remote_View; | 815 | return Remote_View; |
823 | } | 816 | } |
824 | } | 817 | } |
825 | 818 | ||
826 | QListView * AdvancedFm::OtherView() { | 819 | QListView * AdvancedFm::OtherView() { |
827 | if ( whichTab == 1) | 820 | if ( whichTab == 1) |
828 | return Remote_View; | 821 | return Remote_View; |
829 | else | 822 | else |
830 | return Local_View; | 823 | return Local_View; |
831 | } | 824 | } |
832 | 825 | ||
833 | void AdvancedFm::setOtherTabCurrent() { | 826 | void AdvancedFm::setOtherTabCurrent() { |
834 | qDebug("setOtherTabCurrent() %d",whichTab); | 827 | // qDebug("setOtherTabCurrent() %d",whichTab); |
835 | if ( whichTab == 1) { | 828 | if ( whichTab == 1) { |
836 | TabWidget->setCurrentWidget(1); | 829 | TabWidget->setCurrentWidget(1); |
837 | } else { | 830 | } else { |
838 | TabWidget->setCurrentWidget(0); | 831 | TabWidget->setCurrentWidget(0); |
839 | } | 832 | } |
840 | OtherView()->setFocus(); | 833 | OtherView()->setFocus(); |
841 | OtherView()->setSelected( CurrentView()->firstChild(), true); | 834 | OtherView()->setSelected( CurrentView()->firstChild(), true); |
842 | } | 835 | } |
843 | 836 | ||
844 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { | 837 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { |
845 | // odebug << "qcop message "+msg << oendl; | 838 | // odebug << "qcop message "+msg << oendl; |
846 | QDataStream stream ( data, IO_ReadOnly ); | 839 | QDataStream stream ( data, IO_ReadOnly ); |
847 | if ( msg == "openDirectory(QString)" ) { | 840 | if ( msg == "openDirectory(QString)" ) { |
848 | // odebug << "received" << oendl; | 841 | // odebug << "received" << oendl; |
849 | QString file; | 842 | QString file; |
850 | stream >> file; | 843 | stream >> file; |
851 | gotoDirectory( (const QString &) file); | 844 | gotoDirectory( (const QString &) file); |
852 | } | 845 | } |
853 | } | 846 | } |
854 | 847 | ||
855 | void AdvancedFm::setDocument(const QString &file) { | 848 | void AdvancedFm::setDocument(const QString &file) { |
856 | gotoDirectory( file); | 849 | gotoDirectory( file); |
857 | 850 | ||
858 | } | 851 | } |
859 | 852 | ||
860 | void AdvancedFm::gotoDirectory(const QString &file) { | 853 | void AdvancedFm::gotoDirectory(const QString &file) { |
861 | qDebug("goto dir "+file); | 854 | // qDebug("goto dir "+file); |
862 | QString curDir = file; | 855 | QString curDir = file; |
863 | QDir *thisDir = CurrentDir(); | 856 | QDir *thisDir = CurrentDir(); |
864 | if(QDir( curDir).exists() ) { | 857 | if(QDir( curDir).exists() ) { |
865 | thisDir->setPath( curDir ); | 858 | thisDir->setPath( curDir ); |
866 | chdir( curDir.latin1() ); | 859 | chdir( curDir.latin1() ); |
867 | thisDir->cd( curDir, TRUE); | 860 | thisDir->cd( curDir, TRUE); |
868 | populateView(); | 861 | populateView(); |
869 | } | 862 | } |
870 | else if(QFileInfo(curDir).exists()) { | 863 | else if(QFileInfo(curDir).exists()) { |
871 | QFileInfo fileInfo(curDir); | 864 | QFileInfo fileInfo(curDir); |
872 | curDir=fileInfo.dirPath(); | 865 | curDir=fileInfo.dirPath(); |
873 | if(QDir( curDir).exists() ) { | 866 | if(QDir( curDir).exists() ) { |
874 | thisDir->setPath( curDir ); | 867 | thisDir->setPath( curDir ); |
875 | chdir( curDir.latin1() ); | 868 | chdir( curDir.latin1() ); |
876 | thisDir->cd( curDir, TRUE); | 869 | thisDir->cd( curDir, TRUE); |
877 | populateView(); | 870 | populateView(); |
878 | } | 871 | } |
879 | findFile(file); | 872 | findFile(file); |
880 | } | 873 | } |
881 | 874 | ||
882 | } | 875 | } |
883 | 876 | ||
884 | void AdvancedFm::findFile(const QString &fileName) { | 877 | void AdvancedFm::findFile(const QString &fileName) { |
885 | QFileInfo fi(fileName); | 878 | QFileInfo fi(fileName); |
886 | QListView *thisView = CurrentView(); | 879 | QListView *thisView = CurrentView(); |
887 | QListViewItemIterator it( thisView ); | 880 | QListViewItemIterator it( thisView ); |
888 | for ( ; it.current(); ++it ) { | 881 | for ( ; it.current(); ++it ) { |
889 | if(it.current()->text(0) == fi.fileName()) { | 882 | if(it.current()->text(0) == fi.fileName()) { |
890 | it.current()->setSelected(true); | 883 | it.current()->setSelected(true); |
891 | thisView->ensureItemVisible(it.current()); | 884 | thisView->ensureItemVisible(it.current()); |
892 | } | 885 | } |
893 | } | 886 | } |
894 | } | 887 | } |
895 | 888 | ||
896 | void AdvancedFm::slotSwitchMenu(int ) { | 889 | void AdvancedFm::slotSwitchMenu(int item) { |
897 | // odebug << "Switch " << item << "" << oendl; | 890 | // qDebug( "Switch %d",item); |
898 | // viewMenu->setItemChecked(item, true); | 891 | // viewMenu->setItemChecked(item, true); |
899 | } | 892 | } |
900 | 893 | ||
901 | void AdvancedFm::navigateToSelected() { | 894 | void AdvancedFm::navigateToSelected() { |
902 | if( !CurrentView()->currentItem()) return; | 895 | if( !CurrentView()->currentItem()) return; |
903 | doDirChange(); | 896 | doDirChange(); |
904 | } | 897 | } |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index def6fe2..2234b3c 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -1,186 +1,195 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | advancedfm.h | 2 | advancedfm.h |
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 | #ifndef ADVANCEDFM_H | 12 | #ifndef ADVANCEDFM_H |
13 | #define ADVANCEDFM_H | 13 | #define ADVANCEDFM_H |
14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties | 14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties |
15 | #define QT_QWS_OPIE | 15 | #define QT_QWS_OPIE |
16 | 16 | ||
17 | #include <opie2/oprocess.h> | 17 | #include <opie2/oprocess.h> |
18 | #include <opie2/osplitter.h> | 18 | #include <opie2/osplitter.h> |
19 | 19 | ||
20 | #include <qpe/ir.h> | 20 | #include <qpe/ir.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | 22 | ||
23 | #include <qvariant.h> | 23 | #include <qvariant.h> |
24 | #include <qdialog.h> | 24 | #include <qdialog.h> |
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qdir.h> | 27 | #include <qdir.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | #include <qpoint.h> | 29 | #include <qpoint.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qpixmap.h> | 31 | #include <qpixmap.h> |
32 | 32 | ||
33 | 33 | ||
34 | class QVBoxLayout; | 34 | class QVBoxLayout; |
35 | class QHBoxLayout; | 35 | class QHBoxLayout; |
36 | class QGridLayout; | 36 | class QGridLayout; |
37 | class QComboBox; | 37 | class QComboBox; |
38 | class QListView; | 38 | class QListView; |
39 | class QListviewItem; | 39 | class QListviewItem; |
40 | class QLabel; | 40 | class QLabel; |
41 | class QProgressBar; | 41 | class QProgressBar; |
42 | class QSpinBox; | 42 | class QSpinBox; |
43 | class QWidget; | 43 | class QWidget; |
44 | class QPopupMenu; | 44 | class QPopupMenu; |
45 | class QFile; | 45 | class QFile; |
46 | class QListViewItem; | 46 | class QListViewItem; |
47 | class QLineEdit; | 47 | class QLineEdit; |
48 | class MenuButton; | 48 | class MenuButton; |
49 | 49 | ||
50 | class QToolButton; | 50 | class QToolButton; |
51 | class Ir; | 51 | class Ir; |
52 | 52 | ||
53 | class AdvancedFm : public QMainWindow | 53 | class AdvancedFm : public QMainWindow |
54 | { | 54 | { |
55 | Q_OBJECT | 55 | Q_OBJECT |
56 | public: | 56 | public: |
57 | static QString appName() { return QString::fromLatin1("advancedfm"); } | 57 | static QString appName() { return QString::fromLatin1("advancedfm"); } |
58 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); | 58 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); |
59 | ~AdvancedFm(); | 59 | ~AdvancedFm(); |
60 | protected slots: | ||
61 | void slotSwitchMenu(int); | ||
62 | void selectAll(); | ||
63 | void addToDocs(); | ||
64 | void doDirChange(); | ||
65 | void mkDir(); | ||
66 | void del(); | ||
67 | void rn(); | ||
68 | void populateView(); | ||
69 | void rePopulate(); | ||
70 | void showHidden(); | ||
71 | void showMenuHidden(); | ||
72 | void writeConfig(); | ||
73 | void readConfig(); | ||
74 | void ListClicked(QListViewItem *); | ||
75 | void ListPressed( int, QListViewItem *, const QPoint&, int); | ||
76 | void makeDir(); | ||
77 | void doDelete(); | ||
78 | void tabChanged(QWidget*); | ||
79 | void cleanUp(); | ||
80 | void renameIt(); | ||
81 | void runThis(); | ||
82 | void runText(); | ||
83 | void filePerms(); | ||
84 | void doProperties(); | ||
85 | void runCommand(); | ||
86 | void runCommandStd(); | ||
87 | QStringList getPath(); | ||
88 | void mkSym(); | ||
89 | void switchToLocalTab(); | ||
90 | void switchToRemoteTab(); | ||
91 | void refreshCurrentTab(); | ||
92 | protected: | 60 | protected: |
93 | 61 | ||
94 | Opie::Ui::OSplitter *TabWidget; | 62 | Opie::Ui::OSplitter *TabWidget; |
95 | QCopChannel * channel; | 63 | QCopChannel * channel; |
96 | QPixmap unknownXpm; | 64 | QPixmap unknownXpm; |
97 | int whichTab; | 65 | int whichTab; |
98 | // QTabWidget *TabWidget; | 66 | // QTabWidget *TabWidget; |
99 | QWidget *tab, *tab_2, *tab_3; | 67 | QWidget *tab, *tab_2, *tab_3; |
100 | QListView *Local_View, *Remote_View; | 68 | QListView *Local_View, *Remote_View; |
101 | 69 | ||
102 | QLineEdit *currentPathEdit; | 70 | QLineEdit *currentPathEdit; |
103 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; | 71 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; |
104 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 72 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
105 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 73 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
106 | QDir currentDir, currentRemoteDir; | 74 | QDir currentDir, currentRemoteDir; |
107 | QComboBox *currentPathCombo; | 75 | QComboBox *currentPathCombo; |
108 | QString filterStr, s_addBookmark, s_removeBookmark; | 76 | QString filterStr, s_addBookmark, s_removeBookmark; |
109 | QListViewItem * item; | 77 | QListViewItem * item; |
110 | bool b; | 78 | bool b; |
111 | QStringList fileSystemTypeList, fsList; | 79 | QStringList fileSystemTypeList, fsList; |
112 | int currentServerConfig; | 80 | int currentServerConfig; |
113 | bool zaurusDevice; | 81 | bool zaurusDevice; |
114 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; | 82 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; |
115 | QStringList remoteDirPathStringList, localDirPathStringList; | 83 | QStringList remoteDirPathStringList, localDirPathStringList; |
116 | QLineEdit *renameBox; | 84 | QLineEdit *renameBox; |
117 | 85 | ||
118 | void init(); | 86 | void init(); |
119 | void initConnections(); | 87 | void initConnections(); |
120 | void keyReleaseEvent( QKeyEvent *); | 88 | void keyReleaseEvent( QKeyEvent *); |
121 | void keyPressEvent( QKeyEvent *); | 89 | void keyPressEvent( QKeyEvent *); |
122 | QString getFileSystemType(const QString &); | 90 | QString getFileSystemType(const QString &); |
123 | QString getDiskSpace(const QString &); | 91 | QString getDiskSpace(const QString &); |
124 | void parsetab(const QString &fileName); | 92 | void parsetab(const QString &fileName); |
125 | QString checkDiskSpace(const QString &); | 93 | QString checkDiskSpace(const QString &); |
126 | QString dealWithSymName(const QString &); | 94 | QString dealWithSymName(const QString &); |
127 | QDir *CurrentDir(); | 95 | QDir *CurrentDir(); |
128 | QDir *OtherDir(); | 96 | QDir *OtherDir(); |
129 | QListView *CurrentView(); | 97 | QListView *CurrentView(); |
130 | QListView *OtherView(); | 98 | QListView *OtherView(); |
131 | void setOtherTabCurrent(); | 99 | void setOtherTabCurrent(); |
132 | 100 | ||
101 | //protected signals: | ||
102 | // void newPath(QString); | ||
103 | |||
133 | protected slots: | 104 | protected slots: |
105 | void slotSwitchMenu(int); | ||
106 | void selectAll(); | ||
107 | void addToDocs(); | ||
108 | void doDirChange(); | ||
109 | void mkDir(); | ||
110 | void del(); | ||
111 | void rn(); | ||
112 | void populateView(); | ||
113 | void rePopulate(); | ||
114 | void showHidden(); | ||
115 | void showMenuHidden(); | ||
116 | void writeConfig(); | ||
117 | void readConfig(); | ||
118 | void ListClicked(QListViewItem *); | ||
119 | void ListPressed( int, QListViewItem *, const QPoint&, int); | ||
120 | void makeDir(); | ||
121 | void doDelete(); | ||
122 | void tabChanged(QWidget*); | ||
123 | void cleanUp(); | ||
124 | void renameIt(); | ||
125 | void runThis(); | ||
126 | void runText(); | ||
127 | void filePerms(); | ||
128 | void doProperties(); | ||
129 | void runCommand(); | ||
130 | void runCommandStd(); | ||
131 | QStringList getPath(); | ||
132 | void mkSym(); | ||
133 | void switchToLocalTab(); | ||
134 | void switchToRemoteTab(); | ||
135 | void refreshCurrentTab(); | ||
134 | 136 | ||
135 | void openSearch(); | 137 | void openSearch(); |
136 | void dirMenuSelected(int); | 138 | void dirMenuSelected(int); |
137 | void showFileMenu(); | 139 | void showFileMenu(); |
138 | void homeButtonPushed(); | 140 | void homeButtonPushed(); |
139 | void docButtonPushed(); | 141 | void docButtonPushed(); |
140 | void SDButtonPushed(); | 142 | void SDButtonPushed(); |
141 | void CFButtonPushed(); | 143 | void CFButtonPushed(); |
142 | void QPEButtonPushed(); | 144 | void QPEButtonPushed(); |
143 | void upDir(); | 145 | void upDir(); |
144 | void currentPathComboChanged(); | 146 | void currentPathComboChanged(); |
147 | |||
145 | void copy(); | 148 | void copy(); |
149 | void copyTimer(); | ||
146 | void copyAs(); | 150 | void copyAs(); |
151 | void copyAsTimer(); | ||
147 | void copySameDir(); | 152 | void copySameDir(); |
148 | void currentPathComboActivated(const QString &); | 153 | void copySameDirTimer(); |
154 | void move(); | ||
155 | void moveTimer(); | ||
156 | |||
157 | void currentPathComboActivated(const QString &); | ||
149 | void fillCombo(const QString &); | 158 | void fillCombo(const QString &); |
150 | bool copyFile( const QString & , const QString & ); | 159 | bool copyFile( const QString & , const QString & ); |
151 | void move(); | ||
152 | void fileStatus(); | 160 | void fileStatus(); |
153 | void doAbout(); | 161 | void doAbout(); |
154 | void doBeam(); | 162 | void doBeam(); |
155 | void fileBeamFinished( Ir *); | 163 | void fileBeamFinished( Ir *); |
156 | bool copyDirectory( const QString & , const QString & ); | 164 | bool copyDirectory( const QString & , const QString & ); |
157 | // void navigateToSelected(); | 165 | // void navigateToSelected(); |
158 | bool moveDirectory( const QString & , const QString & ); | 166 | bool moveDirectory( const QString & , const QString & ); |
159 | 167 | ||
160 | // void slotSwitchtoLocal(int); | 168 | // void slotSwitchtoLocal(int); |
161 | 169 | ||
162 | private: | 170 | private: |
163 | MenuButton *menuButton; | 171 | MenuButton *menuButton; |
164 | QString oldName; | 172 | QString oldName, localViewDir, remoteViewDir; |
165 | void startProcess(const QString &); | 173 | void startProcess(const QString &); |
166 | bool eventFilter( QObject * , QEvent * ); | 174 | bool eventFilter( QObject * , QEvent * ); |
167 | void cancelRename(); | 175 | void cancelRename(); |
168 | void doRename(QListView *); | 176 | void doRename(QListView *); |
169 | void okRename(); | 177 | void okRename(); |
170 | void customDirsToMenu(); | 178 | void customDirsToMenu(); |
171 | void addCustomDir(); | 179 | void addCustomDir(); |
172 | void removeCustomDir(); | 180 | void removeCustomDir(); |
173 | void gotoDirectory(const QString &); | 181 | void gotoDirectory(const QString &); |
174 | void navigateToSelected(); | 182 | void navigateToSelected(); |
175 | void findFile(const QString &); | 183 | void findFile(const QString &); |
176 | 184 | ||
177 | private slots: | 185 | private slots: |
178 | void processEnded(Opie::Core::OProcess *); | 186 | void processEnded(Opie::Core::OProcess *); |
179 | void oprocessStderr(Opie::Core::OProcess *, char *, int); | 187 | void oprocessStderr(Opie::Core::OProcess *, char *, int); |
180 | void gotoCustomDir(const QString &); | 188 | void gotoCustomDir(const QString &); |
181 | void qcopReceive(const QCString&, const QByteArray&); | 189 | void qcopReceive(const QCString&, const QByteArray&); |
182 | void setDocument(const QString &); | 190 | void setDocument(const QString &); |
191 | // void doMenu(int | ||
183 | 192 | ||
184 | }; | 193 | }; |
185 | 194 | ||
186 | #endif // ADVANCEDFM_H | 195 | #endif // ADVANCEDFM_H |
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index 0644edb..713f61c 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro | |||
@@ -1,15 +1,15 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG += qt warn_on quick-app | 2 | CONFIG += qte warn_on quick-app |
3 | HEADERS = advancedfm.h filePermissions.h output.h | 3 | HEADERS = advancedfm.h filePermissions.h output.h |
4 | SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp | 4 | SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp |
5 | TARGET = advancedfm | 5 | TARGET = advancedfm |
6 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DEPENDPATH += $(OPIEDIR)/include | 7 | DEPENDPATH += $(OPIEDIR)/include |
8 | LIBS += -lqpe -lqte -lopiecore2 -lopieui2 | 8 | LIBS += -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 | ||
15 | include ( $(OPIEDIR)/include.pro ) | 15 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 1802571..d2e1d8e 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -59,238 +59,222 @@ void AdvancedFm::init() { | |||
59 | 59 | ||
60 | 60 | ||
61 | qpeDirButton= new QToolButton( 0,"QPEButton"); | 61 | qpeDirButton= new QToolButton( 0,"QPEButton"); |
62 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | 62 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); |
63 | qpeDirButton->setAutoRaise( true ); | 63 | qpeDirButton->setAutoRaise( true ); |
64 | menuBar->insertItem( qpeDirButton ); | 64 | menuBar->insertItem( qpeDirButton ); |
65 | 65 | ||
66 | cfButton = new QToolButton( 0, "CFButton"); | 66 | cfButton = new QToolButton( 0, "CFButton"); |
67 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); | 67 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); |
68 | cfButton->setAutoRaise( true ); | 68 | cfButton->setAutoRaise( true ); |
69 | menuBar->insertItem( cfButton ); | 69 | menuBar->insertItem( cfButton ); |
70 | 70 | ||
71 | sdButton = new QToolButton( 0, "SDButton"); | 71 | sdButton = new QToolButton( 0, "SDButton"); |
72 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); | 72 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); |
73 | sdButton->setAutoRaise( true ); | 73 | sdButton->setAutoRaise( true ); |
74 | menuBar->insertItem( sdButton ); | 74 | menuBar->insertItem( sdButton ); |
75 | 75 | ||
76 | docButton = new QToolButton( 0,"docsButton"); | 76 | docButton = new QToolButton( 0,"docsButton"); |
77 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | 77 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); |
78 | docButton->setAutoRaise( true ); | 78 | docButton->setAutoRaise( true ); |
79 | menuBar->insertItem( docButton ); | 79 | menuBar->insertItem( docButton ); |
80 | 80 | ||
81 | homeButton = new QToolButton( 0, "homeButton"); | 81 | homeButton = new QToolButton( 0, "homeButton"); |
82 | homeButton->setPixmap(Resource::loadPixmap("home")); | 82 | homeButton->setPixmap(Resource::loadPixmap("home")); |
83 | homeButton->setAutoRaise( true ); | 83 | homeButton->setAutoRaise( true ); |
84 | menuBar->insertItem( homeButton ); | 84 | menuBar->insertItem( homeButton ); |
85 | 85 | ||
86 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 86 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
87 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 87 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
88 | fileMenu->insertSeparator(); | 88 | fileMenu->insertSeparator(); |
89 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | 89 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); |
90 | fileMenu->insertSeparator(); | 90 | fileMenu->insertSeparator(); |
91 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 91 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
92 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 92 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
93 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 93 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
94 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 94 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
95 | fileMenu->insertSeparator(); | 95 | fileMenu->insertSeparator(); |
96 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 96 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
97 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); | 97 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); |
98 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 98 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |
99 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 99 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
100 | fileMenu->setCheckable(TRUE); | 100 | fileMenu->setCheckable(TRUE); |
101 | 101 | ||
102 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); | 102 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); |
103 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); | 103 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); |
104 | viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); | 104 | viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); |
105 | // viewMenu->insertSeparator(); | 105 | // viewMenu->insertSeparator(); |
106 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 106 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
107 | viewMenu->setCheckable(true); | 107 | viewMenu->setCheckable(true); |
108 | viewMenu->setItemChecked( viewMenu->idAt(0), true); | 108 | viewMenu->setItemChecked( viewMenu->idAt(0), true); |
109 | viewMenu->setItemChecked( viewMenu->idAt(1), false); | 109 | viewMenu->setItemChecked( viewMenu->idAt(1), false); |
110 | 110 | ||
111 | s_addBookmark = tr("Bookmark Directory"); | 111 | s_addBookmark = tr("Bookmark Directory"); |
112 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); | 112 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); |
113 | 113 | ||
114 | // menuButton->insertItem(""); | 114 | // menuButton->insertItem(""); |
115 | 115 | ||
116 | // customDirMenu->insertItem(tr("Add This Directory")); | 116 | // customDirMenu->insertItem(tr("Add This Directory")); |
117 | // customDirMenu->insertItem(tr("Remove This Directory")); | 117 | // customDirMenu->insertItem(tr("Remove This Directory")); |
118 | // customDirMenu->insertSeparator(); | 118 | // customDirMenu->insertSeparator(); |
119 | 119 | ||
120 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later | 120 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later |
121 | CBHB->setMargin( 0 ); | 121 | CBHB->setMargin( 0 ); |
122 | CBHB->setSpacing( 1 ); | 122 | CBHB->setSpacing( 1 ); |
123 | 123 | ||
124 | menuButton = new MenuButton( this ); | 124 | menuButton = new MenuButton( this ); |
125 | 125 | ||
126 | menuButton->setUseLabel(false); | 126 | menuButton->setUseLabel(false); |
127 | menuButton->setMaximumWidth( 20 ); | 127 | menuButton->setMaximumWidth( 20 ); |
128 | menuButton->insertItem( s_addBookmark); | 128 | menuButton->insertItem( s_addBookmark); |
129 | menuButton->insertItem( s_removeBookmark); | 129 | menuButton->insertItem( s_removeBookmark); |
130 | menuButton->insertSeparator(); | 130 | menuButton->insertSeparator(); |
131 | menuButton->setFocusPolicy(NoFocus); | 131 | menuButton->setFocusPolicy(NoFocus); |
132 | CBHB->addWidget( menuButton ); | 132 | CBHB->addWidget( menuButton ); |
133 | 133 | ||
134 | customDirsToMenu(); | 134 | customDirsToMenu(); |
135 | 135 | ||
136 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 136 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); |
137 | currentPathCombo->setEditable(TRUE); | 137 | currentPathCombo->setEditable(TRUE); |
138 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 138 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
139 | currentPathCombo->setFocusPolicy(NoFocus); | 139 | currentPathCombo->setFocusPolicy(NoFocus); |
140 | CBHB->addWidget( currentPathCombo ); | 140 | CBHB->addWidget( currentPathCombo ); |
141 | 141 | ||
142 | layout->addLayout( CBHB ); | 142 | layout->addLayout( CBHB ); |
143 | 143 | ||
144 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); | 144 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); |
145 | // TabWidget = new QTabWidget( this, "TabWidget" ); | 145 | // TabWidget = new QTabWidget( this, "TabWidget" ); |
146 | layout->addWidget( TabWidget, 4 ); | 146 | layout->addWidget( TabWidget, 4 ); |
147 | 147 | ||
148 | tab = new QWidget( TabWidget, "tab" ); | 148 | tab = new QWidget( TabWidget, "tab" ); |
149 | tabLayout = new QGridLayout( tab ); | 149 | tabLayout = new QGridLayout( tab ); |
150 | tabLayout->setSpacing( 2); | 150 | tabLayout->setSpacing( 2); |
151 | tabLayout->setMargin( 2); | 151 | tabLayout->setMargin( 2); |
152 | 152 | ||
153 | Local_View = new QListView( tab, "Local_View" ); | 153 | Local_View = new QListView( tab, "Local_View" ); |
154 | Local_View->addColumn( tr("File"),130); | 154 | Local_View->addColumn( tr("File"),130); |
155 | Local_View->addColumn( tr("Size"),-1); | 155 | Local_View->addColumn( tr("Size"),-1); |
156 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 156 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
157 | Local_View->addColumn( tr("Date"),-1); | 157 | Local_View->addColumn( tr("Date"),-1); |
158 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 158 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
159 | Local_View->setAllColumnsShowFocus(TRUE); | 159 | Local_View->setAllColumnsShowFocus(TRUE); |
160 | Local_View->setMultiSelection( TRUE ); | 160 | Local_View->setMultiSelection( TRUE ); |
161 | Local_View->setSelectionMode(QListView::Extended); | 161 | Local_View->setSelectionMode(QListView::Extended); |
162 | Local_View->setFocusPolicy(StrongFocus); | 162 | Local_View->setFocusPolicy(StrongFocus); |
163 | Local_View->installEventFilter( this ); | 163 | Local_View->installEventFilter( this ); |
164 | 164 | ||
165 | QPEApplication::setStylusOperation( Local_View->viewport() , QPEApplication::RightOnHold); | 165 | QPEApplication::setStylusOperation( Local_View->viewport() , QPEApplication::RightOnHold); |
166 | 166 | ||
167 | tabLayout->addWidget( Local_View, 0, 0 ); | 167 | tabLayout->addWidget( Local_View, 0, 0 ); |
168 | 168 | ||
169 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); | 169 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); |
170 | // TabWidget->insertTab( tab, tr("1")); | 170 | // TabWidget->insertTab( tab, tr("1")); |
171 | 171 | ||
172 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 172 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
173 | tabLayout_2 = new QGridLayout( tab_2 ); | 173 | tabLayout_2 = new QGridLayout( tab_2 ); |
174 | tabLayout_2->setSpacing( 2); | 174 | tabLayout_2->setSpacing( 2); |
175 | tabLayout_2->setMargin( 2); | 175 | tabLayout_2->setMargin( 2); |
176 | 176 | ||
177 | Remote_View = new QListView( tab_2, "Remote_View" ); | 177 | Remote_View = new QListView( tab_2, "Remote_View" ); |
178 | Remote_View->addColumn( tr("File"),130); | 178 | Remote_View->addColumn( tr("File"),130); |
179 | Remote_View->addColumn( tr("Size"),-1); | 179 | Remote_View->addColumn( tr("Size"),-1); |
180 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | 180 | Remote_View->setColumnAlignment(1,QListView::AlignRight); |
181 | Remote_View->addColumn( tr("Date"),-1); | 181 | Remote_View->addColumn( tr("Date"),-1); |
182 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 182 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
183 | Remote_View->setAllColumnsShowFocus(TRUE); | 183 | Remote_View->setAllColumnsShowFocus(TRUE); |
184 | Remote_View->setMultiSelection( TRUE ); | 184 | Remote_View->setMultiSelection( TRUE ); |
185 | Remote_View->setSelectionMode(QListView::Extended); | 185 | Remote_View->setSelectionMode(QListView::Extended); |
186 | Remote_View->setFocusPolicy(StrongFocus); | 186 | Remote_View->setFocusPolicy(StrongFocus); |
187 | Remote_View->installEventFilter( this ); | 187 | Remote_View->installEventFilter( this ); |
188 | 188 | ||
189 | QPEApplication::setStylusOperation( Remote_View->viewport(), QPEApplication::RightOnHold); | 189 | QPEApplication::setStylusOperation( Remote_View->viewport(), QPEApplication::RightOnHold); |
190 | 190 | ||
191 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 191 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
192 | 192 | ||
193 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); | 193 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); |
194 | TabWidget->setSizeChange( 370 ); | 194 | TabWidget->setSizeChange( 370 ); |
195 | // TabWidget->insertTab( tab_2, tr( "2")); | 195 | // TabWidget->insertTab( tab_2, tr( "2")); |
196 | 196 | ||
197 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); | 197 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); |
198 | tabLayout_3 = new QGridLayout( tab_3 ); | 198 | tabLayout_3 = new QGridLayout( tab_3 ); |
199 | tabLayout_3->setSpacing( 2); | 199 | tabLayout_3->setSpacing( 2); |
200 | tabLayout_3->setMargin( 2); | 200 | tabLayout_3->setMargin( 2); |
201 | 201 | ||
202 | 202 | ||
203 | // OFileDialog fileDialog; | 203 | // OFileDialog fileDialog; |
204 | // fileDialog; | 204 | // fileDialog; |
205 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy | 205 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy |
206 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); | 206 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); |
207 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); | 207 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); |
208 | 208 | ||
209 | QListView *fileTree; | 209 | QListView *fileTree; |
210 | fileTree = new QListView( tab_3, "tree" ); | 210 | fileTree = new QListView( tab_3, "tree" ); |
211 | 211 | ||
212 | 212 | ||
213 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); | 213 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); |
214 | 214 | ||
215 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); | 215 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); |
216 | */ | 216 | */ |
217 | 217 | ||
218 | /////////////// | 218 | /////////////// |
219 | 219 | ||
220 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 220 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
221 | zaurusDevice=TRUE; | 221 | zaurusDevice=TRUE; |
222 | else | 222 | else |
223 | zaurusDevice=FALSE; | 223 | zaurusDevice=FALSE; |
224 | 224 | ||
225 | 225 | ||
226 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { | 226 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { |
227 | odebug << "not have sd" << oendl; | 227 | odebug << "not have sd" << oendl; |
228 | sdButton->hide(); | 228 | sdButton->hide(); |
229 | } | 229 | } |
230 | if( !StorageInfo::hasCf() ) { | 230 | if( !StorageInfo::hasCf() ) { |
231 | odebug << "not have cf" << oendl; | 231 | odebug << "not have cf" << oendl; |
232 | cfButton->hide(); | 232 | cfButton->hide(); |
233 | } | 233 | } |
234 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 234 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
235 | currentDir.setPath( QDir::currentDirPath()); | 235 | currentDir.setPath( QDir::currentDirPath()); |
236 | 236 | ||
237 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 237 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
238 | currentRemoteDir.setPath( QDir::currentDirPath()); | 238 | currentRemoteDir.setPath( QDir::currentDirPath()); |
239 | 239 | ||
240 | // b = TRUE; | 240 | // b = TRUE; |
241 | 241 | ||
242 | filterStr="*"; | 242 | filterStr="*"; |
243 | showMenuHidden(); | 243 | showMenuHidden(); |
244 | TabWidget->setCurrentWidget(0); | 244 | TabWidget->setCurrentWidget(0); |
245 | 245 | ||
246 | } | 246 | } |
247 | 247 | ||
248 | void AdvancedFm::initConnections() | 248 | void AdvancedFm::initConnections() |
249 | { | 249 | { |
250 | 250 | ||
251 | connect( qApp,SIGNAL( aboutToQuit()), | 251 | connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(cleanUp())); |
252 | this, SLOT( cleanUp()) ); | 252 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); |
253 | connect( qpeDirButton ,SIGNAL(released()), | 253 | connect( cfButton ,SIGNAL(released()), this,SLOT( CFButtonPushed()) ); |
254 | this,SLOT( QPEButtonPushed()) ); | 254 | connect( sdButton ,SIGNAL(released()), this,SLOT( SDButtonPushed()) ); |
255 | connect( cfButton ,SIGNAL(released()), | 255 | connect( cdUpButton ,SIGNAL(released()), this,SLOT( upDir()) ); |
256 | this,SLOT( CFButtonPushed()) ); | 256 | connect( docButton,SIGNAL(released()), this,SLOT( docButtonPushed()) ); |
257 | connect( sdButton ,SIGNAL(released()), | 257 | connect( homeButton,SIGNAL(released()), this,SLOT( homeButtonPushed()) ); |
258 | this,SLOT( SDButtonPushed()) ); | 258 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), this, SLOT( currentPathComboActivated(const QString&) ) ); |
259 | connect( cdUpButton ,SIGNAL(released()), | 259 | |
260 | this,SLOT( upDir()) ); | 260 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), this,SLOT(currentPathComboChanged())); |
261 | connect( docButton,SIGNAL(released()), | 261 | |
262 | this,SLOT( docButtonPushed()) ); | 262 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); |
263 | connect( homeButton,SIGNAL(released()), | 263 | |
264 | this,SLOT( homeButtonPushed()) ); | 264 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
265 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), | 265 | |
266 | this, SLOT( currentPathComboActivated(const QString&) ) ); | 266 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); |
267 | 267 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | |
268 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 268 | |
269 | this,SLOT(currentPathComboChanged())); | 269 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), this,SLOT(tabChanged(QWidget*))); |
270 | 270 | ||
271 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), | 271 | connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), this, SLOT(showFileMenu())); |
272 | this,SLOT( ListClicked(QListViewItem*)) ); | 272 | connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), this, SLOT(showFileMenu())); |
273 | |||
274 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), | ||
275 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | ||
276 | |||
277 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), | ||
278 | this,SLOT( ListClicked(QListViewItem*)) ); | ||
279 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), | ||
280 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | ||
281 | |||
282 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), | ||
283 | this,SLOT(tabChanged(QWidget*))); | ||
284 | |||
285 | connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), | ||
286 | this, SLOT(showFileMenu())); | ||
287 | connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), | ||
288 | this, SLOT(showFileMenu())); | ||
289 | 273 | ||
290 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); | 274 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); |
291 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); | 275 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); |
292 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); | 276 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); |
293 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | 277 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); |
294 | 278 | ||
295 | } | 279 | } |
296 | 280 | ||
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 8d04c68..5a46579 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -82,763 +82,762 @@ QString AdvancedFm::dealWithSymName(const QString &fileName) { | |||
82 | void AdvancedFm::runThis() { | 82 | void AdvancedFm::runThis() { |
83 | if( !CurrentView()->currentItem()) return; | 83 | if( !CurrentView()->currentItem()) return; |
84 | QString fs; | 84 | QString fs; |
85 | QDir *thisDir = CurrentDir(); | 85 | QDir *thisDir = CurrentDir(); |
86 | 86 | ||
87 | QString curFile = CurrentView()->currentItem()->text(0); | 87 | QString curFile = CurrentView()->currentItem()->text(0); |
88 | QString path = thisDir->canonicalPath(); | 88 | QString path = thisDir->canonicalPath(); |
89 | 89 | ||
90 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 90 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
91 | 91 | ||
92 | curFile = dealWithSymName((const QString&)curFile); | 92 | curFile = dealWithSymName((const QString&)curFile); |
93 | 93 | ||
94 | if(curFile != "../") { | 94 | if(curFile != "../") { |
95 | 95 | ||
96 | fs = getFileSystemType((const QString &) path); | 96 | fs = getFileSystemType((const QString &) path); |
97 | QFileInfo fileInfo( path + "/" + curFile); | 97 | QFileInfo fileInfo( path + "/" + curFile); |
98 | // odebug << fileInfo.owner() << oendl; | 98 | // odebug << fileInfo.owner() << oendl; |
99 | 99 | ||
100 | if( (fileInfo.permission( QFileInfo::ExeUser) | 100 | if( (fileInfo.permission( QFileInfo::ExeUser) |
101 | | fileInfo.permission( QFileInfo::ExeGroup) | 101 | | fileInfo.permission( QFileInfo::ExeGroup) |
102 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { | 102 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { |
103 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { | 103 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { |
104 | QCopEnvelope e("QPE/System", "execute(QString)" ); | 104 | QCopEnvelope e("QPE/System", "execute(QString)" ); |
105 | e << curFile; | 105 | e << curFile; |
106 | } else { | 106 | } else { |
107 | curFile = path + "/" + curFile; | 107 | curFile = path + "/" + curFile; |
108 | DocLnk nf(curFile); | 108 | DocLnk nf(curFile); |
109 | QString execStr = nf.exec(); | 109 | QString execStr = nf.exec(); |
110 | // odebug << execStr << oendl; | 110 | // odebug << execStr << oendl; |
111 | if( execStr.isEmpty() ) { | 111 | if( execStr.isEmpty() ) { |
112 | } else { | 112 | } else { |
113 | nf.execute(); | 113 | nf.execute(); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | void AdvancedFm::runText() { | 119 | void AdvancedFm::runText() { |
120 | if( !CurrentView()->currentItem()) return; | 120 | if( !CurrentView()->currentItem()) return; |
121 | QString curFile = CurrentView()->currentItem()->text(0); | 121 | QString curFile = CurrentView()->currentItem()->text(0); |
122 | if(curFile != "../") { | 122 | if(curFile != "../") { |
123 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 123 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
124 | curFile = dealWithSymName((const QString&)curFile); | 124 | curFile = dealWithSymName((const QString&)curFile); |
125 | curFile = CurrentDir()->canonicalPath()+"/"+curFile; | 125 | curFile = CurrentDir()->canonicalPath()+"/"+curFile; |
126 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); | 126 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); |
127 | e << curFile; | 127 | e << curFile; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | void AdvancedFm::makeDir() { | 131 | void AdvancedFm::makeDir() { |
132 | InputDialog *fileDlg; | 132 | InputDialog *fileDlg; |
133 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); | 133 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
134 | fileDlg->exec(); | 134 | fileDlg->exec(); |
135 | if( fileDlg->result() == 1 ) { | 135 | if( fileDlg->result() == 1 ) { |
136 | QDir *thisDir = CurrentDir(); | 136 | QDir *thisDir = CurrentDir(); |
137 | QString filename = fileDlg->LineEdit1->text(); | 137 | QString filename = fileDlg->LineEdit1->text(); |
138 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); | 138 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); |
139 | } | 139 | } |
140 | populateView(); | 140 | populateView(); |
141 | } | 141 | } |
142 | 142 | ||
143 | void AdvancedFm::doDelete() { | 143 | void AdvancedFm::doDelete() { |
144 | QStringList curFileList = getPath(); | 144 | QStringList curFileList = getPath(); |
145 | bool doMsg=true; | 145 | bool doMsg=true; |
146 | int count = curFileList.count(); | 146 | int count = curFileList.count(); |
147 | if( count > 0) { | 147 | if( count > 0) { |
148 | if(count > 1 ) { | 148 | if(count > 1 ) { |
149 | QString msg; | 149 | QString msg; |
150 | msg=tr("Really delete\n%1 files?").arg(count); | 150 | msg=tr("Really delete\n%1 files?").arg(count); |
151 | switch ( QMessageBox::warning(this,tr("Delete"),msg | 151 | switch ( QMessageBox::warning(this,tr("Delete"),msg |
152 | ,tr("Yes"),tr("No"),0,0,1) ) | 152 | ,tr("Yes"),tr("No"),0,0,1) ) |
153 | { | 153 | { |
154 | case 0: | 154 | case 0: |
155 | doMsg=false; | 155 | doMsg=false; |
156 | break; | 156 | break; |
157 | case 1: | 157 | case 1: |
158 | return; | 158 | return; |
159 | break; | 159 | break; |
160 | }; | 160 | }; |
161 | } | 161 | } |
162 | 162 | ||
163 | QString myFile; | 163 | QString myFile; |
164 | 164 | ||
165 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 165 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
166 | myFile = (*it); | 166 | myFile = (*it); |
167 | if( myFile.find(" -> ",0,TRUE) != -1) | 167 | if( myFile.find(" -> ",0,TRUE) != -1) |
168 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); | 168 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); |
169 | 169 | ||
170 | QString f = CurrentDir()->canonicalPath(); | 170 | QString f = CurrentDir()->canonicalPath(); |
171 | if(f.right(1).find("/",0,TRUE) == -1) | 171 | if(f.right(1).find("/",0,TRUE) == -1) |
172 | f += "/"; | 172 | f += "/"; |
173 | f += myFile; | 173 | f += myFile; |
174 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { | 174 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { |
175 | //if file is a directory | 175 | //if file is a directory |
176 | 176 | ||
177 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), | 177 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), |
178 | tr("Really delete %1\nand all it's contents ?" ).arg( f ) , | 178 | tr("Really delete %1\nand all it's contents ?" ).arg( f ) , |
179 | tr("Yes"), tr("No"), 0, 0, 1) ) { | 179 | tr("Yes"), tr("No"), 0, 0, 1) ) { |
180 | case 0: | 180 | case 0: |
181 | { | 181 | { |
182 | f=f.left(f.length()-1); | 182 | f=f.left(f.length()-1); |
183 | QString cmd="rm -rf "+f; | 183 | QString cmd="rm -rf "+f; |
184 | startProcess( (const QString)cmd.latin1() ); | 184 | startProcess( (const QString)cmd.latin1() ); |
185 | populateView(); | 185 | populateView(); |
186 | } | 186 | } |
187 | break; | 187 | break; |
188 | case 1: | 188 | case 1: |
189 | // exit | 189 | // exit |
190 | break; | 190 | break; |
191 | }; | 191 | }; |
192 | 192 | ||
193 | } else { | 193 | } else { |
194 | if(doMsg) { | 194 | if(doMsg) { |
195 | switch ( QMessageBox::warning(this,tr("Delete"), | 195 | switch ( QMessageBox::warning(this,tr("Delete"), |
196 | tr("Really delete\n%1?").arg( myFile ), | 196 | tr("Really delete\n%1?").arg( myFile ), |
197 | tr("Yes"), tr("No"), 0, 0, 1) ) { | 197 | tr("Yes"), tr("No"), 0, 0, 1) ) { |
198 | case 1: | 198 | case 1: |
199 | return; | 199 | return; |
200 | break; | 200 | break; |
201 | }; | 201 | }; |
202 | } | 202 | } |
203 | 203 | ||
204 | QString cmd="rm "+f; | 204 | QString cmd="rm "+f; |
205 | QFile file(f); | 205 | QFile file(f); |
206 | QFileInfo fi(myFile); | 206 | QFileInfo fi(myFile); |
207 | if( fi.fileName().find("../",0,TRUE)==-1) { | 207 | if( fi.fileName().find("../",0,TRUE)==-1) { |
208 | // odebug << "remove link files "+myFile << oendl; | 208 | // odebug << "remove link files "+myFile << oendl; |
209 | 209 | ||
210 | // DocLnk lnk(f); | 210 | // DocLnk lnk(f); |
211 | DocLnk *lnk; | 211 | DocLnk *lnk; |
212 | lnk = new DocLnk(f); | 212 | lnk = new DocLnk(f); |
213 | // odebug << "Deleting doclnk " + lnk->linkFile() << oendl; | 213 | // odebug << "Deleting doclnk " + lnk->linkFile() << oendl; |
214 | if(lnk->isValid()) | 214 | if(lnk->isValid()) |
215 | lnk->removeLinkFile(); | 215 | lnk->removeLinkFile(); |
216 | // delete lnk; | 216 | // delete lnk; |
217 | file.remove(); | 217 | file.remove(); |
218 | } | 218 | } |
219 | } | 219 | } |
220 | } | 220 | } |
221 | } | 221 | } |
222 | populateView(); | 222 | populateView(); |
223 | } | 223 | } |
224 | 224 | ||
225 | void AdvancedFm::filePerms() { | 225 | void AdvancedFm::filePerms() { |
226 | QStringList curFileList = getPath(); | 226 | QStringList curFileList = getPath(); |
227 | QString filePath; | 227 | QString filePath; |
228 | 228 | ||
229 | filePath = CurrentDir()->canonicalPath()+"/"; | 229 | filePath = CurrentDir()->canonicalPath()+"/"; |
230 | 230 | ||
231 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 231 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
232 | filePermissions *filePerm; | 232 | filePermissions *filePerm; |
233 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); | 233 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); |
234 | QPEApplication::execDialog( filePerm ); | 234 | QPEApplication::execDialog( filePerm ); |
235 | if( filePerm ) | 235 | if( filePerm ) |
236 | delete filePerm; | 236 | delete filePerm; |
237 | } | 237 | } |
238 | populateView(); | 238 | populateView(); |
239 | } | 239 | } |
240 | 240 | ||
241 | void AdvancedFm::doProperties() { | 241 | void AdvancedFm::doProperties() { |
242 | #if defined(QT_QWS_OPIE) | 242 | #if defined(QT_QWS_OPIE) |
243 | 243 | ||
244 | QStringList curFileList = getPath(); | 244 | QStringList curFileList = getPath(); |
245 | 245 | ||
246 | QString filePath; | 246 | QString filePath; |
247 | filePath = CurrentDir()->canonicalPath()+"/"; | 247 | filePath = CurrentDir()->canonicalPath()+"/"; |
248 | 248 | ||
249 | // odebug << "" << curFileList.count() << "" << oendl; | 249 | // odebug << "" << curFileList.count() << "" << oendl; |
250 | 250 | ||
251 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 251 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
252 | // odebug << (filePath+*it) << oendl; | 252 | // odebug << (filePath+*it) << oendl; |
253 | DocLnk lnk( (filePath+*it)); | 253 | DocLnk lnk( (filePath+*it)); |
254 | LnkProperties prop( &lnk ); | 254 | LnkProperties prop( &lnk ); |
255 | QPEApplication::execDialog( &prop ); | 255 | QPEApplication::execDialog( &prop ); |
256 | } | 256 | } |
257 | #endif | 257 | #endif |
258 | 258 | ||
259 | } | 259 | } |
260 | 260 | ||
261 | void AdvancedFm::upDir() { | 261 | void AdvancedFm::upDir() { |
262 | QDir *thisDir = CurrentDir(); | 262 | QDir *thisDir = CurrentDir(); |
263 | QString current = thisDir->canonicalPath(); | 263 | QString current = thisDir->canonicalPath(); |
264 | QDir dir(current); | 264 | QDir dir(current); |
265 | dir.cdUp(); | 265 | dir.cdUp(); |
266 | current = dir.canonicalPath(); | 266 | current = dir.canonicalPath(); |
267 | chdir( current.latin1() ); | 267 | chdir( current.latin1() ); |
268 | thisDir->cd( current, TRUE); | 268 | thisDir->cd( current, TRUE); |
269 | 269 | ||
270 | populateView(); | 270 | populateView(); |
271 | update(); | 271 | update(); |
272 | } | 272 | } |
273 | 273 | ||
274 | void AdvancedFm::copyTimer() { | ||
275 | QTimer::singleShot(125,this,SLOT(copy())); | ||
276 | } | ||
277 | |||
274 | void AdvancedFm::copy() { | 278 | void AdvancedFm::copy() { |
275 | qApp->processEvents(); | 279 | QStringList curFileList = getPath(); |
276 | QStringList curFileList = getPath(); | ||
277 | 280 | ||
278 | QDir *thisDir = CurrentDir(); | 281 | QDir *thisDir = CurrentDir(); |
279 | QDir *thatDir = OtherDir(); | 282 | QDir *thatDir = OtherDir(); |
280 | 283 | ||
281 | bool doMsg=true; | 284 | bool doMsg=true; |
282 | int count=curFileList.count(); | 285 | int count=curFileList.count(); |
283 | if( count > 0) { | 286 | if( count > 0) { |
284 | if(count > 1 ){ | 287 | if(count > 1 ){ |
285 | QString msg; | 288 | QString msg; |
286 | msg=tr("Really copy\n%1 files?").arg(count); | 289 | msg=tr("Really copy\n%1 files?").arg(count); |
287 | switch ( QMessageBox::warning(this,tr("Copy"),msg | 290 | switch ( QMessageBox::warning(this,tr("Copy"),msg |
288 | ,tr("Yes"),tr("No"),0,0,1) ) | 291 | ,tr("Yes"),tr("No"),0,0,1) ) |
289 | { | 292 | { |
290 | case 0: | 293 | case 0: |
291 | doMsg=false; | 294 | doMsg=false; |
292 | break; | 295 | break; |
293 | case 1: | 296 | case 1: |
294 | return; | 297 | return; |
295 | break; | 298 | break; |
296 | }; | 299 | }; |
297 | } | 300 | } |
298 | 301 | ||
299 | QString curFile, item, destFile; | 302 | QString curFile, item, destFile; |
300 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 303 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
301 | item=(*it); | 304 | item=(*it); |
302 | if(item.find("->",0,TRUE)) //symlink | 305 | if(item.find("->",0,TRUE)) //symlink |
303 | item = item.left(item.find("->",0,TRUE)); | 306 | item = item.left(item.find("->",0,TRUE)); |
304 | 307 | ||
305 | curFile = thisDir->canonicalPath()+"/"+ item; | 308 | curFile = thisDir->canonicalPath()+"/"+ item; |
306 | destFile = thatDir->canonicalPath()+"/"+ item; | 309 | destFile = thatDir->canonicalPath()+"/"+ item; |
307 | 310 | ||
308 | // odebug << "Destination file is "+destFile << oendl; | 311 | // odebug << "Destination file is "+destFile << oendl; |
309 | // odebug << "CurrentFile file is " + curFile << oendl; | 312 | // odebug << "CurrentFile file is " + curFile << oendl; |
310 | 313 | ||
311 | QFile f(destFile); | 314 | QFile f(destFile); |
312 | if( f.exists()) { | 315 | if( f.exists()) { |
313 | if(doMsg) { | 316 | if(doMsg) { |
314 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 317 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
315 | tr("%1 exists. Ok to overwrite?").arg( item ), | 318 | tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), |
316 | tr("Yes"),tr("No"),0,0,1) ) { | 319 | tr("Yes"),tr("No"),0,0,1)) { |
317 | case 1: | 320 | case 1: |
318 | return; | 321 | return; |
319 | break; | 322 | break; |
320 | }; | 323 | }; |
321 | } | 324 | } |
322 | f.remove(); | 325 | f.remove(); |
323 | } | 326 | } |
324 | 327 | ||
325 | if( !copyFile( curFile, destFile) ) { | 328 | if( !copyFile( curFile, destFile) ) { |
326 | QMessageBox::message("AdvancedFm", | 329 | QMessageBox::message("AdvancedFm", |
327 | tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); | 330 | tr( "<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); |
328 | return; | 331 | return; |
329 | } | 332 | } |
330 | } | 333 | } |
331 | setOtherTabCurrent(); | 334 | rePopulate(); |
332 | rePopulate(); | ||
333 | } | 335 | } |
334 | } | 336 | } |
335 | 337 | ||
338 | void AdvancedFm::copyAsTimer() { | ||
339 | QTimer::singleShot(125,this,SLOT(copyAs())); | ||
340 | } | ||
341 | |||
336 | void AdvancedFm::copyAs() { | 342 | void AdvancedFm::copyAs() { |
337 | 343 | ||
338 | QStringList curFileList = getPath(); | 344 | QStringList curFileList = getPath(); |
339 | QString curFile, item; | 345 | QString curFile, item; |
340 | InputDialog *fileDlg; | 346 | InputDialog *fileDlg; |
341 | 347 | ||
342 | QDir *thisDir = CurrentDir(); | 348 | QDir *thisDir = CurrentDir(); |
343 | QDir *thatDir = OtherDir(); | 349 | QDir *thatDir = OtherDir(); |
344 | 350 | ||
345 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 351 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
346 | QString destFile; | 352 | QString destFile; |
347 | item=(*it); | 353 | item=(*it); |
348 | curFile = thisDir->canonicalPath()+"/"+(*it); | 354 | curFile = thisDir->canonicalPath()+"/"+(*it); |
349 | fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0); | 355 | fileDlg = new InputDialog( this, tr("Copy %1 As").arg(curFile), TRUE, 0); |
350 | 356 | ||
351 | fileDlg->setInputText((const QString &) destFile ); | 357 | fileDlg->setInputText((const QString &) destFile ); |
352 | fileDlg->exec(); | 358 | fileDlg->exec(); |
353 | 359 | ||
354 | if( fileDlg->result() == 1 ) { | 360 | if( fileDlg->result() == 1 ) { |
355 | QString filename = fileDlg->LineEdit1->text(); | 361 | QString filename = fileDlg->LineEdit1->text(); |
356 | destFile = thatDir->canonicalPath()+"/"+filename; | 362 | destFile = thatDir->canonicalPath()+"/"+filename; |
357 | 363 | ||
358 | QFile f( destFile); | 364 | QFile f( destFile); |
359 | if( f.exists()) { | 365 | if( f.exists()) { |
360 | switch (QMessageBox::warning(this,tr("File Exists!"), | 366 | switch (QMessageBox::warning(this,tr("File Exists!"), |
361 | item+tr("\nexists. Ok to overwrite?"), | 367 | tr("<P> %1 already exists. Ok to overwrite?</p>").arg(item), |
362 | tr("Yes"),tr("No"),0,0,1) ) { | 368 | tr("Yes"),tr("No"),0,0,1) ) { |
363 | case 0: | 369 | case 0: |
364 | f.remove(); | 370 | f.remove(); |
365 | break; | 371 | break; |
366 | case 1: | 372 | case 1: |
367 | return; | 373 | return; |
368 | break; | 374 | break; |
369 | }; | 375 | }; |
370 | } | 376 | } |
371 | if( !copyFile( curFile, destFile) ) { | 377 | if( !copyFile( curFile, destFile) ) { |
372 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 378 | QMessageBox::message("AdvancedFm",tr("<p>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); |
373 | +curFile +tr("to\n")+destFile); | ||
374 | return; | 379 | return; |
375 | } | 380 | } |
376 | } | 381 | } |
377 | delete fileDlg; | 382 | delete fileDlg; |
378 | 383 | ||
379 | } | 384 | } |
380 | rePopulate(); | 385 | rePopulate(); |
381 | setOtherTabCurrent(); | 386 | // setOtherTabCurrent(); |
382 | qApp->processEvents(); | 387 | qApp->processEvents(); |
383 | 388 | ||
384 | } | 389 | } |
385 | 390 | ||
391 | void AdvancedFm::copySameDirTimer() { | ||
392 | QTimer::singleShot(125,this,SLOT(copySameDir())); | ||
393 | } | ||
394 | |||
386 | void AdvancedFm::copySameDir() { | 395 | void AdvancedFm::copySameDir() { |
387 | qApp->processEvents(); | 396 | qApp->processEvents(); |
388 | QStringList curFileList = getPath(); | 397 | QStringList curFileList = getPath(); |
389 | QString curFile, item, destFile; | 398 | QString curFile, item, destFile; |
390 | InputDialog *fileDlg; | 399 | InputDialog *fileDlg; |
391 | 400 | ||
392 | QDir *thisDir = CurrentDir(); | 401 | QDir *thisDir = CurrentDir(); |
393 | 402 | ||
394 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 403 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
395 | item=(*it); | 404 | item=(*it); |
396 | curFile = thisDir->canonicalPath()+"/"+ item; | 405 | curFile = thisDir->canonicalPath()+"/"+ item; |
397 | 406 | ||
398 | fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); | 407 | fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); |
399 | fileDlg->setInputText((const QString &) destFile ); | 408 | fileDlg->setInputText((const QString &) destFile ); |
400 | fileDlg->exec(); | 409 | fileDlg->exec(); |
401 | 410 | ||
402 | if( fileDlg->result() == 1 ) { | 411 | if( fileDlg->result() == 1 ) { |
403 | 412 | ||
404 | QString filename = fileDlg->LineEdit1->text(); | 413 | QString filename = fileDlg->LineEdit1->text(); |
405 | destFile = thisDir->canonicalPath()+"/"+filename; | 414 | destFile = thisDir->canonicalPath()+"/"+filename; |
406 | 415 | ||
407 | QFile f(destFile); | 416 | QFile f(destFile); |
408 | if( f.exists()) { | 417 | if( f.exists()) { |
409 | switch (QMessageBox::warning(this,tr("Delete"), | 418 | switch (QMessageBox::warning(this,tr("Delete"), |
410 | destFile+tr(" already exists.\nDo you really want to delete it?"), | 419 | tr("<p> %1 already exists. Do you really want to delete it?</P>").arg(destFile), |
411 | tr("Yes"),tr("No"),0,0,1) ) { | 420 | tr("Yes"),tr("No"),0,0,1) ) { |
412 | case 0: | 421 | case 0: |
413 | 422 | ||
414 | f.remove(); | 423 | f.remove(); |
415 | break; | 424 | break; |
416 | case 1: | 425 | case 1: |
417 | return; | 426 | return; |
418 | break; | 427 | break; |
419 | }; | 428 | }; |
420 | } | 429 | } |
421 | if(!copyFile( curFile,destFile) ) { | 430 | if(!copyFile( curFile,destFile) ) { |
422 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 431 | QMessageBox::message("AdvancedFm",tr("<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); |
423 | +curFile +tr("to\n")+destFile); | ||
424 | return; | 432 | return; |
425 | } | 433 | } |
426 | 434 | ||
427 | // odebug << "copy "+curFile+" as "+destFile << oendl; | 435 | // odebug << "copy "+curFile+" as "+destFile << oendl; |
428 | } | 436 | } |
429 | delete fileDlg; | 437 | delete fileDlg; |
430 | } | 438 | } |
431 | rePopulate(); | 439 | rePopulate(); |
432 | } | 440 | } |
433 | 441 | ||
442 | void AdvancedFm::moveTimer() { | ||
443 | QTimer::singleShot(125,this,SLOT(move())); | ||
444 | } | ||
445 | |||
434 | void AdvancedFm::move() { | 446 | void AdvancedFm::move() { |
435 | qApp->processEvents(); | ||
436 | 447 | ||
437 | QStringList curFileList = getPath(); | 448 | QStringList curFileList = getPath(); |
438 | if( curFileList.count() > 0) { | 449 | if( curFileList.count() > 0) { |
439 | QString curFile, destFile, item; | 450 | QString curFile, destFile, item; |
440 | 451 | ||
441 | QDir *thisDir = CurrentDir(); | 452 | QDir *thisDir = CurrentDir(); |
442 | QDir *thatDir = OtherDir(); | 453 | QDir *thatDir = OtherDir(); |
443 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 454 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
444 | item=(*it); | 455 | item=(*it); |
445 | QString destFile = thatDir->canonicalPath(); | 456 | QString destFile = thatDir->canonicalPath(); |
446 | 457 | ||
447 | if(destFile.right(1).find("/",0,TRUE) == -1) | 458 | if(destFile.right(1).find("/",0,TRUE) == -1) |
448 | destFile+="/"; | 459 | destFile+="/"; |
449 | destFile += item; | 460 | destFile += item; |
450 | // odebug << "Destination file is "+destFile << oendl; | 461 | // odebug << "Destination file is "+destFile << oendl; |
451 | 462 | ||
452 | curFile = thisDir->canonicalPath(); | 463 | curFile = thisDir->canonicalPath(); |
453 | if(curFile.right(1).find("/",0,TRUE) == -1) | 464 | if(curFile.right(1).find("/",0,TRUE) == -1) |
454 | curFile +="/"; | 465 | curFile +="/"; |
455 | curFile+= item; | 466 | curFile+= item; |
456 | // odebug << "CurrentFile file is " + curFile << oendl; | 467 | // odebug << "CurrentFile file is " + curFile << oendl; |
457 | 468 | ||
458 | if(QFileInfo(curFile).isDir()) { | 469 | if(QFileInfo(curFile).isDir()) { |
459 | moveDirectory( curFile, destFile ); | 470 | moveDirectory( curFile, destFile ); |
460 | rePopulate(); | 471 | rePopulate(); |
461 | return; | 472 | return; |
462 | } | 473 | } |
463 | 474 | QFile f( curFile); | |
464 | QFile f( curFile); | ||
465 | if( f.exists()) { | 475 | if( f.exists()) { |
466 | if( !copyFile( curFile, destFile) ) { | 476 | if( !copyFile( curFile, destFile) ) { |
467 | QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); | 477 | QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); |
468 | return; | 478 | return; |
469 | } else | 479 | } else |
470 | QFile::remove(curFile); | 480 | QFile::remove(curFile); |
471 | } | 481 | } |
472 | } | 482 | } |
473 | 483 | ||
474 | } | 484 | } |
475 | rePopulate(); | 485 | rePopulate(); |
476 | setOtherTabCurrent(); | 486 | //setOtherTabCurrent(); |
477 | } | 487 | } |
478 | 488 | ||
479 | bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) { | 489 | bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) { |
480 | int err = 0; | 490 | int err = 0; |
481 | if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src; | 491 | if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src; |
482 | err = system((const char*)cmd); | 492 | err = system((const char*)cmd); |
483 | } else | 493 | } else |
484 | err = -1; | 494 | err = -1; |
485 | 495 | ||
486 | if(err!=0) { | 496 | if(err!=0) { |
487 | QMessageBox::message(tr("Note"),tr("Could not move\n") + src); | 497 | QMessageBox::message(tr("Note"),tr("Could not move\n") + src); |
488 | return false; | 498 | return false; |
489 | } | 499 | } |
490 | return true; | 500 | return true; |
491 | } | 501 | } |
492 | 502 | ||
493 | bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { | 503 | bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { |
494 | 504 | ||
495 | QString cmd = "/bin/cp -fpR " + src + " " + dest; | 505 | QString cmd = "/bin/cp -fpR " + src + " " + dest; |
496 | owarn << cmd << oendl; | 506 | owarn << cmd << oendl; |
497 | int err = system( (const char *) cmd ); | 507 | int err = system( (const char *) cmd ); |
498 | if ( err != 0 ) { | 508 | if ( err != 0 ) { |
499 | QMessageBox::message("AdvancedFm", | 509 | QMessageBox::message("AdvancedFm", |
500 | tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); | 510 | tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); |
501 | return false; | 511 | return false; |
502 | } | 512 | } |
503 | 513 | ||
504 | return true; | 514 | return true; |
505 | } | 515 | } |
506 | 516 | ||
507 | 517 | ||
508 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { | 518 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { |
509 | 519 | if(QFileInfo(src).isDir()) { | |
510 | 520 | if( copyDirectory( src, dest )) { | |
511 | if(QFileInfo(src).isDir()) { | 521 | // setOtherTabCurrent(); |
512 | if( copyDirectory( src, dest )) { | 522 | rePopulate(); |
513 | setOtherTabCurrent(); | 523 | return true; |
514 | populateView(); | 524 | } |
515 | return true; | 525 | else |
516 | } | 526 | return false; |
517 | else | 527 | } |
518 | return false; | 528 | |
519 | } | 529 | |
520 | 530 | bool success = true; | |
521 | 531 | struct stat status; | |
522 | bool success = true; | 532 | QFile srcFile(src); |
523 | struct stat status; | 533 | QFile destFile(dest); |
524 | QFile srcFile(src); | 534 | int err=0; |
525 | QFile destFile(dest); | 535 | int read_fd=0; |
526 | int err=0; | 536 | int write_fd=0; |
527 | int read_fd=0; | 537 | struct stat stat_buf; |
528 | int write_fd=0; | 538 | off_t offset = 0; |
529 | struct stat stat_buf; | 539 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { |
530 | off_t offset = 0; | ||
531 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { | ||
532 | // owarn << "open failed" << oendl; | 540 | // owarn << "open failed" << oendl; |
533 | return success = false; | 541 | return success = false; |
534 | } | 542 | } |
535 | read_fd = srcFile.handle(); | 543 | read_fd = srcFile.handle(); |
536 | if(read_fd != -1) { | 544 | if(read_fd != -1) { |
537 | fstat (read_fd, &stat_buf); | 545 | fstat (read_fd, &stat_buf); |
538 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { | 546 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { |
539 | // owarn << "destfile open failed" << oendl; | 547 | // owarn << "destfile open failed" << oendl; |
540 | return success = false; | 548 | return success = false; |
541 | } | 549 | } |
542 | write_fd = destFile.handle(); | 550 | write_fd = destFile.handle(); |
543 | if(write_fd != -1) { | 551 | if(write_fd != -1) { |
544 | err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); | 552 | err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); |
545 | if( err == -1) { | 553 | if( err == -1) { |
546 | QString msg; | 554 | QString msg; |
547 | switch(err) { | 555 | switch(err) { |
548 | case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; | 556 | case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; |
549 | case EINVAL: msg = "Descriptor is not valid or locked. "; | 557 | case EINVAL: msg = "Descriptor is not valid or locked. "; |
550 | case ENOMEM: msg = "Insufficient memory to read from in_fd."; | 558 | case ENOMEM: msg = "Insufficient memory to read from in_fd."; |
551 | case EIO: msg = "Unspecified error while reading from in_fd."; | 559 | case EIO: msg = "Unspecified error while reading from in_fd."; |
552 | }; | 560 | }; |
553 | success = false; | 561 | success = false; |
554 | // owarn << msg << oendl; | 562 | // owarn << msg << oendl; |
555 | } | 563 | } |
556 | } else { | 564 | } else { |
557 | success = false; | 565 | success = false; |
558 | } | 566 | } |
559 | } else { | 567 | } else { |
560 | success = false; | 568 | success = false; |
561 | } | 569 | } |
562 | srcFile.close(); | 570 | srcFile.close(); |
563 | destFile.close(); | 571 | destFile.close(); |
564 | // Set file permissions | 572 | // Set file permissions |
565 | if( stat( QFile::encodeName(src), &status ) == 0 ) { | 573 | if( stat( QFile::encodeName(src), &status ) == 0 ) { |
566 | chmod( QFile::encodeName(dest), status.st_mode ); | 574 | chmod( QFile::encodeName(dest), status.st_mode ); |
567 | } | 575 | } |
568 | 576 | ||
569 | return success; | 577 | return success; |
570 | } | 578 | } |
571 | 579 | ||
572 | void AdvancedFm::runCommand() { | 580 | void AdvancedFm::runCommand() { |
573 | if( !CurrentView()->currentItem()) return; | 581 | if( !CurrentView()->currentItem()) return; |
574 | QDir *thisDir = CurrentDir(); | 582 | QDir *thisDir = CurrentDir(); |
575 | 583 | ||
576 | QString curFile; | 584 | QString curFile; |
577 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); | 585 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); |
578 | 586 | ||
579 | InputDialog *fileDlg; | 587 | InputDialog *fileDlg; |
580 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 588 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
581 | fileDlg->setInputText(curFile); | 589 | fileDlg->setInputText(curFile); |
582 | fileDlg->exec(); | 590 | fileDlg->exec(); |
583 | //QString command; | 591 | //QString command; |
584 | 592 | ||
585 | if( fileDlg->result() == 1 ) { | 593 | if( fileDlg->result() == 1 ) { |
586 | // odebug << fileDlg->LineEdit1->text() << oendl; | 594 | // odebug << fileDlg->LineEdit1->text() << oendl; |
587 | QStringList command; | 595 | QStringList command; |
588 | 596 | ||
589 | command << "/bin/sh"; | 597 | command << "/bin/sh"; |
590 | command << "-c"; | 598 | command << "-c"; |
591 | command << fileDlg->LineEdit1->text(); | 599 | command << fileDlg->LineEdit1->text(); |
592 | Output *outDlg; | 600 | Output *outDlg; |
593 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 601 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
594 | QPEApplication::execDialog( outDlg ); | 602 | QPEApplication::execDialog( outDlg ); |
595 | qApp->processEvents(); | 603 | qApp->processEvents(); |
596 | 604 | ||
597 | } | 605 | } |
598 | } | 606 | } |
599 | 607 | ||
600 | void AdvancedFm::runCommandStd() { | 608 | void AdvancedFm::runCommandStd() { |
601 | if( !CurrentView()->currentItem()) return; | 609 | if( !CurrentView()->currentItem()) return; |
602 | QString curFile; | 610 | QString curFile; |
603 | QDir *thisDir = CurrentDir(); | 611 | QDir *thisDir = CurrentDir(); |
604 | QListView *thisView = CurrentView(); | 612 | QListView *thisView = CurrentView(); |
605 | if( thisView->currentItem()) | 613 | if( thisView->currentItem()) |
606 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); | 614 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); |
607 | 615 | ||
608 | InputDialog *fileDlg; | 616 | InputDialog *fileDlg; |
609 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 617 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
610 | fileDlg->setInputText(curFile); | 618 | fileDlg->setInputText(curFile); |
611 | fileDlg->exec(); | 619 | fileDlg->exec(); |
612 | 620 | ||
613 | if( fileDlg->result() == 1 ) { | 621 | if( fileDlg->result() == 1 ) { |
614 | qApp->processEvents(); | 622 | qApp->processEvents(); |
615 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); | 623 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); |
616 | } | 624 | } |
617 | } | 625 | } |
618 | 626 | ||
619 | void AdvancedFm::fileStatus() { | 627 | void AdvancedFm::fileStatus() { |
620 | if( !CurrentView()->currentItem()) return; | 628 | if( !CurrentView()->currentItem()) return; |
621 | QString curFile; | 629 | QString curFile; |
622 | curFile = CurrentView()->currentItem()->text(0); | 630 | curFile = CurrentView()->currentItem()->text(0); |
623 | 631 | ||
624 | QStringList command; | 632 | QStringList command; |
625 | command << "/bin/sh"; | 633 | command << "/bin/sh"; |
626 | command << "-c"; | 634 | command << "-c"; |
627 | command << "stat -l "+ curFile; | 635 | command << "stat -l "+ curFile; |
628 | 636 | ||
629 | Output *outDlg; | 637 | Output *outDlg; |
630 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 638 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
631 | QPEApplication::execDialog( outDlg ); | 639 | QPEApplication::execDialog( outDlg ); |
632 | qApp->processEvents(); | 640 | qApp->processEvents(); |
633 | } | 641 | } |
634 | 642 | ||
635 | 643 | ||
636 | void AdvancedFm::mkDir() { | 644 | void AdvancedFm::mkDir() { |
637 | makeDir(); | 645 | makeDir(); |
638 | } | 646 | } |
639 | 647 | ||
640 | void AdvancedFm::rn() { | 648 | void AdvancedFm::rn() { |
641 | renameIt(); | 649 | renameIt(); |
642 | } | 650 | } |
643 | 651 | ||
644 | void AdvancedFm::del() { | 652 | void AdvancedFm::del() { |
645 | doDelete(); | 653 | doDelete(); |
646 | } | 654 | } |
647 | 655 | ||
648 | void AdvancedFm::mkSym() { | 656 | void AdvancedFm::mkSym() { |
649 | QString cmd; | 657 | QString cmd; |
650 | QStringList curFileList = getPath(); | 658 | QStringList curFileList = getPath(); |
651 | if( curFileList.count() > 0) { | 659 | if( curFileList.count() > 0) { |
652 | QDir *thisDir = CurrentDir(); | 660 | QDir *thisDir = CurrentDir(); |
653 | QDir * thatDir = OtherDir(); | 661 | QDir * thatDir = OtherDir(); |
654 | 662 | ||
655 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 663 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
656 | 664 | ||
657 | QString destName = thatDir->canonicalPath()+"/"+(*it); | 665 | QString destName = thatDir->canonicalPath()+"/"+(*it); |
658 | if(destName.right(1) == "/") { | 666 | if(destName.right(1) == "/") { |
659 | destName = destName.left( destName.length() -1); | 667 | destName = destName.left( destName.length() -1); |
660 | } | 668 | } |
661 | 669 | ||
662 | QString curFile = thisDir->canonicalPath()+"/"+(*it); | 670 | QString curFile = thisDir->canonicalPath()+"/"+(*it); |
663 | 671 | ||
664 | if( curFile.right(1) == "/") { | 672 | if( curFile.right(1) == "/") { |
665 | curFile = curFile.left( curFile.length() -1); | 673 | curFile = curFile.left( curFile.length() -1); |
666 | } | 674 | } |
667 | 675 | ||
668 | cmd = "ln -s "+curFile+" "+destName; | 676 | cmd = "ln -s "+curFile+" "+destName; |
669 | // odebug << cmd << oendl; | 677 | // odebug << cmd << oendl; |
670 | startProcess( (const QString)cmd ); | 678 | startProcess( (const QString)cmd ); |
671 | } | 679 | } |
672 | rePopulate(); | 680 | rePopulate(); |
673 | setOtherTabCurrent(); | 681 | setOtherTabCurrent(); |
674 | } | 682 | } |
675 | } | 683 | } |
676 | 684 | ||
677 | void AdvancedFm::doBeam() { | 685 | void AdvancedFm::doBeam() { |
678 | Ir ir; | 686 | Ir ir; |
679 | if(!ir.supported()) { | 687 | if(!ir.supported()) { |
680 | } else { | 688 | } else { |
681 | QStringList curFileList = getPath(); | 689 | QStringList curFileList = getPath(); |
682 | if( curFileList.count() > 0) { | 690 | if( curFileList.count() > 0) { |
683 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 691 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
684 | QString curFile = (*it); | 692 | QString curFile = (*it); |
685 | QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; | 693 | QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; |
686 | if( curFilePath.right(1) == "/") { | 694 | if( curFilePath.right(1) == "/") { |
687 | curFilePath = curFilePath.left( curFilePath.length() -1); | 695 | curFilePath = curFilePath.left( curFilePath.length() -1); |
688 | } | 696 | } |
689 | Ir *file = new Ir(this, "IR"); | 697 | Ir *file = new Ir(this, "IR"); |
690 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); | 698 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); |
691 | file->send( curFilePath, curFile ); | 699 | file->send( curFilePath, curFile ); |
692 | } | 700 | } |
693 | } | 701 | } |
694 | } | 702 | } |
695 | } | 703 | } |
696 | 704 | ||
697 | void AdvancedFm::fileBeamFinished( Ir *) { | 705 | void AdvancedFm::fileBeamFinished( Ir *) { |
698 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 706 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
699 | } | 707 | } |
700 | 708 | ||
701 | void AdvancedFm::selectAll() { | 709 | void AdvancedFm::selectAll() { |
702 | QListView *thisView = CurrentView(); | 710 | QListView *thisView = CurrentView(); |
703 | thisView->selectAll(true); | 711 | thisView->selectAll(true); |
704 | thisView->setSelected( thisView->firstChild(),false); | 712 | thisView->setSelected( thisView->firstChild(),false); |
705 | } | 713 | } |
706 | 714 | ||
707 | void AdvancedFm::startProcess(const QString & cmd) { | 715 | void AdvancedFm::startProcess(const QString & cmd) { |
708 | QStringList command; | 716 | QStringList command; |
709 | OProcess *process; | 717 | OProcess *process; |
710 | process = new OProcess(); | 718 | process = new OProcess(); |
711 | connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), | 719 | connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), this, SLOT( processEnded(Opie::Core::OProcess*))); |
712 | this, SLOT( processEnded(Opie::Core::OProcess*))); | ||
713 | 720 | ||
714 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), | 721 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); |
715 | this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); | ||
716 | 722 | ||
717 | command << "/bin/sh"; | 723 | command << "/bin/sh"; |
718 | command << "-c"; | 724 | command << "-c"; |
719 | command << cmd.latin1(); | 725 | command << cmd.latin1(); |
720 | *process << command; | 726 | *process << command; |
721 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) | 727 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) |
722 | odebug << "could not start process" << oendl; | 728 | odebug << "could not start process" << oendl; |
723 | } | 729 | } |
724 | 730 | ||
725 | void AdvancedFm::processEnded(OProcess *) { | 731 | void AdvancedFm::processEnded(OProcess *) { |
726 | rePopulate(); | 732 | rePopulate(); |
727 | } | 733 | } |
728 | 734 | ||
729 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { | 735 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { |
730 | // owarn << "received stderrt " << buflen << " bytes" << oendl; | 736 | // owarn << "received stderrt " << buflen << " bytes" << oendl; |
731 | 737 | ||
732 | QString lineStr = buffer; | 738 | QString lineStr = buffer; |
733 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | 739 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); |
734 | } | 740 | } |
735 | 741 | ||
736 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | 742 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { |
737 | if ( o->inherits( "QLineEdit" ) ) { | 743 | if ( o->inherits( "QLineEdit" ) ) { |
738 | if ( e->type() == QEvent::KeyPress ) { | 744 | if ( e->type() == QEvent::KeyPress ) { |
739 | QKeyEvent *ke = (QKeyEvent*)e; | 745 | QKeyEvent *ke = (QKeyEvent*)e; |
740 | if ( ke->key() == Key_Return || | 746 | if ( ke->key() == Key_Return || |
741 | ke->key() == Key_Enter ) { | 747 | ke->key() == Key_Enter ) { |
742 | okRename(); | 748 | okRename(); |
743 | return true; | 749 | return true; |
744 | } | 750 | } |
745 | else if ( ke->key() == Key_Escape ) { | 751 | else if ( ke->key() == Key_Escape ) { |
746 | cancelRename(); | 752 | cancelRename(); |
747 | return true; | 753 | return true; |
748 | } | 754 | } |
749 | } | 755 | } |
750 | else if ( e->type() == QEvent::FocusOut ) { | 756 | else if ( e->type() == QEvent::FocusOut ) { |
751 | cancelRename(); | 757 | cancelRename(); |
752 | return true; | 758 | return true; |
753 | } | 759 | } |
754 | } | 760 | } |
755 | if ( o->inherits( "QListView" ) ) { | 761 | if ( o->inherits( "QListView" ) ) { |
756 | if ( e->type() == QEvent::FocusIn ) { | 762 | if ( e->type() == QEvent::FocusIn ) { |
757 | if( o == Local_View) { //keep track of which view | 763 | // if( o == Local_View) { //keep track of which view |
758 | qDebug("local view"); | 764 | // qDebug("local view"); |
759 | whichTab = 1; | 765 | // whichTab = 1; |
760 | } else { | 766 | // } else { |
761 | whichTab = 2; | 767 | // whichTab = 2; |
762 | qDebug("remote view"); | 768 | // qDebug("remote view"); |
763 | } | 769 | // } |
764 | } | 770 | } |
765 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection | 771 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection |
766 | } | 772 | } |
767 | 773 | ||
768 | return QWidget::eventFilter( o, e ); | 774 | return QWidget::eventFilter( o, e ); |
769 | } | 775 | } |
770 | 776 | ||
771 | 777 | ||
772 | void AdvancedFm::cancelRename() { | 778 | void AdvancedFm::cancelRename() { |
773 | // odebug << "cancel rename" << oendl; | 779 | // odebug << "cancel rename" << oendl; |
774 | QListView * view; | 780 | QListView * view; |
775 | view = CurrentView(); | 781 | view = CurrentView(); |
776 | 782 | ||
777 | bool resetFocus = view->viewport()->focusProxy() == renameBox; | 783 | bool resetFocus = view->viewport()->focusProxy() == renameBox; |
778 | delete renameBox; | 784 | delete renameBox; |
779 | renameBox = 0; | 785 | renameBox = 0; |
780 | if ( resetFocus ) { | 786 | if ( resetFocus ) { |
781 | view->viewport()->setFocusProxy( view); | 787 | view->viewport()->setFocusProxy( view); |
782 | view->setFocus(); | 788 | view->setFocus(); |
783 | } | 789 | } |
784 | } | 790 | } |
785 | 791 | ||
786 | void AdvancedFm::doRename(QListView * view) { | 792 | void AdvancedFm::doRename(QListView * view) { |
787 | if( !CurrentView()->currentItem()) return; | 793 | if( !CurrentView()->currentItem()) return; |
788 | 794 | ||
789 | QRect r = view->itemRect( view->currentItem( )); | 795 | QRect r = view->itemRect( view->currentItem( )); |
790 | r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); | 796 | r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); |
791 | r.setX( view->contentsX() ); | 797 | r.setX( view->contentsX() ); |
792 | 798 | if ( r.width() > view->visibleWidth() ) | |
793 | if ( r.width() > view->visibleWidth() ) | ||
794 | r.setWidth( view->visibleWidth() ); | 799 | r.setWidth( view->visibleWidth() ); |
795 | 800 | ||
796 | renameBox = new QLineEdit( view->viewport(), "qt_renamebox" ); | 801 | renameBox = new QLineEdit( view->viewport(), "qt_renamebox" ); |
797 | renameBox->setFrame(true); | 802 | renameBox->setFrame(true); |
798 | |||
799 | renameBox->setText( view->currentItem()->text(0) ); | 803 | renameBox->setText( view->currentItem()->text(0) ); |
800 | |||
801 | renameBox->selectAll(); | 804 | renameBox->selectAll(); |
802 | renameBox->installEventFilter( this ); | 805 | renameBox->installEventFilter( this ); |
803 | |||
804 | view->addChild( renameBox, r.x(), r.y() ); | 806 | view->addChild( renameBox, r.x(), r.y() ); |
805 | 807 | renameBox->resize( r.size() ); | |
806 | renameBox->resize( r.size() ); | 808 | view->viewport()->setFocusProxy( renameBox ); |
807 | 809 | renameBox->setFocus(); | |
808 | view->viewport()->setFocusProxy( renameBox ); | ||
809 | |||
810 | renameBox->setFocus(); | ||
811 | renameBox->show(); | 810 | renameBox->show(); |
812 | } | 811 | } |
813 | 812 | ||
814 | 813 | ||
815 | void AdvancedFm::renameIt() { | 814 | void AdvancedFm::renameIt() { |
816 | if( !CurrentView()->currentItem()) return; | 815 | if( !CurrentView()->currentItem()) return; |
817 | 816 | ||
818 | QListView *thisView = CurrentView(); | 817 | QListView *thisView = CurrentView(); |
819 | oldName = thisView->currentItem()->text(0); | 818 | oldName = thisView->currentItem()->text(0); |
820 | doRename( thisView ); | 819 | doRename( thisView ); |
821 | } | 820 | } |
822 | 821 | ||
823 | void AdvancedFm::okRename() { | 822 | void AdvancedFm::okRename() { |
824 | if( !renameBox) return; | 823 | if( !renameBox) return; |
825 | 824 | ||
826 | QString newName = renameBox->text(); | 825 | QString newName = renameBox->text(); |
827 | cancelRename(); | 826 | cancelRename(); |
828 | QListView * view = CurrentView(); | 827 | QListView * view = CurrentView(); |
829 | QString path = CurrentDir()->canonicalPath() + "/"; | 828 | QString path = CurrentDir()->canonicalPath() + "/"; |
830 | oldName = path + oldName; | 829 | oldName = path + oldName; |
831 | newName = path + newName; | 830 | newName = path + newName; |
832 | if( rename( oldName.latin1(), newName.latin1())== -1) | 831 | if( rename( oldName.latin1(), newName.latin1())== -1) |
833 | QMessageBox::message(tr("Note"),tr("Could not rename")); | 832 | QMessageBox::message(tr("Note"),tr("Could not rename")); |
834 | else | 833 | else |
835 | oldName = ""; | 834 | oldName = ""; |
836 | QListViewItem *item = view->currentItem(); | 835 | QListViewItem *item = view->currentItem(); |
837 | view->takeItem( item ); | 836 | view->takeItem( item ); |
838 | delete item; | 837 | delete item; |
839 | rePopulate(); | 838 | rePopulate(); |
840 | } | 839 | } |
841 | 840 | ||
842 | void AdvancedFm::openSearch() { | 841 | void AdvancedFm::openSearch() { |
843 | QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); | 842 | QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); |
844 | } | 843 | } |