summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-02-21 22:44:28 (UTC)
committer llornkcor <llornkcor>2003-02-21 22:44:28 (UTC)
commita7448ec87d97a0128618e83ad7526bd884ef8853 (patch) (side-by-side diff)
tree0dda2db8da959c26d0ec089bec161ae28486d2cc
parentd48baa03492fd4785ca273defb4e21bf8c0d1c08 (diff)
downloadopie-a7448ec87d97a0128618e83ad7526bd884ef8853.zip
opie-a7448ec87d97a0128618e83ad7526bd884ef8853.tar.gz
opie-a7448ec87d97a0128618e83ad7526bd884ef8853.tar.bz2
fix rename cancel.. hehehe
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp34
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp26
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
@@ -68,4 +68,6 @@ AdvancedFm::AdvancedFm( )
: QMainWindow( ) {
init();
+ renameBox = 0;
+
initConnections();
populateLocalView();
@@ -403,4 +405,12 @@ void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , i
switch (mouse) {
case 1:
+ {
+ if(renameBox != 0 )
+ {
+ qDebug("cancel rename");
+ cancelRename();
+ }
+
+ }
break;
case 2:
@@ -413,12 +423,19 @@ void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , i
void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) {
- 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;
+ };
}
@@ -880,2 +897,3 @@ 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
@@ -1028,14 +1028,23 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
}
}
+ 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) {
- view = Local_View;
- }
+ if (TabWidget->getCurrentTab() == 0)
+ {
+ view = Local_View;
+ }
else
{
@@ -1052,5 +1061,6 @@ void AdvancedFm::cancelRename() {
}
-void AdvancedFm::doRename(QListView * view) {
+void AdvancedFm::doRename(QListView * view)
+{
QRect r = view->itemRect( view->currentItem( ));
@@ -1076,5 +1086,6 @@ void AdvancedFm::doRename(QListView * view) {
-void AdvancedFm::localRename() {
+void AdvancedFm::localRename()
+{
oldName = Local_View->currentItem()->text(0);
doRename(Local_View );
@@ -1089,5 +1100,6 @@ void AdvancedFm::remoteRename()
}
-void AdvancedFm::okRename() {
+void AdvancedFm::okRename()
+{
QString newName = renameBox->text();
cancelRename();