author | llornkcor <llornkcor> | 2003-02-21 22:44:28 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-02-21 22:44:28 (UTC) |
commit | a7448ec87d97a0128618e83ad7526bd884ef8853 (patch) (unidiff) | |
tree | 0dda2db8da959c26d0ec089bec161ae28486d2cc /noncore/apps/advancedfm/advancedfm.cpp | |
parent | d48baa03492fd4785ca273defb4e21bf8c0d1c08 (diff) | |
download | opie-a7448ec87d97a0128618e83ad7526bd884ef8853.zip opie-a7448ec87d97a0128618e83ad7526bd884ef8853.tar.gz opie-a7448ec87d97a0128618e83ad7526bd884ef8853.tar.bz2 |
fix rename cancel.. hehehe
Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index c653b90..9edf7c1 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -58,24 +58,26 @@ | |||
58 | #include <time.h> | 58 | #include <time.h> |
59 | #include <fcntl.h> | 59 | #include <fcntl.h> |
60 | #include <mntent.h> | 60 | #include <mntent.h> |
61 | #include <string.h> | 61 | #include <string.h> |
62 | #include <errno.h> | 62 | #include <errno.h> |
63 | #include <sys/vfs.h> | 63 | #include <sys/vfs.h> |
64 | #include <mntent.h> | 64 | #include <mntent.h> |
65 | #include <sys/utsname.h> | 65 | #include <sys/utsname.h> |
66 | 66 | ||
67 | AdvancedFm::AdvancedFm( ) | 67 | AdvancedFm::AdvancedFm( ) |
68 | : QMainWindow( ) { | 68 | : QMainWindow( ) { |
69 | init(); | 69 | init(); |
70 | renameBox = 0; | ||
71 | |||
70 | initConnections(); | 72 | initConnections(); |
71 | populateLocalView(); | 73 | populateLocalView(); |
72 | populateRemoteView(); | 74 | populateRemoteView(); |
73 | currentPathCombo->setFocus(); | 75 | currentPathCombo->setFocus(); |
74 | } | 76 | } |
75 | 77 | ||
76 | AdvancedFm::~AdvancedFm() { | 78 | AdvancedFm::~AdvancedFm() { |
77 | } | 79 | } |
78 | 80 | ||
79 | void AdvancedFm::cleanUp() { | 81 | void AdvancedFm::cleanUp() { |
80 | QString sfile=QDir::homeDirPath(); | 82 | QString sfile=QDir::homeDirPath(); |
81 | if(sfile.right(1) != "/") | 83 | if(sfile.right(1) != "/") |
@@ -393,42 +395,57 @@ void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) { | |||
393 | } | 395 | } |
394 | } //end not symlink | 396 | } //end not symlink |
395 | chdir(strItem.latin1()); | 397 | chdir(strItem.latin1()); |
396 | } | 398 | } |
397 | } | 399 | } |
398 | } | 400 | } |
399 | 401 | ||
400 | 402 | ||
401 | void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) { | 403 | void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) { |
402 | // qDebug("list pressed"); | 404 | // qDebug("list pressed"); |
403 | switch (mouse) { | 405 | switch (mouse) { |
404 | case 1: | 406 | case 1: |
407 | { | ||
408 | if(renameBox != 0 ) | ||
409 | { | ||
410 | qDebug("cancel rename"); | ||
411 | cancelRename(); | ||
412 | } | ||
413 | |||
414 | } | ||
405 | break; | 415 | break; |
406 | case 2: | 416 | case 2: |
407 | menuTimer.start( 500, TRUE ); | 417 | menuTimer.start( 500, TRUE ); |
408 | qDebug("Start menu timer\n"); | 418 | qDebug("Start menu timer\n"); |
409 | break; | 419 | break; |
410 | }; | 420 | }; |
411 | } | 421 | } |
412 | 422 | ||
413 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) { | 423 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) { |
414 | 424 | ||
415 | switch (mouse) { | 425 | switch (mouse) { |
416 | case 1: | 426 | case 1: |
417 | break; | 427 | { |
418 | case 2: | 428 | if(renameBox != 0 ) |
419 | menuTimer.start( 500, TRUE ); | 429 | { |
420 | qDebug("Start menu timer"); | 430 | qDebug("cancel rename"); |
421 | break; | 431 | cancelRename(); |
422 | }; | 432 | } |
433 | } | ||
434 | break; | ||
435 | case 2: | ||
436 | menuTimer.start( 500, TRUE ); | ||
437 | qDebug("Start menu timer"); | ||
438 | break; | ||
439 | }; | ||
423 | } | 440 | } |
424 | 441 | ||
425 | 442 | ||
426 | void AdvancedFm::switchToLocalTab() { | 443 | void AdvancedFm::switchToLocalTab() { |
427 | TabWidget->setCurrentTab(0); | 444 | TabWidget->setCurrentTab(0); |
428 | Local_View->setFocus(); | 445 | Local_View->setFocus(); |
429 | } | 446 | } |
430 | 447 | ||
431 | void AdvancedFm::switchToRemoteTab() { | 448 | void AdvancedFm::switchToRemoteTab() { |
432 | TabWidget->setCurrentTab(1); | 449 | TabWidget->setCurrentTab(1); |
433 | Remote_View->setFocus(); | 450 | Remote_View->setFocus(); |
434 | } | 451 | } |
@@ -870,12 +887,13 @@ void AdvancedFm::addToDocs() { | |||
870 | curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | 887 | curFile = currentRemoteDir.canonicalPath()+"/"+(*it); |
871 | qDebug(curFile); | 888 | qDebug(curFile); |
872 | 889 | ||
873 | DocLnk f; | 890 | DocLnk f; |
874 | // curFile.replace(QRegExp("\\..*"),""); | 891 | // curFile.replace(QRegExp("\\..*"),""); |
875 | f.setName((*it)); | 892 | f.setName((*it)); |
876 | f.setFile( curFile); | 893 | f.setFile( curFile); |
877 | f.writeLink(); | 894 | f.writeLink(); |
878 | } | 895 | } |
879 | } | 896 | } |
880 | } | 897 | } |
881 | } | 898 | } |
899 | |||