author | llornkcor <llornkcor> | 2003-09-08 22:22:00 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-09-08 22:22:00 (UTC) |
commit | e485a3bd44b3cc70280e03eb8a7958a5252cdd6a (patch) (unidiff) | |
tree | cce07d76c2a9060a774898af46e7c8dc8c7b3403 | |
parent | b3299bab3370865e0e498fd2f7f84f3abbd17e77 (diff) | |
download | opie-e485a3bd44b3cc70280e03eb8a7958a5252cdd6a.zip opie-e485a3bd44b3cc70280e03eb8a7958a5252cdd6a.tar.gz opie-e485a3bd44b3cc70280e03eb8a7958a5252cdd6a.tar.bz2 |
changes for osplitter functionality
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 345 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 7 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 30 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 317 | ||||
-rw-r--r-- | noncore/apps/advancedfm/filePermissions.cpp | 2 |
5 files changed, 300 insertions, 401 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 91318f1..2fc4b49 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -42,2 +42,4 @@ | |||
42 | 42 | ||
43 | #include <qpe/qpemessagebox.h> | ||
44 | |||
43 | #include <sys/stat.h> | 45 | #include <sys/stat.h> |
@@ -69,4 +71,3 @@ AdvancedFm::~AdvancedFm() { | |||
69 | 71 | ||
70 | void AdvancedFm::cleanUp() | 72 | void AdvancedFm::cleanUp() { |
71 | { | ||
72 | QString sfile=QDir::homeDirPath(); | 73 | QString sfile=QDir::homeDirPath(); |
@@ -81,11 +82,4 @@ void AdvancedFm::cleanUp() | |||
81 | 82 | ||
82 | void AdvancedFm::tabChanged(QWidget *w) | 83 | void AdvancedFm::tabChanged(QWidget *) { |
83 | { | 84 | // qWarning("tab changed"); |
84 | if( w == tab) | ||
85 | whichTab = 1; | ||
86 | else | ||
87 | whichTab = 2; | ||
88 | |||
89 | // qDebug("tab changed %d", whichTab ); | ||
90 | |||
91 | QString path = CurrentDir()->canonicalPath(); | 85 | QString path = CurrentDir()->canonicalPath(); |
@@ -93,4 +87,9 @@ void AdvancedFm::tabChanged(QWidget *w) | |||
93 | 87 | ||
94 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); | 88 | if(whichTab == 1) { |
95 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); | 89 | viewMenu->setItemChecked(viewMenu->idAt(0), true); |
90 | viewMenu->setItemChecked(viewMenu->idAt(1), false); | ||
91 | } else { | ||
92 | viewMenu->setItemChecked(viewMenu->idAt(0), false); | ||
93 | viewMenu->setItemChecked(viewMenu->idAt(1), true); | ||
94 | } | ||
96 | 95 | ||
@@ -98,4 +97,4 @@ void AdvancedFm::tabChanged(QWidget *w) | |||
98 | 97 | ||
99 | setCaption("AdvancedFm :: "+fs+" :: " | 98 | setCaption(tr("AdvancedFm :: ")+fs+" :: " |
100 | +checkDiskSpace( (const QString &) path )+ " kB free" ); | 99 | +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); |
101 | chdir( path.latin1()); | 100 | chdir( path.latin1()); |
@@ -104,4 +103,3 @@ void AdvancedFm::tabChanged(QWidget *w) | |||
104 | 103 | ||
105 | void AdvancedFm::populateView() | 104 | void AdvancedFm::populateView() { |
106 | { | ||
107 | QPixmap pm; | 105 | QPixmap pm; |
@@ -110,3 +108,3 @@ void AdvancedFm::populateView() | |||
110 | QString path = thisDir->canonicalPath(); | 108 | QString path = thisDir->canonicalPath(); |
111 | 109 | // qWarning("path is "+path); | |
112 | thisView->clear(); | 110 | thisView->clear(); |
@@ -117,4 +115,4 @@ void AdvancedFm::populateView() | |||
117 | QString fs= getFileSystemType((const QString &) path); | 115 | QString fs= getFileSystemType((const QString &) path); |
118 | setCaption("AdvancedFm :: "+fs+" :: " | 116 | setCaption(tr("AdvancedFm :: ")+fs+" :: " |
119 | +checkDiskSpace((const QString &) path)+" kB free" ); | 117 | +checkDiskSpace((const QString &) path)+ tr(" kB free") ); |
120 | bool isDir=FALSE; | 118 | bool isDir=FALSE; |
@@ -135,2 +133,3 @@ void AdvancedFm::populateView() | |||
135 | if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) { | 133 | if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) { |
134 | // if(fileL == "..") | ||
136 | fileL+="/"; | 135 | fileL+="/"; |
@@ -213,20 +212,22 @@ void AdvancedFm::populateView() | |||
213 | 212 | ||
214 | void AdvancedFm::rePopulate() | 213 | void AdvancedFm::rePopulate() { |
215 | { | ||
216 | int tmpTab = whichTab; | ||
217 | qDebug("%d", tmpTab); | ||
218 | |||
219 | for(int i =1; i < 3; i++) | ||
220 | { | ||
221 | TabWidget->setCurrentWidget(i - 1); | ||
222 | populateView(); | 214 | populateView(); |
223 | } | 215 | setOtherTabCurrent(); |
224 | TabWidget->setCurrentWidget( tmpTab - 1); | 216 | populateView(); |
217 | |||
218 | // int tmpTab = whichTab; | ||
219 | // // qDebug("%d", tmpTab); | ||
220 | |||
221 | // for(int i =1; i < 3; i++) { | ||
222 | // TabWidget->setCurrentWidget(i - 1); | ||
223 | // populateView(); | ||
224 | // } | ||
225 | // TabWidget->setCurrentWidget( tmpTab - 1); | ||
225 | } | 226 | } |
226 | 227 | ||
227 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) | 228 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { |
228 | { | 229 | //qWarning("listclicked"); |
229 | if(selectedItem) | 230 | if(selectedItem) { |
230 | { | ||
231 | QString strItem=selectedItem->text(0); | 231 | QString strItem=selectedItem->text(0); |
232 | // qWarning(strItem); | ||
232 | QString strSize=selectedItem->text(1); | 233 | QString strSize=selectedItem->text(1); |
@@ -236,4 +237,3 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) | |||
236 | 237 | ||
237 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 )//if symlink | 238 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink |
238 | { | ||
239 | strItem2 = dealWithSymName((const QString&)strItem); | 239 | strItem2 = dealWithSymName((const QString&)strItem); |
@@ -243,4 +243,3 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) | |||
243 | 243 | ||
244 | if( strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) | 244 | if( strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { |
245 | { | ||
246 | 245 | ||
@@ -250,4 +249,3 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) | |||
250 | 249 | ||
251 | if( isDirectory ) | 250 | if( isDirectory ) { |
252 | { | ||
253 | CurrentDir()->cd( strItem, TRUE); | 251 | CurrentDir()->cd( strItem, TRUE); |
@@ -260,3 +258,4 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) | |||
260 | 258 | ||
261 | void AdvancedFm::ListPressed( int mouse, QListViewItem *, const QPoint& , int ) { | 259 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { |
260 | dealWithSchmooSchmaa( item->listView()); | ||
262 | switch (mouse) { | 261 | switch (mouse) { |
@@ -264,4 +263,3 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *, const QPoint& , int ) | |||
264 | { | 263 | { |
265 | if(renameBox != 0 ) | 264 | if(renameBox != 0 ) { |
266 | { | ||
267 | cancelRename(); | 265 | cancelRename(); |
@@ -276,4 +274,5 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *, const QPoint& , int ) | |||
276 | 274 | ||
277 | void AdvancedFm::switchToLocalTab() | 275 | |
278 | { | 276 | void AdvancedFm::switchToLocalTab() { |
277 | //qWarning("switch to local view"); | ||
279 | TabWidget->setCurrentWidget(0); | 278 | TabWidget->setCurrentWidget(0); |
@@ -282,4 +281,4 @@ void AdvancedFm::switchToLocalTab() | |||
282 | 281 | ||
283 | void AdvancedFm::switchToRemoteTab() | 282 | void AdvancedFm::switchToRemoteTab() { |
284 | { | 283 | //qWarning("switch to local view"); |
285 | TabWidget->setCurrentWidget(1); | 284 | TabWidget->setCurrentWidget(1); |
@@ -288,4 +287,3 @@ void AdvancedFm::switchToRemoteTab() | |||
288 | 287 | ||
289 | void AdvancedFm::readConfig() | 288 | void AdvancedFm::readConfig() { |
290 | { | ||
291 | Config cfg("AdvancedFm"); | 289 | Config cfg("AdvancedFm"); |
@@ -293,4 +291,3 @@ void AdvancedFm::readConfig() | |||
293 | 291 | ||
294 | void AdvancedFm::writeConfig() | 292 | void AdvancedFm::writeConfig() { |
295 | { | ||
296 | Config cfg("AdvancedFm"); | 293 | Config cfg("AdvancedFm"); |
@@ -298,11 +295,7 @@ void AdvancedFm::writeConfig() | |||
298 | 295 | ||
299 | void AdvancedFm::currentPathComboChanged() | 296 | void AdvancedFm::currentPathComboChanged() { |
300 | { | 297 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { |
301 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) | ||
302 | { | ||
303 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); | 298 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); |
304 | populateView(); | 299 | populateView(); |
305 | } | 300 | } else { |
306 | else | ||
307 | { | ||
308 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); | 301 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); |
@@ -311,10 +304,7 @@ void AdvancedFm::currentPathComboChanged() | |||
311 | 304 | ||
312 | void AdvancedFm::fillCombo(const QString ¤tPath) | 305 | void AdvancedFm::fillCombo(const QString ¤tPath) { |
313 | { | 306 | |
314 | // qDebug("%d",TabWidget->currentTab()); | 307 | if ( whichTab == 1) { |
315 | if ( whichTab == 1) | ||
316 | { | ||
317 | currentPathCombo->lineEdit()->setText( currentPath); | 308 | currentPathCombo->lineEdit()->setText( currentPath); |
318 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) | 309 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
319 | { | ||
320 | currentPathCombo->clear(); | 310 | currentPathCombo->clear(); |
@@ -323,8 +313,5 @@ void AdvancedFm::fillCombo(const QString ¤tPath) | |||
323 | } | 313 | } |
324 | } | 314 | } else { |
325 | else | ||
326 | { | ||
327 | currentPathCombo->lineEdit()->setText( currentPath); | 315 | currentPathCombo->lineEdit()->setText( currentPath); |
328 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) | 316 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
329 | { | ||
330 | currentPathCombo->clear(); | 317 | currentPathCombo->clear(); |
@@ -336,4 +323,3 @@ void AdvancedFm::fillCombo(const QString ¤tPath) | |||
336 | 323 | ||
337 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) | 324 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { |
338 | { | ||
339 | chdir( currentPath.latin1() ); | 325 | chdir( currentPath.latin1() ); |
@@ -344,4 +330,3 @@ void AdvancedFm::currentPathComboActivated(const QString & currentPath) | |||
344 | 330 | ||
345 | QStringList AdvancedFm::getPath() | 331 | QStringList AdvancedFm::getPath() { |
346 | { | ||
347 | QStringList strList; | 332 | QStringList strList; |
@@ -350,6 +335,4 @@ QStringList AdvancedFm::getPath() | |||
350 | QListViewItemIterator it( thisView ); | 335 | QListViewItemIterator it( thisView ); |
351 | for ( ; it.current(); ++it ) | 336 | for ( ; it.current(); ++it ) { |
352 | { | 337 | if ( it.current()->isSelected() ) { |
353 | if ( it.current()->isSelected() ) | ||
354 | { | ||
355 | strList << it.current()->text(0); | 338 | strList << it.current()->text(0); |
@@ -361,4 +344,3 @@ QStringList AdvancedFm::getPath() | |||
361 | 344 | ||
362 | void AdvancedFm::homeButtonPushed() | 345 | void AdvancedFm::homeButtonPushed() { |
363 | { | ||
364 | QString current = QDir::homeDirPath(); | 346 | QString current = QDir::homeDirPath(); |
@@ -370,4 +352,3 @@ void AdvancedFm::homeButtonPushed() | |||
370 | 352 | ||
371 | void AdvancedFm::docButtonPushed() | 353 | void AdvancedFm::docButtonPushed() { |
372 | { | ||
373 | QString current = QPEApplication::documentDir(); | 354 | QString current = QPEApplication::documentDir(); |
@@ -379,4 +360,3 @@ void AdvancedFm::docButtonPushed() | |||
379 | 360 | ||
380 | void AdvancedFm::SDButtonPushed() | 361 | void AdvancedFm::SDButtonPushed() { |
381 | { | ||
382 | QString current = "/mnt/card";// this can change so fix | 362 | QString current = "/mnt/card";// this can change so fix |
@@ -388,4 +368,3 @@ void AdvancedFm::SDButtonPushed() | |||
388 | 368 | ||
389 | void AdvancedFm::CFButtonPushed() | 369 | void AdvancedFm::CFButtonPushed() { |
390 | { | ||
391 | QString current; | 370 | QString current; |
@@ -402,4 +381,3 @@ void AdvancedFm::CFButtonPushed() | |||
402 | 381 | ||
403 | void AdvancedFm::doAbout() | 382 | void AdvancedFm::doAbout() { |
404 | { | ||
405 | QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n" | 383 | QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n" |
@@ -410,8 +388,20 @@ void AdvancedFm::doAbout() | |||
410 | 388 | ||
411 | void AdvancedFm::keyPressEvent( QKeyEvent *e) | 389 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { |
412 | { | 390 | // qWarning("key %d", e->key()); |
413 | // e->accept(); | 391 | // if( CurrentView()->hasFocus() ) |
414 | if( CurrentView()->hasFocus() ) | ||
415 | { | 392 | { |
416 | switch ( e->key() ) { | 393 | switch ( e->key() ) { |
394 | case Key_Left: | ||
395 | upDir(); | ||
396 | break; | ||
397 | case Key_Next: | ||
398 | break; | ||
399 | case Key_Return: | ||
400 | case Key_Enter: | ||
401 | navigateToSelected(); | ||
402 | break; | ||
403 | case Key_Tab: { | ||
404 | setOtherTabCurrent(); | ||
405 | } | ||
406 | break; | ||
417 | case Key_Delete: | 407 | case Key_Delete: |
@@ -486,4 +476,3 @@ void AdvancedFm::keyPressEvent( QKeyEvent *e) | |||
486 | 476 | ||
487 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) | 477 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { |
488 | { | ||
489 | if( CurrentView()->hasFocus() ) | 478 | if( CurrentView()->hasFocus() ) |
@@ -493,4 +482,3 @@ void AdvancedFm::keyReleaseEvent( QKeyEvent *e) | |||
493 | 482 | ||
494 | void AdvancedFm::QPEButtonPushed() | 483 | void AdvancedFm::QPEButtonPushed() { |
495 | { | ||
496 | QString current = QPEApplication::qpeDir(); | 484 | QString current = QPEApplication::qpeDir(); |
@@ -502,4 +490,3 @@ void AdvancedFm::QPEButtonPushed() | |||
502 | 490 | ||
503 | void AdvancedFm::parsetab(const QString &fileName) | 491 | void AdvancedFm::parsetab(const QString &fileName) { |
504 | { | ||
505 | 492 | ||
@@ -509,6 +496,4 @@ void AdvancedFm::parsetab(const QString &fileName) | |||
509 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); | 496 | FILE *mntfp = setmntent( fileName.latin1(), "r" ); |
510 | if ( mntfp ) | 497 | if ( mntfp ) { |
511 | { | 498 | while ( (me = getmntent( mntfp )) != 0 ) { |
512 | while ( (me = getmntent( mntfp )) != 0 ) | ||
513 | { | ||
514 | QString deviceName = me->mnt_fsname; | 499 | QString deviceName = me->mnt_fsname; |
@@ -516,4 +501,3 @@ void AdvancedFm::parsetab(const QString &fileName) | |||
516 | QString mountDir = me->mnt_dir; | 501 | QString mountDir = me->mnt_dir; |
517 | if(deviceName != "none") | 502 | if(deviceName != "none") { |
518 | { | ||
519 | if( fsList.contains(filesystemType) == 0 | 503 | if( fsList.contains(filesystemType) == 0 |
@@ -530,4 +514,3 @@ void AdvancedFm::parsetab(const QString &fileName) | |||
530 | 514 | ||
531 | QString AdvancedFm::getFileSystemType(const QString ¤tText) | 515 | QString AdvancedFm::getFileSystemType(const QString ¤tText) { |
532 | { | ||
533 | parsetab("/etc/mtab"); //why did TT forget filesystem type? | 516 | parsetab("/etc/mtab"); //why did TT forget filesystem type? |
@@ -547,4 +530,3 @@ QString AdvancedFm::getFileSystemType(const QString ¤tText) | |||
547 | 530 | ||
548 | QString AdvancedFm::getDiskSpace( const QString &path) | 531 | QString AdvancedFm::getDiskSpace( const QString &path) { |
549 | { | ||
550 | struct statfs fss; | 532 | struct statfs fss; |
@@ -566,4 +548,3 @@ QString AdvancedFm::getDiskSpace( const QString &path) | |||
566 | 548 | ||
567 | void AdvancedFm::showFileMenu() | 549 | void AdvancedFm::showFileMenu() { |
568 | { | ||
569 | QString curApp; | 550 | QString curApp; |
@@ -579,9 +560,6 @@ void AdvancedFm::showFileMenu() | |||
579 | 560 | ||
580 | if ( QFileInfo(fi).isDir() ) | 561 | if ( QFileInfo(fi).isDir() ) { |
581 | { | ||
582 | m->insertSeparator(); | 562 | m->insertSeparator(); |
583 | m->insertItem( tr( "Change Directory" ), this, SLOT( doDirChange() )); | 563 | m->insertItem( tr( "Change Directory" ), this, SLOT( doDirChange() )); |
584 | } | 564 | } else { |
585 | else | ||
586 | { | ||
587 | 565 | ||
@@ -636,5 +614,4 @@ void AdvancedFm::showFileMenu() | |||
636 | 614 | ||
637 | void AdvancedFm::cancelMenuTimer() | 615 | void AdvancedFm::cancelMenuTimer() { |
638 | { | 616 | |
639 | // qDebug("selectionChanged: cancel menu timer"); | ||
640 | if( menuTimer.isActive() ) | 617 | if( menuTimer.isActive() ) |
@@ -643,7 +620,5 @@ void AdvancedFm::cancelMenuTimer() | |||
643 | 620 | ||
644 | QString AdvancedFm::checkDiskSpace(const QString &path) | 621 | QString AdvancedFm::checkDiskSpace(const QString &path) { |
645 | { | ||
646 | struct statfs fss; | 622 | struct statfs fss; |
647 | if ( !statfs( path.latin1(), &fss ) ) | 623 | if ( !statfs( path.latin1(), &fss ) ) { |
648 | { | ||
649 | int blkSize = fss.f_bsize; | 624 | int blkSize = fss.f_bsize; |
@@ -663,4 +638,3 @@ QString AdvancedFm::checkDiskSpace(const QString &path) | |||
663 | 638 | ||
664 | void AdvancedFm::addToDocs() | 639 | void AdvancedFm::addToDocs() { |
665 | { | ||
666 | QStringList strListPaths = getPath(); | 640 | QStringList strListPaths = getPath(); |
@@ -684,4 +658,3 @@ void AdvancedFm::addToDocs() | |||
684 | 658 | ||
685 | void AdvancedFm::customDirsToMenu() | 659 | void AdvancedFm::customDirsToMenu() { |
686 | { | ||
687 | 660 | ||
@@ -699,5 +672,3 @@ void AdvancedFm::customDirsToMenu() | |||
699 | 672 | ||
700 | void AdvancedFm::dirMenuSelected(int item) | 673 | void AdvancedFm::dirMenuSelected(int item) { |
701 | { | ||
702 | qDebug("menu item %d", item); | ||
703 | switch(item) | 674 | switch(item) |
@@ -723,4 +694,3 @@ void AdvancedFm::dirMenuSelected(int item) | |||
723 | 694 | ||
724 | void AdvancedFm::addCustomDir() | 695 | void AdvancedFm::addCustomDir() { |
725 | { | ||
726 | Config cfg("AdvancedFm"); | 696 | Config cfg("AdvancedFm"); |
@@ -733,6 +703,4 @@ void AdvancedFm::addCustomDir() | |||
733 | bool addIt=true; | 703 | bool addIt=true; |
734 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 704 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
735 | { | 705 | if( dir == (*it)) { |
736 | if( dir == (*it)) | ||
737 | { | ||
738 | addIt=false; | 706 | addIt=false; |
@@ -740,4 +708,3 @@ void AdvancedFm::addCustomDir() | |||
740 | } | 708 | } |
741 | if(addIt) | 709 | if(addIt) { |
742 | { | ||
743 | menuButton->insertItem(dir); | 710 | menuButton->insertItem(dir); |
@@ -751,4 +718,3 @@ void AdvancedFm::addCustomDir() | |||
751 | 718 | ||
752 | void AdvancedFm::removeCustomDir() | 719 | void AdvancedFm::removeCustomDir() { |
753 | { | ||
754 | // qDebug("remove custom dir"); | 720 | // qDebug("remove custom dir"); |
@@ -763,17 +729,11 @@ void AdvancedFm::removeCustomDir() | |||
763 | //first remove list | 729 | //first remove list |
764 | if(list.grep(dir,true).isEmpty()) | 730 | if(list.grep(dir,true).isEmpty()) { |
765 | { | ||
766 | QMessageBox::message(tr( "AdvancedFm" ), | 731 | QMessageBox::message(tr( "AdvancedFm" ), |
767 | tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!")); | 732 | tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!")); |
768 | } | 733 | } else { |
769 | else | 734 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { |
770 | { | 735 | if((*it) != dir) { |
771 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 736 | //current item is not our current dir, so add it to temp list |
772 | { | ||
773 | if((*it) != dir)//current item is not our current dir, so add it to temp list | ||
774 | { | ||
775 | list2 <<(*it); | 737 | list2 <<(*it); |
776 | } | 738 | } else { |
777 | else | ||
778 | { | ||
779 | // customDirMenu->removeItem( ramble); | 739 | // customDirMenu->removeItem( ramble); |
@@ -793,4 +753,3 @@ void AdvancedFm::removeCustomDir() | |||
793 | 753 | ||
794 | void AdvancedFm::gotoCustomDir(const QString &dir) | 754 | void AdvancedFm::gotoCustomDir(const QString &dir) { |
795 | { | ||
796 | // qDebug("gotoCustomDir(const QString &dir) " +dir ); | 755 | // qDebug("gotoCustomDir(const QString &dir) " +dir ); |
@@ -800,12 +759,8 @@ void AdvancedFm::gotoCustomDir(const QString &dir) | |||
800 | // } | 759 | // } |
801 | if( dir == s_addBookmark) | 760 | if( dir == s_addBookmark) { |
802 | { | ||
803 | addCustomDir(); | 761 | addCustomDir(); |
804 | } | 762 | } |
805 | if( dir == s_removeBookmark) | 763 | if( dir == s_removeBookmark) { |
806 | { | ||
807 | removeCustomDir( ); | 764 | removeCustomDir( ); |
808 | } | 765 | } else { |
809 | else | ||
810 | { | ||
811 | gotoDirectory( dir); | 766 | gotoDirectory( dir); |
@@ -821,10 +776,7 @@ void AdvancedFm::gotoCustomDir(const QString &dir) | |||
821 | 776 | ||
822 | QDir *AdvancedFm::CurrentDir() | 777 | QDir *AdvancedFm::CurrentDir() { |
823 | { | 778 | |
824 | if ( whichTab == 1) | 779 | if ( whichTab == 1) { |
825 | { | ||
826 | return ¤tDir; | 780 | return ¤tDir; |
827 | } | 781 | } else { |
828 | else | ||
829 | { | ||
830 | return ¤tRemoteDir; | 782 | return ¤tRemoteDir; |
@@ -833,10 +785,6 @@ QDir *AdvancedFm::CurrentDir() | |||
833 | 785 | ||
834 | QDir *AdvancedFm::OtherDir() | 786 | QDir *AdvancedFm::OtherDir() { |
835 | { | 787 | if ( whichTab == 1) { |
836 | if ( whichTab == 1) | ||
837 | { | ||
838 | return ¤tRemoteDir; | 788 | return ¤tRemoteDir; |
839 | } | 789 | } else { |
840 | else | ||
841 | { | ||
842 | return ¤tDir; | 790 | return ¤tDir; |
@@ -845,12 +793,13 @@ QDir *AdvancedFm::OtherDir() | |||
845 | 793 | ||
846 | QListView * AdvancedFm::CurrentView() | 794 | QListView * AdvancedFm::CurrentView() { |
847 | { | 795 | if ( whichTab == 1) { |
848 | if ( whichTab == 1) | 796 | // qWarning("CurrentView Tab 1"); |
849 | return Local_View; | 797 | return Local_View; |
850 | else | 798 | } else { |
799 | // qWarning("CurrentView Tab 2"); | ||
851 | return Remote_View; | 800 | return Remote_View; |
852 | } | 801 | } |
802 | } | ||
853 | 803 | ||
854 | QListView * AdvancedFm::OtherView() | 804 | QListView * AdvancedFm::OtherView() { |
855 | { | ||
856 | if ( whichTab == 1) | 805 | if ( whichTab == 1) |
@@ -861,15 +810,18 @@ QListView * AdvancedFm::OtherView() | |||
861 | 810 | ||
862 | void AdvancedFm::setOtherTabCurrent() | 811 | void AdvancedFm::setOtherTabCurrent() { |
863 | { | 812 | // qWarning("setOtherTabCurrent()"); |
864 | if ( whichTab == 1) | 813 | if ( whichTab == 1) { |
865 | TabWidget->setCurrentWidget(1); | 814 | TabWidget->setCurrentWidget(1); |
866 | else | 815 | } else { |
867 | TabWidget->setCurrentWidget(0); | 816 | TabWidget->setCurrentWidget(0); |
868 | } | 817 | } |
818 | OtherView()->setFocus(); | ||
819 | OtherView()->setSelected( CurrentView()->firstChild(), true); | ||
820 | } | ||
869 | 821 | ||
870 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { | 822 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { |
871 | qDebug("qcop message "+msg ); | 823 | // qDebug("qcop message "+msg ); |
872 | QDataStream stream ( data, IO_ReadOnly ); | 824 | QDataStream stream ( data, IO_ReadOnly ); |
873 | if ( msg == "openDirectory(QString)" ) { | 825 | if ( msg == "openDirectory(QString)" ) { |
874 | qDebug("received"); | 826 | // qDebug("received"); |
875 | QString file; | 827 | QString file; |
@@ -886,3 +838,3 @@ void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { | |||
886 | void AdvancedFm::gotoDirectory(const QString &file) { | 838 | void AdvancedFm::gotoDirectory(const QString &file) { |
887 | 839 | // qWarning("goto dir "+file); | |
888 | QString curDir = file; | 840 | QString curDir = file; |
@@ -920 +872,20 @@ void AdvancedFm::findFile(const QString &fileName) { | |||
920 | } | 872 | } |
873 | |||
874 | void AdvancedFm::slotSwitchMenu(int ) { | ||
875 | // qDebug("Switch %d", item); | ||
876 | // viewMenu->setItemChecked(item, true); | ||
877 | } | ||
878 | |||
879 | void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { | ||
880 | tabChanged( w); | ||
881 | if( w == Local_View) { | ||
882 | Remote_View->clearFocus(); | ||
883 | } else { | ||
884 | Local_View->clearFocus(); | ||
885 | } | ||
886 | } | ||
887 | |||
888 | void AdvancedFm::navigateToSelected() { | ||
889 | if( !CurrentView()->currentItem()) return; | ||
890 | doDirChange(); | ||
891 | } | ||
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 5e2c769..5f6eabb 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -60,2 +60,3 @@ public: | |||
60 | protected slots: | 60 | protected slots: |
61 | void slotSwitchMenu(int); | ||
61 | void selectAll(); | 62 | void selectAll(); |
@@ -130,4 +131,6 @@ protected: | |||
130 | void setOtherTabCurrent(); | 131 | void setOtherTabCurrent(); |
132 | void dealWithSchmooSchmaa(QWidget *); | ||
131 | 133 | ||
132 | protected slots: | 134 | protected slots: |
135 | void openSearch(); | ||
133 | void dirMenuSelected(int); | 136 | void dirMenuSelected(int); |
@@ -154,2 +157,4 @@ protected slots: | |||
154 | 157 | ||
158 | // void slotSwitchtoLocal(int); | ||
159 | |||
155 | private: | 160 | private: |
@@ -167,3 +172,3 @@ private: | |||
167 | void gotoDirectory(const QString &); | 172 | void gotoDirectory(const QString &); |
168 | void openSearch(); | 173 | void navigateToSelected(); |
169 | void findFile(const QString &); | 174 | void findFile(const QString &); |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 463b202..ddaa39a 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -100,7 +100,9 @@ void AdvancedFm::init() { | |||
100 | 100 | ||
101 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 101 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); |
102 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 102 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); |
103 | // viewMenu->insertSeparator(); | 103 | // viewMenu->insertSeparator(); |
104 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 104 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
105 | viewMenu->setCheckable(TRUE); | 105 | viewMenu->setCheckable(true); |
106 | viewMenu->setItemChecked( viewMenu->idAt(0), true); | ||
107 | viewMenu->setItemChecked( viewMenu->idAt(1), false); | ||
106 | 108 | ||
@@ -122,2 +124,3 @@ void AdvancedFm::init() { | |||
122 | menuButton->insertSeparator(); | 124 | menuButton->insertSeparator(); |
125 | menuButton->setFocusPolicy(NoFocus); | ||
123 | 126 | ||
@@ -128,3 +131,3 @@ void AdvancedFm::init() { | |||
128 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 131 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
129 | 132 | currentPathCombo->setFocusPolicy(NoFocus); | |
130 | layout->addWidget( lineBox ); | 133 | layout->addWidget( lineBox ); |
@@ -150,2 +153,4 @@ void AdvancedFm::init() { | |||
150 | Local_View->setSelectionMode(QListView::Extended); | 153 | Local_View->setSelectionMode(QListView::Extended); |
154 | Local_View->setFocusPolicy(StrongFocus); | ||
155 | Local_View->installEventFilter( this ); | ||
151 | 156 | ||
@@ -172,3 +177,4 @@ void AdvancedFm::init() { | |||
172 | Remote_View->setSelectionMode(QListView::Extended); | 177 | Remote_View->setSelectionMode(QListView::Extended); |
173 | 178 | Remote_View->setFocusPolicy(StrongFocus); | |
179 | Remote_View->installEventFilter( this ); | ||
174 | 180 | ||
@@ -205,12 +211,7 @@ void AdvancedFm::init() { | |||
205 | 211 | ||
206 | 212 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | |
207 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | ||
208 | if (uname(&name) != -1) { | ||
209 | QString release=name.release; | ||
210 | if(release.find("embedix",0,TRUE) !=-1) { | ||
211 | zaurusDevice=TRUE; | 213 | zaurusDevice=TRUE; |
212 | } else { | 214 | else |
213 | zaurusDevice=FALSE; | 215 | zaurusDevice=FALSE; |
214 | } | 216 | |
215 | } | ||
216 | 217 | ||
@@ -282,3 +283,3 @@ void AdvancedFm::initConnections() | |||
282 | // connect( menuButton, SIGNAL( selected( int)), SLOT( dirMenuSelected(int))); | 283 | // connect( menuButton, SIGNAL( selected( int)), SLOT( dirMenuSelected(int))); |
283 | 284 | connect( viewMenu, SIGNAL( activated(int )), this, SLOT(slotSwitchMenu(int ))); | |
284 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | 285 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); |
@@ -286 +287,2 @@ void AdvancedFm::initConnections() | |||
286 | } | 287 | } |
288 | |||
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 544350c..c0be948 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -48,11 +48,16 @@ | |||
48 | 48 | ||
49 | void AdvancedFm::doDirChange() | 49 | void AdvancedFm::doDirChange() { |
50 | { | 50 | QString pathItem = CurrentView()->currentItem()->text(0); |
51 | if( pathItem == "../") { | ||
51 | ListClicked( CurrentView()->currentItem()); | 52 | ListClicked( CurrentView()->currentItem()); |
53 | } else { | ||
54 | if( pathItem.find(" -> ",0,TRUE) != -1) | ||
55 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; | ||
56 | // qWarning(pathItem); | ||
57 | gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); | ||
58 | } | ||
52 | } | 59 | } |
53 | 60 | ||
54 | void AdvancedFm::showMenuHidden() | 61 | void AdvancedFm::showMenuHidden() { |
55 | { | 62 | if (b) { |
56 | if (b) | ||
57 | { | ||
58 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 63 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
@@ -60,7 +65,3 @@ void AdvancedFm::showMenuHidden() | |||
60 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 65 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
61 | // b=FALSE; | 66 | } else { |
62 | |||
63 | } | ||
64 | else | ||
65 | { | ||
66 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 67 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
@@ -68,6 +69,4 @@ void AdvancedFm::showMenuHidden() | |||
68 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 69 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
69 | // b=TRUE; | ||
70 | } | 70 | } |
71 | rePopulate(); | 71 | rePopulate(); |
72 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); | ||
73 | b = !b; | 72 | b = !b; |
@@ -75,18 +74,9 @@ void AdvancedFm::showMenuHidden() | |||
75 | 74 | ||
76 | void AdvancedFm::showHidden() | 75 | void AdvancedFm::showHidden() { |
77 | { | 76 | if (b) { |
78 | if (b) | ||
79 | { | ||
80 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 77 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
81 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 78 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
82 | // fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 79 | } else { |
83 | // b=FALSE; | ||
84 | |||
85 | } | ||
86 | else | ||
87 | { | ||
88 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 80 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
89 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 81 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
90 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | ||
91 | // b=TRUE; | ||
92 | } | 82 | } |
@@ -95,4 +85,3 @@ void AdvancedFm::showHidden() | |||
95 | 85 | ||
96 | QString AdvancedFm::dealWithSymName(const QString &fileName) | 86 | QString AdvancedFm::dealWithSymName(const QString &fileName) { |
97 | { | ||
98 | QString strItem = fileName; | 87 | QString strItem = fileName; |
@@ -101,4 +90,4 @@ QString AdvancedFm::dealWithSymName(const QString &fileName) | |||
101 | 90 | ||
102 | void AdvancedFm::runThis() | 91 | void AdvancedFm::runThis() { |
103 | { | 92 | if( !CurrentView()->currentItem()) return; |
104 | QString fs; | 93 | QString fs; |
@@ -113,4 +102,3 @@ void AdvancedFm::runThis() | |||
113 | 102 | ||
114 | if(curFile != "../") | 103 | if(curFile != "../") { |
115 | { | ||
116 | 104 | ||
@@ -118,3 +106,3 @@ void AdvancedFm::runThis() | |||
118 | QFileInfo fileInfo( path + "/" + curFile); | 106 | QFileInfo fileInfo( path + "/" + curFile); |
119 | qDebug( fileInfo.owner()); | 107 | // qDebug( fileInfo.owner()); |
120 | 108 | ||
@@ -126,5 +114,3 @@ void AdvancedFm::runThis() | |||
126 | e << curFile; | 114 | e << curFile; |
127 | } | 115 | } else { |
128 | else | ||
129 | { | ||
130 | curFile = path + "/" + curFile; | 116 | curFile = path + "/" + curFile; |
@@ -132,8 +118,5 @@ void AdvancedFm::runThis() | |||
132 | QString execStr = nf.exec(); | 118 | QString execStr = nf.exec(); |
133 | qDebug( execStr); | 119 | // qDebug( execStr); |
134 | if( execStr.isEmpty() ) | 120 | if( execStr.isEmpty() ) { |
135 | { | 121 | } else { |
136 | } | ||
137 | else | ||
138 | { | ||
139 | nf.execute(); | 122 | nf.execute(); |
@@ -144,7 +127,6 @@ void AdvancedFm::runThis() | |||
144 | 127 | ||
145 | void AdvancedFm::runText() | 128 | void AdvancedFm::runText() { |
146 | { | 129 | if( !CurrentView()->currentItem()) return; |
147 | QString curFile = CurrentView()->currentItem()->text(0); | 130 | QString curFile = CurrentView()->currentItem()->text(0); |
148 | if(curFile != "../") | 131 | if(curFile != "../") { |
149 | { | ||
150 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 132 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
@@ -157,4 +139,3 @@ void AdvancedFm::runText() | |||
157 | 139 | ||
158 | void AdvancedFm::makeDir() | 140 | void AdvancedFm::makeDir() { |
159 | { | ||
160 | InputDialog *fileDlg; | 141 | InputDialog *fileDlg; |
@@ -162,4 +143,3 @@ void AdvancedFm::makeDir() | |||
162 | fileDlg->exec(); | 143 | fileDlg->exec(); |
163 | if( fileDlg->result() == 1 ) | 144 | if( fileDlg->result() == 1 ) { |
164 | { | ||
165 | QDir *thisDir = CurrentDir(); | 145 | QDir *thisDir = CurrentDir(); |
@@ -171,4 +151,3 @@ void AdvancedFm::makeDir() | |||
171 | 151 | ||
172 | void AdvancedFm::doDelete() | 152 | void AdvancedFm::doDelete() { |
173 | { | ||
174 | QStringList curFileList = getPath(); | 153 | QStringList curFileList = getPath(); |
@@ -237,3 +216,3 @@ void AdvancedFm::doDelete() | |||
237 | if( fi.fileName().find("../",0,TRUE)==-1) { | 216 | if( fi.fileName().find("../",0,TRUE)==-1) { |
238 | qDebug("remove link files "+myFile); | 217 | // qDebug("remove link files "+myFile); |
239 | 218 | ||
@@ -242,3 +221,3 @@ void AdvancedFm::doDelete() | |||
242 | lnk = new DocLnk(f); | 221 | lnk = new DocLnk(f); |
243 | qDebug("Deleting doclnk " + lnk->linkFile()); | 222 | // qDebug("Deleting doclnk " + lnk->linkFile()); |
244 | if(lnk->isValid()) | 223 | if(lnk->isValid()) |
@@ -254,4 +233,3 @@ void AdvancedFm::doDelete() | |||
254 | 233 | ||
255 | void AdvancedFm::filePerms() | 234 | void AdvancedFm::filePerms() { |
256 | { | ||
257 | QStringList curFileList = getPath(); | 235 | QStringList curFileList = getPath(); |
@@ -261,4 +239,3 @@ void AdvancedFm::filePerms() | |||
261 | 239 | ||
262 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 240 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
263 | { | ||
264 | filePermissions *filePerm; | 241 | filePermissions *filePerm; |
@@ -273,4 +250,3 @@ void AdvancedFm::filePerms() | |||
273 | 250 | ||
274 | void AdvancedFm::doProperties() | 251 | void AdvancedFm::doProperties() { |
275 | { | ||
276 | #if defined(QT_QWS_OPIE) | 252 | #if defined(QT_QWS_OPIE) |
@@ -282,7 +258,6 @@ void AdvancedFm::doProperties() | |||
282 | 258 | ||
283 | qDebug("%d",curFileList.count()); | 259 | // qDebug("%d",curFileList.count()); |
284 | 260 | ||
285 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 261 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
286 | { | 262 | // qDebug((filePath+*it)); |
287 | qDebug((filePath+*it)); | ||
288 | DocLnk lnk( (filePath+*it)); | 263 | DocLnk lnk( (filePath+*it)); |
@@ -296,4 +271,3 @@ void AdvancedFm::doProperties() | |||
296 | 271 | ||
297 | void AdvancedFm::upDir() | 272 | void AdvancedFm::upDir() { |
298 | { | ||
299 | QDir *thisDir = CurrentDir(); | 273 | QDir *thisDir = CurrentDir(); |
@@ -310,4 +284,3 @@ void AdvancedFm::upDir() | |||
310 | 284 | ||
311 | void AdvancedFm::copy() | 285 | void AdvancedFm::copy() { |
312 | { | ||
313 | qApp->processEvents(); | 286 | qApp->processEvents(); |
@@ -337,4 +310,3 @@ void AdvancedFm::copy() | |||
337 | QString curFile, item, destFile; | 310 | QString curFile, item, destFile; |
338 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 311 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
339 | { | ||
340 | item=(*it); | 312 | item=(*it); |
@@ -346,14 +318,11 @@ void AdvancedFm::copy() | |||
346 | 318 | ||
347 | qDebug("Destination file is "+destFile); | 319 | // qDebug("Destination file is "+destFile); |
348 | qDebug("CurrentFile file is " + curFile); | 320 | // qDebug("CurrentFile file is " + curFile); |
349 | 321 | ||
350 | QFile f(destFile); | 322 | QFile f(destFile); |
351 | if( f.exists()) | 323 | if( f.exists()) { |
352 | { | 324 | if(doMsg) { |
353 | if(doMsg) | ||
354 | { | ||
355 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 325 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
356 | tr("%1 exists. Ok to overwrite?").arg( item ), | 326 | tr("%1 exists. Ok to overwrite?").arg( item ), |
357 | tr("Yes"),tr("No"),0,0,1) ) | 327 | tr("Yes"),tr("No"),0,0,1) ) { |
358 | { | ||
359 | case 1: | 328 | case 1: |
@@ -372,4 +341,4 @@ void AdvancedFm::copy() | |||
372 | } | 341 | } |
342 | rePopulate(); | ||
373 | setOtherTabCurrent(); | 343 | setOtherTabCurrent(); |
374 | populateView(); | ||
375 | } | 344 | } |
@@ -377,4 +346,3 @@ void AdvancedFm::copy() | |||
377 | 346 | ||
378 | void AdvancedFm::copyAs() | 347 | void AdvancedFm::copyAs() { |
379 | { | ||
380 | qApp->processEvents(); | 348 | qApp->processEvents(); |
@@ -388,4 +356,3 @@ void AdvancedFm::copyAs() | |||
388 | 356 | ||
389 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 357 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
390 | { | ||
391 | QString destFile; | 358 | QString destFile; |
@@ -398,4 +365,3 @@ void AdvancedFm::copyAs() | |||
398 | 365 | ||
399 | if( fileDlg->result() == 1 ) | 366 | if( fileDlg->result() == 1 ) { |
400 | { | ||
401 | QString filename = fileDlg->LineEdit1->text(); | 367 | QString filename = fileDlg->LineEdit1->text(); |
@@ -404,8 +370,6 @@ void AdvancedFm::copyAs() | |||
404 | QFile f( destFile); | 370 | QFile f( destFile); |
405 | if( f.exists()) | 371 | if( f.exists()) { |
406 | { | ||
407 | switch (QMessageBox::warning(this,tr("File Exists!"), | 372 | switch (QMessageBox::warning(this,tr("File Exists!"), |
408 | item+tr("\nexists. Ok to overwrite?"), | 373 | item+tr("\nexists. Ok to overwrite?"), |
409 | tr("Yes"),tr("No"),0,0,1) ) | 374 | tr("Yes"),tr("No"),0,0,1) ) { |
410 | { | ||
411 | case 0: | 375 | case 0: |
@@ -427,8 +391,7 @@ void AdvancedFm::copyAs() | |||
427 | } | 391 | } |
392 | rePopulate(); | ||
428 | setOtherTabCurrent(); | 393 | setOtherTabCurrent(); |
429 | populateView(); | ||
430 | } | 394 | } |
431 | 395 | ||
432 | void AdvancedFm::copySameDir() | 396 | void AdvancedFm::copySameDir() { |
433 | { | ||
434 | qApp->processEvents(); | 397 | qApp->processEvents(); |
@@ -440,4 +403,3 @@ void AdvancedFm::copySameDir() | |||
440 | 403 | ||
441 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 404 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
442 | { | ||
443 | item=(*it); | 405 | item=(*it); |
@@ -449,4 +411,3 @@ void AdvancedFm::copySameDir() | |||
449 | 411 | ||
450 | if( fileDlg->result() == 1 ) | 412 | if( fileDlg->result() == 1 ) { |
451 | { | ||
452 | 413 | ||
@@ -456,4 +417,3 @@ void AdvancedFm::copySameDir() | |||
456 | QFile f(destFile); | 417 | QFile f(destFile); |
457 | if( f.exists()) | 418 | if( f.exists()) { |
458 | { | ||
459 | switch (QMessageBox::warning(this,tr("Delete"), | 419 | switch (QMessageBox::warning(this,tr("Delete"), |
@@ -476,3 +436,3 @@ void AdvancedFm::copySameDir() | |||
476 | 436 | ||
477 | qDebug("copy "+curFile+" as "+destFile); | 437 | // qDebug("copy "+curFile+" as "+destFile); |
478 | } | 438 | } |
@@ -483,4 +443,3 @@ void AdvancedFm::copySameDir() | |||
483 | 443 | ||
484 | void AdvancedFm::move() | 444 | void AdvancedFm::move() { |
485 | { | ||
486 | qApp->processEvents(); | 445 | qApp->processEvents(); |
@@ -488,4 +447,3 @@ void AdvancedFm::move() | |||
488 | QStringList curFileList = getPath(); | 447 | QStringList curFileList = getPath(); |
489 | if( curFileList.count() > 0) | 448 | if( curFileList.count() > 0) { |
490 | { | ||
491 | QString curFile, destFile, item; | 449 | QString curFile, destFile, item; |
@@ -494,4 +452,3 @@ void AdvancedFm::move() | |||
494 | QDir *thatDir = OtherDir(); | 452 | QDir *thatDir = OtherDir(); |
495 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 453 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
496 | { | ||
497 | item=(*it); | 454 | item=(*it); |
@@ -502,3 +459,3 @@ void AdvancedFm::move() | |||
502 | destFile += item; | 459 | destFile += item; |
503 | qDebug("Destination file is "+destFile); | 460 | // qDebug("Destination file is "+destFile); |
504 | 461 | ||
@@ -508,3 +465,3 @@ void AdvancedFm::move() | |||
508 | curFile+= item; | 465 | curFile+= item; |
509 | qDebug("CurrentFile file is " + curFile); | 466 | // qDebug("CurrentFile file is " + curFile); |
510 | 467 | ||
@@ -521,9 +478,7 @@ void AdvancedFm::move() | |||
521 | } | 478 | } |
522 | populateView(); | 479 | rePopulate(); |
523 | setOtherTabCurrent(); | 480 | setOtherTabCurrent(); |
524 | populateView(); | ||
525 | } | 481 | } |
526 | 482 | ||
527 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | 483 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { |
528 | { | ||
529 | bool success = true; | 484 | bool success = true; |
@@ -538,3 +493,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | |||
538 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { | 493 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { |
539 | qWarning("open failed"); | 494 | // qWarning("open failed"); |
540 | return success = false; | 495 | return success = false; |
@@ -545,3 +500,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | |||
545 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { | 500 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { |
546 | qWarning("destfile open failed"); | 501 | // qWarning("destfile open failed"); |
547 | return success = false; | 502 | return success = false; |
@@ -560,3 +515,3 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | |||
560 | success = false; | 515 | success = false; |
561 | qWarning(msg); | 516 | // qWarning(msg); |
562 | } | 517 | } |
@@ -578,4 +533,4 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | |||
578 | 533 | ||
579 | void AdvancedFm::runCommand() | 534 | void AdvancedFm::runCommand() { |
580 | { | 535 | if( !CurrentView()->currentItem()) return; |
581 | QDir *thisDir = CurrentDir(); | 536 | QDir *thisDir = CurrentDir(); |
@@ -591,5 +546,4 @@ void AdvancedFm::runCommand() | |||
591 | 546 | ||
592 | if( fileDlg->result() == 1 ) | 547 | if( fileDlg->result() == 1 ) { |
593 | { | 548 | // qDebug(fileDlg->LineEdit1->text()); |
594 | qDebug(fileDlg->LineEdit1->text()); | ||
595 | QStringList command; | 549 | QStringList command; |
@@ -608,4 +562,4 @@ void AdvancedFm::runCommand() | |||
608 | 562 | ||
609 | void AdvancedFm::runCommandStd() | 563 | void AdvancedFm::runCommandStd() { |
610 | { | 564 | if( !CurrentView()->currentItem()) return; |
611 | QString curFile; | 565 | QString curFile; |
@@ -621,4 +575,3 @@ void AdvancedFm::runCommandStd() | |||
621 | 575 | ||
622 | if( fileDlg->result() == 1 ) | 576 | if( fileDlg->result() == 1 ) { |
623 | { | ||
624 | qApp->processEvents(); | 577 | qApp->processEvents(); |
@@ -628,4 +581,4 @@ void AdvancedFm::runCommandStd() | |||
628 | 581 | ||
629 | void AdvancedFm::fileStatus() | 582 | void AdvancedFm::fileStatus() { |
630 | { | 583 | if( !CurrentView()->currentItem()) return; |
631 | QString curFile; | 584 | QString curFile; |
@@ -646,4 +599,3 @@ void AdvancedFm::fileStatus() | |||
646 | 599 | ||
647 | void AdvancedFm::mkDir() | 600 | void AdvancedFm::mkDir() { |
648 | { | ||
649 | makeDir(); | 601 | makeDir(); |
@@ -651,4 +603,3 @@ void AdvancedFm::mkDir() | |||
651 | 603 | ||
652 | void AdvancedFm::rn() | 604 | void AdvancedFm::rn() { |
653 | { | ||
654 | renameIt(); | 605 | renameIt(); |
@@ -656,4 +607,3 @@ void AdvancedFm::rn() | |||
656 | 607 | ||
657 | void AdvancedFm::del() | 608 | void AdvancedFm::del() { |
658 | { | ||
659 | doDelete(); | 609 | doDelete(); |
@@ -661,8 +611,6 @@ void AdvancedFm::del() | |||
661 | 611 | ||
662 | void AdvancedFm::mkSym() | 612 | void AdvancedFm::mkSym() { |
663 | { | ||
664 | QString cmd; | 613 | QString cmd; |
665 | QStringList curFileList = getPath(); | 614 | QStringList curFileList = getPath(); |
666 | if( curFileList.count() > 0) | 615 | if( curFileList.count() > 0) { |
667 | { | ||
668 | QDir *thisDir = CurrentDir(); | 616 | QDir *thisDir = CurrentDir(); |
@@ -670,8 +618,6 @@ void AdvancedFm::mkSym() | |||
670 | 618 | ||
671 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 619 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
672 | { | ||
673 | 620 | ||
674 | QString destName = thatDir->canonicalPath()+"/"+(*it); | 621 | QString destName = thatDir->canonicalPath()+"/"+(*it); |
675 | if(destName.right(1) == "/") | 622 | if(destName.right(1) == "/") { |
676 | { | ||
677 | destName = destName.left( destName.length() -1); | 623 | destName = destName.left( destName.length() -1); |
@@ -681,4 +627,3 @@ void AdvancedFm::mkSym() | |||
681 | 627 | ||
682 | if( curFile.right(1) == "/") | 628 | if( curFile.right(1) == "/") { |
683 | { | ||
684 | curFile = curFile.left( curFile.length() -1); | 629 | curFile = curFile.left( curFile.length() -1); |
@@ -687,7 +632,7 @@ void AdvancedFm::mkSym() | |||
687 | cmd = "ln -s "+curFile+" "+destName; | 632 | cmd = "ln -s "+curFile+" "+destName; |
688 | qDebug(cmd); | 633 | // qDebug(cmd); |
689 | startProcess( (const QString)cmd ); | 634 | startProcess( (const QString)cmd ); |
690 | } | 635 | } |
636 | rePopulate(); | ||
691 | setOtherTabCurrent(); | 637 | setOtherTabCurrent(); |
692 | populateView(); | ||
693 | } | 638 | } |
@@ -695,4 +640,3 @@ void AdvancedFm::mkSym() | |||
695 | 640 | ||
696 | void AdvancedFm::doBeam() | 641 | void AdvancedFm::doBeam() { |
697 | { | ||
698 | Ir ir; | 642 | Ir ir; |
@@ -716,4 +660,3 @@ void AdvancedFm::doBeam() | |||
716 | 660 | ||
717 | void AdvancedFm::fileBeamFinished( Ir *) | 661 | void AdvancedFm::fileBeamFinished( Ir *) { |
718 | { | ||
719 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 662 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
@@ -721,5 +664,3 @@ void AdvancedFm::fileBeamFinished( Ir *) | |||
721 | 664 | ||
722 | void AdvancedFm::selectAll() | 665 | void AdvancedFm::selectAll() { |
723 | { | ||
724 | // if (TabWidget->currentTab() == 0) { | ||
725 | QListView *thisView = CurrentView(); | 666 | QListView *thisView = CurrentView(); |
@@ -727,10 +668,5 @@ void AdvancedFm::selectAll() | |||
727 | thisView->setSelected( thisView->firstChild(),false); | 668 | thisView->setSelected( thisView->firstChild(),false); |
728 | // } else { | ||
729 | // Remote_View->selectAll(true); | ||
730 | // Remote_View->setSelected( Remote_View->firstChild(),false); | ||
731 | // } | ||
732 | } | 669 | } |
733 | 670 | ||
734 | void AdvancedFm::startProcess(const QString & cmd) | 671 | void AdvancedFm::startProcess(const QString & cmd) { |
735 | { | ||
736 | QStringList command; | 672 | QStringList command; |
@@ -752,5 +688,3 @@ void AdvancedFm::startProcess(const QString & cmd) | |||
752 | 688 | ||
753 | void AdvancedFm::processEnded(OProcess *) | 689 | void AdvancedFm::processEnded(OProcess *) { |
754 | { | ||
755 | // populateLocalView(); | ||
756 | populateView(); | 690 | populateView(); |
@@ -758,23 +692,15 @@ void AdvancedFm::processEnded(OProcess *) | |||
758 | 692 | ||
759 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int buflen) { | 693 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { |
760 | qWarning("received stderrt %d bytes", buflen); | 694 | // qWarning("received stderrt %d bytes", buflen); |
761 | 695 | ||
762 | QString lineStr = buffer; | 696 | QString lineStr = buffer; |
763 | // lineStr=lineStr.left(lineStr.length()-1); | ||
764 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | 697 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); |
765 | |||
766 | // OutputEdit->append(lineStr); | ||
767 | // OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | ||
768 | } | 698 | } |
769 | 699 | ||
770 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | 700 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { |
771 | { | 701 | if ( o->inherits( "QLineEdit" ) ) { |
772 | if ( o->inherits( "QLineEdit" ) ) | 702 | if ( e->type() == QEvent::KeyPress ) { |
773 | { | ||
774 | if ( e->type() == QEvent::KeyPress ) | ||
775 | { | ||
776 | QKeyEvent *ke = (QKeyEvent*)e; | 703 | QKeyEvent *ke = (QKeyEvent*)e; |
777 | if ( ke->key() == Key_Return || | 704 | if ( ke->key() == Key_Return || |
778 | ke->key() == Key_Enter ) | 705 | ke->key() == Key_Enter ) { |
779 | { | ||
780 | okRename(); | 706 | okRename(); |
@@ -782,4 +708,3 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | |||
782 | } | 708 | } |
783 | else if ( ke->key() == Key_Escape ) | 709 | else if ( ke->key() == Key_Escape ) { |
784 | { | ||
785 | cancelRename(); | 710 | cancelRename(); |
@@ -788,4 +713,3 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | |||
788 | } | 713 | } |
789 | else if ( e->type() == QEvent::FocusOut ) | 714 | else if ( e->type() == QEvent::FocusOut ) { |
790 | { | ||
791 | cancelRename(); | 715 | cancelRename(); |
@@ -794,9 +718,12 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | |||
794 | } | 718 | } |
795 | if ( o->inherits( "QListView" ) ) | 719 | if ( o->inherits( "QListView" ) ) { |
796 | { | 720 | if ( e->type() == QEvent::FocusIn ) { |
797 | if ( e->type() == QEvent::FocusOut ) | 721 | if( o == Local_View) { //keep track of which view |
798 | { | 722 | whichTab=1; |
799 | printf("focusIn\n"); | ||
800 | |||
801 | } | 723 | } |
724 | else { | ||
725 | whichTab=2; | ||
726 | } | ||
727 | } | ||
728 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection | ||
802 | } | 729 | } |
@@ -807,5 +734,4 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | |||
807 | 734 | ||
808 | void AdvancedFm::cancelRename() | 735 | void AdvancedFm::cancelRename() { |
809 | { | 736 | // qDebug("cancel rename"); |
810 | qDebug("cancel rename"); | ||
811 | QListView * view; | 737 | QListView * view; |
@@ -816,4 +742,3 @@ void AdvancedFm::cancelRename() | |||
816 | renameBox = 0; | 742 | renameBox = 0; |
817 | if ( resetFocus ) | 743 | if ( resetFocus ) { |
818 | { | ||
819 | view->viewport()->setFocusProxy( view); | 744 | view->viewport()->setFocusProxy( view); |
@@ -823,4 +748,4 @@ void AdvancedFm::cancelRename() | |||
823 | 748 | ||
824 | void AdvancedFm::doRename(QListView * view) | 749 | void AdvancedFm::doRename(QListView * view) { |
825 | { | 750 | if( !CurrentView()->currentItem()) return; |
826 | 751 | ||
@@ -844,3 +769,2 @@ void AdvancedFm::doRename(QListView * view) | |||
844 | renameBox->show(); | 769 | renameBox->show(); |
845 | |||
846 | } | 770 | } |
@@ -848,4 +772,4 @@ void AdvancedFm::doRename(QListView * view) | |||
848 | 772 | ||
849 | void AdvancedFm::renameIt() | 773 | void AdvancedFm::renameIt() { |
850 | { | 774 | if( !CurrentView()->currentItem()) return; |
851 | QListView *thisView = CurrentView(); | 775 | QListView *thisView = CurrentView(); |
@@ -856,7 +780,6 @@ void AdvancedFm::renameIt() | |||
856 | 780 | ||
857 | void AdvancedFm::okRename() | 781 | void AdvancedFm::okRename() { |
858 | { | 782 | if( !CurrentView()->currentItem()) return; |
859 | QString newName = renameBox->text(); | 783 | QString newName = renameBox->text(); |
860 | cancelRename(); | 784 | cancelRename(); |
861 | // int tabs=0; | ||
862 | QListView * view = CurrentView(); | 785 | QListView * view = CurrentView(); |
@@ -866,4 +789,2 @@ void AdvancedFm::okRename() | |||
866 | 789 | ||
867 | if( view->currentItem() == NULL) | ||
868 | return; | ||
869 | if( rename( oldName.latin1(), newName.latin1())== -1) | 790 | if( rename( oldName.latin1(), newName.latin1())== -1) |
@@ -879,3 +800,3 @@ void AdvancedFm::okRename() | |||
879 | void AdvancedFm::openSearch() { | 800 | void AdvancedFm::openSearch() { |
880 | 801 | QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); | |
881 | } | 802 | } |
diff --git a/noncore/apps/advancedfm/filePermissions.cpp b/noncore/apps/advancedfm/filePermissions.cpp index 4de6d12..9698de7 100644 --- a/noncore/apps/advancedfm/filePermissions.cpp +++ b/noncore/apps/advancedfm/filePermissions.cpp | |||
@@ -33,3 +33,3 @@ filePermissions::filePermissions( QWidget* parent, const char* name, bool modal | |||
33 | if ( !name ) | 33 | if ( !name ) |
34 | setName( "filePermissions" ); | 34 | setName( tr("filePermissions") ); |
35 | // qDebug("FilePermissions "+fileName); | 35 | // qDebug("FilePermissions "+fileName); |