-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 18 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 22 |
2 files changed, 35 insertions, 5 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 @@ -67,6 +67,8 @@ AdvancedFm::AdvancedFm( ) : QMainWindow( ) { init(); + renameBox = 0; + initConnections(); populateLocalView(); populateRemoteView(); @@ -402,6 +404,14 @@ void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , i // qDebug("list pressed"); switch (mouse) { case 1: + { + if(renameBox != 0 ) + { + qDebug("cancel rename"); + cancelRename(); + } + + } break; case 2: menuTimer.start( 500, TRUE ); @@ -414,6 +424,13 @@ void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, in switch (mouse) { case 1: + { + if(renameBox != 0 ) + { + qDebug("cancel rename"); + cancelRename(); + } + } break; case 2: menuTimer.start( 500, TRUE ); @@ -879,3 +896,4 @@ 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 @@ -1027,14 +1027,23 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { return true; } } + if ( o->inherits( "QListView" ) ) { + if ( e->type() == QEvent::FocusOut ) { + printf("focusIn\n"); + + } + } + return QWidget::eventFilter( o, e ); } -void AdvancedFm::cancelRename() { +void AdvancedFm::cancelRename() +{ qDebug("cancel rename"); QListView * view; - if (TabWidget->getCurrentTab() == 0) { + if (TabWidget->getCurrentTab() == 0) + { view = Local_View; } else @@ -1051,7 +1060,8 @@ void AdvancedFm::cancelRename() { } } -void AdvancedFm::doRename(QListView * view) { +void AdvancedFm::doRename(QListView * view) +{ QRect r = view->itemRect( view->currentItem( )); r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); @@ -1075,7 +1085,8 @@ void AdvancedFm::doRename(QListView * view) { } -void AdvancedFm::localRename() { +void AdvancedFm::localRename() +{ oldName = Local_View->currentItem()->text(0); doRename(Local_View ); populateLocalView(); @@ -1088,7 +1099,8 @@ void AdvancedFm::remoteRename() populateRemoteView(); } -void AdvancedFm::okRename() { +void AdvancedFm::okRename() +{ QString newName = renameBox->text(); cancelRename(); int tabs=0; |