From 3fe426d78c4a34113bdcccf60c3fe82c856fb975 Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 7 Nov 2005 10:27:01 +0000 Subject: [PATCH] PAL9628 - incorrect work of button "Save" --- src/SUIT/SUIT_FileDlg.cxx | 22 ++++++++++++++++------ src/SUIT/SUIT_FileDlg.h | 5 ++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index 992b6be73..fffee22ab 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -76,9 +76,19 @@ SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool QFileDialog( parent, 0, modal ), myValidator( 0 ), myQuickCombo( 0 ), myQuickButton( 0 ), myQuickLab( 0 ), -myOpen( open ), -myAccepted( false ) +myOpen( open )//, +//myAccepted( false ) { + const QObjectList* child = children(); + QObjectList::const_iterator anIt = child->begin(), aLast = child->end(); + for( ; anIt!=aLast; anIt++ ) + if( (*anIt)->inherits( "QPushButton" ) ) + { + QPushButton* bt = ( QPushButton* )( *anIt ); + bt->setDefault( false ); + bt->setAutoDefault( false ); + } + if ( parent->icon() ) setIcon( *parent->icon() ); setSizeGripEnabled( true ); @@ -207,7 +217,7 @@ void SUIT_FileDlg::accept() * in file name editor while file name is not acceptable by acceptData() * (e.g. permission denied) */ - if ( !myAccepted ) { +// if ( !myAccepted ) { if ( mode() != ExistingFiles ) { mySelectedFile = QFileDialog::selectedFile(); addExtension(); @@ -216,10 +226,10 @@ void SUIT_FileDlg::accept() if ( acceptData() ) { myLastVisitedPath = dirPath(); QFileDialog::accept(); - myAccepted = true; +// myAccepted = true; } - } - myAccepted = !myAccepted; +// } +// myAccepted = !myAccepted; } /*! Closes this dialog and sets the return code to 'Rejected' */ diff --git a/src/SUIT/SUIT_FileDlg.h b/src/SUIT/SUIT_FileDlg.h index 7bf1cc663..bcbd24d60 100755 --- a/src/SUIT/SUIT_FileDlg.h +++ b/src/SUIT/SUIT_FileDlg.h @@ -64,7 +64,10 @@ protected: * in file name editor while file name is not acceptable by acceptData() * (e.g. permission denied) */ - bool myAccepted; +// bool myAccepted; + /*! ASL: this bug can be fixed with help of call setDefault( false ) + * and setAutoDefault( false ) methods for all QPushButtons of this dialog + */ static QString myLastVisitedPath; //!< last visited path }; -- 2.39.2