-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 34 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 26 |
2 files changed, 45 insertions, 15 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 @@ -69,2 +69,4 @@ AdvancedFm::AdvancedFm( ) init(); + renameBox = 0; + initConnections(); @@ -404,2 +406,10 @@ void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , i case 1: + { + if(renameBox != 0 ) + { + qDebug("cancel rename"); + cancelRename(); + } + + } break; @@ -414,10 +424,17 @@ void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, in - switch (mouse) { - case 1: - break; - case 2: - menuTimer.start( 500, TRUE ); - qDebug("Start menu timer"); - break; - }; + switch (mouse) { + case 1: + { + if(renameBox != 0 ) + { + qDebug("cancel rename"); + cancelRename(); + } + } + break; + case 2: + menuTimer.start( 500, TRUE ); + qDebug("Start menu timer"); + break; + }; } @@ -881 +898,2 @@ void AdvancedFm::addToDocs() { } + diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index f067013..2ddcabc 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -1029,2 +1029,9 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { } + if ( o->inherits( "QListView" ) ) { + if ( e->type() == QEvent::FocusOut ) { + printf("focusIn\n"); + + } + } + return QWidget::eventFilter( o, e ); @@ -1033,8 +1040,10 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { -void AdvancedFm::cancelRename() { +void AdvancedFm::cancelRename() +{ qDebug("cancel rename"); QListView * view; - if (TabWidget->getCurrentTab() == 0) { - view = Local_View; - } + if (TabWidget->getCurrentTab() == 0) + { + view = Local_View; + } else @@ -1053,3 +1062,4 @@ void AdvancedFm::cancelRename() { -void AdvancedFm::doRename(QListView * view) { +void AdvancedFm::doRename(QListView * view) +{ @@ -1077,3 +1087,4 @@ void AdvancedFm::doRename(QListView * view) { -void AdvancedFm::localRename() { +void AdvancedFm::localRename() +{ oldName = Local_View->currentItem()->text(0); @@ -1090,3 +1101,4 @@ void AdvancedFm::remoteRename() -void AdvancedFm::okRename() { +void AdvancedFm::okRename() +{ QString newName = renameBox->text(); |