author | llornkcor <llornkcor> | 2004-09-25 04:38:48 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-25 04:38:48 (UTC) |
commit | 4eab17fb1381c938188e13ec5025b8302b159c9e (patch) (unidiff) | |
tree | bb8d1c5e52e59d8e1683da3dab08d20177e684f7 | |
parent | 037acb8741eabb71693104f7807ffd848ac4d1f9 (diff) | |
download | opie-4eab17fb1381c938188e13ec5025b8302b159c9e.zip opie-4eab17fb1381c938188e13ec5025b8302b159c9e.tar.gz opie-4eab17fb1381c938188e13ec5025b8302b159c9e.tar.bz2 |
opti function and fix
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 133 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 2 |
2 files changed, 47 insertions, 88 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index fec320d..73d0d57 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -35,28 +35,28 @@ | |||
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 | populateView(); | 47 | rePopulate(); |
48 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); | 48 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); |
49 | connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&))); | 49 | connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&))); |
50 | switchToLocalTab(); | 50 | switchToLocalTab(); |
51 | } | 51 | } |
52 | 52 | ||
53 | AdvancedFm::~AdvancedFm() { | 53 | AdvancedFm::~AdvancedFm() { |
54 | } | 54 | } |
55 | 55 | ||
56 | 56 | ||
57 | void AdvancedFm::cleanUp() { | 57 | void AdvancedFm::cleanUp() { |
58 | QString sfile=QDir::homeDirPath(); | 58 | QString sfile=QDir::homeDirPath(); |
59 | if(sfile.right(1) != "/") | 59 | if(sfile.right(1) != "/") |
60 | sfile+="/._temp"; | 60 | sfile+="/._temp"; |
61 | else | 61 | else |
62 | sfile+="._temp"; | 62 | sfile+="._temp"; |
@@ -365,109 +365,68 @@ void AdvancedFm::CFButtonPushed() { | |||
365 | if(zaurusDevice) | 365 | if(zaurusDevice) |
366 | changeTo("/mnt/cf"); //zaurus | 366 | changeTo("/mnt/cf"); //zaurus |
367 | else | 367 | else |
368 | changeTo("/mnt/hda"); //ipaq | 368 | changeTo("/mnt/hda"); //ipaq |
369 | } | 369 | } |
370 | 370 | ||
371 | 371 | ||
372 | void AdvancedFm::doAbout() { | 372 | void AdvancedFm::doAbout() { |
373 | 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>")); | 373 | 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>")); |
374 | } | 374 | } |
375 | 375 | ||
376 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { | 376 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { |
377 | // owarn << "key " << e->key() << "" << oendl; | 377 | if( e->key() == Key_Left ) |
378 | // if( CurrentView()->hasFocus() ) | 378 | upDir(); |
379 | { | 379 | else if( e->key() == Key_Return || e->key() == Key_Enter) |
380 | switch ( e->key() ) { | 380 | navigateToSelected(); |
381 | case Key_Left: | 381 | else if( e->key() == Key_Tab) |
382 | upDir(); | 382 | setOtherTabCurrent(); |
383 | break; | 383 | else if( e->key() == Key_Delete ) |
384 | case Key_Next: | 384 | del(); |
385 | break; | 385 | else if( e->key() == Key_A) |
386 | case Key_Return: | 386 | copyAs(); |
387 | case Key_Enter: | 387 | else if( e->key() == Key_C) |
388 | navigateToSelected(); | 388 | copy(); |
389 | break; | 389 | else if( e->key() == Key_E) |
390 | case Key_Tab: { | 390 | runThis(); |
391 | setOtherTabCurrent(); | 391 | else if( e->key() == Key_G) |
392 | } | 392 | currentPathCombo->lineEdit()->setFocus(); |
393 | break; | 393 | else if( e->key() == Key_H ) |
394 | case Key_Delete: | 394 | showHidden(); |
395 | del(); | 395 | else if( e->key() == Key_I) |
396 | break; | 396 | fileStatus(); |
397 | case Key_A: | 397 | else if( e->key() == Key_M) |
398 | copyAs(); | 398 | move(); |
399 | break; | 399 | else if( e->key() == Key_N ) |
400 | case Key_C: | 400 | mkDir(); |
401 | copy(); | 401 | else if( e->key() == Key_P) |
402 | break; | 402 | filePerms(); |
403 | case Key_E: | 403 | else if( e->key() == Key_R ) |
404 | runThis(); | 404 | rn(); |
405 | break; | 405 | else if( e->key() == Key_U ) |
406 | case Key_G: | 406 | upDir(); |
407 | { | 407 | else if( e->key() == Key_1) |
408 | currentPathCombo->lineEdit()->setFocus(); | 408 | switchToLocalTab(); |
409 | } | 409 | else if( e->key() == Key_2) |
410 | break; | 410 | switchToRemoteTab(); |
411 | 411 | else if( e->key() == Key_3) | |
412 | case Key_H: | 412 | CFButtonPushed(); |
413 | showHidden(); | 413 | else if( e->key() == Key_4) |
414 | break; | 414 | SDButtonPushed(); |
415 | case Key_I: | 415 | else if( e->key() == Key_5 ) |
416 | fileStatus(); | 416 | homeButtonPushed(); |
417 | break; | 417 | else if( e->key() == Key_6 ) |
418 | case Key_M: | 418 | docButtonPushed(); |
419 | move(); | 419 | else |
420 | break; | 420 | e->accept(); |
421 | case Key_N: | ||
422 | mkDir(); | ||
423 | break; | ||
424 | case Key_P: | ||
425 | filePerms(); | ||
426 | break; | ||
427 | case Key_R: | ||
428 | rn(); | ||
429 | break; | ||
430 | case Key_U: | ||
431 | upDir(); | ||
432 | break; | ||
433 | case Key_1: | ||
434 | switchToLocalTab(); | ||
435 | break; | ||
436 | case Key_2: | ||
437 | switchToRemoteTab(); | ||
438 | break; | ||
439 | case Key_3: | ||
440 | CFButtonPushed(); | ||
441 | break; | ||
442 | case Key_4: | ||
443 | SDButtonPushed(); | ||
444 | break; | ||
445 | case Key_5: | ||
446 | homeButtonPushed(); | ||
447 | break; | ||
448 | case Key_6: | ||
449 | docButtonPushed(); | ||
450 | break; | ||
451 | case Key_7: | ||
452 | break; | ||
453 | case Key_8: | ||
454 | break; | ||
455 | case Key_9: | ||
456 | break; | ||
457 | case Key_0: | ||
458 | break; | ||
459 | }; | ||
460 | e->accept(); | ||
461 | } | ||
462 | } | 421 | } |
463 | 422 | ||
464 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { | 423 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { |
465 | if( CurrentView()->hasFocus() ) | 424 | if( CurrentView()->hasFocus() ) |
466 | e->ignore(); | 425 | e->ignore(); |
467 | } | 426 | } |
468 | 427 | ||
469 | 428 | ||
470 | void AdvancedFm::QPEButtonPushed() { | 429 | void AdvancedFm::QPEButtonPushed() { |
471 | QString current = QPEApplication::qpeDir(); | 430 | QString current = QPEApplication::qpeDir(); |
472 | chdir( current.latin1() ); | 431 | chdir( current.latin1() ); |
473 | CurrentDir()->cd( current, TRUE); | 432 | CurrentDir()->cd( current, TRUE); |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index c52b853..b109364 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -88,25 +88,25 @@ protected: | |||
88 | void keyReleaseEvent( QKeyEvent *); | 88 | void keyReleaseEvent( QKeyEvent *); |
89 | void keyPressEvent( QKeyEvent *); | 89 | void keyPressEvent( QKeyEvent *); |
90 | QString getFileSystemType(const QString &); | 90 | QString getFileSystemType(const QString &); |
91 | QString getDiskSpace(const QString &); | 91 | QString getDiskSpace(const QString &); |
92 | void parsetab(const QString &fileName); | 92 | void parsetab(const QString &fileName); |
93 | QString checkDiskSpace(const QString &); | 93 | QString checkDiskSpace(const QString &); |
94 | QString dealWithSymName(const QString &); | 94 | QString dealWithSymName(const QString &); |
95 | QDir *CurrentDir(); | 95 | QDir *CurrentDir(); |
96 | QDir *OtherDir(); | 96 | QDir *OtherDir(); |
97 | QListView *CurrentView(); | 97 | QListView *CurrentView(); |
98 | QListView *OtherView(); | 98 | QListView *OtherView(); |
99 | void setOtherTabCurrent(); | 99 | void setOtherTabCurrent(); |
100 | void changeTo(QString & dir); | 100 | void changeTo(QString dir); |
101 | 101 | ||
102 | //protected signals: | 102 | //protected signals: |
103 | // void newPath(QString); | 103 | // void newPath(QString); |
104 | 104 | ||
105 | protected slots: | 105 | protected slots: |
106 | void slotSwitchMenu(int); | 106 | void slotSwitchMenu(int); |
107 | void selectAll(); | 107 | void selectAll(); |
108 | void addToDocs(); | 108 | void addToDocs(); |
109 | void doDirChange(); | 109 | void doDirChange(); |
110 | void mkDir(); | 110 | void mkDir(); |
111 | void del(); | 111 | void del(); |
112 | void rn(); | 112 | void rn(); |