[yast-commit] r55617 - in /trunk/qt: package/yast2-qt.changes src/YQApplication.cc
Author: tgoettlicher Date: Thu Feb 19 17:24:56 2009 New Revision: 55617 URL: http://svn.opensuse.org/viewcvs/yast?rev=55617&view=rev Log: - Fixed bnc #464152: save file dialog asks twice to replace file when the file exists Modified: trunk/qt/package/yast2-qt.changes trunk/qt/src/YQApplication.cc Modified: trunk/qt/package/yast2-qt.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=55617&r1=55616&r2=55617&view=diff ============================================================================== --- trunk/qt/package/yast2-qt.changes (original) +++ trunk/qt/package/yast2-qt.changes Thu Feb 19 17:24:56 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Feb 19 17:21:48 CET 2009 - tgoettlicher@suse.de + +- Fixed bnc #464152: save file dialog asks twice to replace file + when the file exists + +------------------------------------------------------------------- Sun Feb 15 12:39:06 CET 2009 - coolo@suse.de - include stdio to fix compilation with gcc 4.4 Modified: trunk/qt/src/YQApplication.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQApplication.cc?rev=55617&r1=55616&r2=55617&view=diff ============================================================================== --- trunk/qt/src/YQApplication.cc (original) +++ trunk/qt/src/YQApplication.cc Thu Feb 19 17:24:56 2009 @@ -516,7 +516,6 @@ const QString & headline ) { QString fileName; - bool tryAgain = false; QWidget* parent = 0; YDialog * currentDialog = YDialog::currentDialog( false ); @@ -524,45 +523,16 @@ parent = (QWidget *) currentDialog->widgetRep(); - do - { - // Leave the mouse cursor alone - this function might be called from - // some other widget, not only from UI::AskForSaveFileName(). + // Leave the mouse cursor alone - this function might be called from + // some other widget, not only from UI::AskForSaveFileName(). - fileName = QFileDialog::getSaveFileName( parent, // parent - headline, // caption - startWith, // dir - filter ); // filter - - if ( fileName.isEmpty() ) // this includes fileName.isNull() - return QString::null; - - - if ( access( QFile::encodeName( fileName ), F_OK ) == 0 ) // file exists? - { - QString msg; - - if ( access( QFile::encodeName( fileName ), W_OK ) == 0 ) - { - // Confirm if the user wishes to overwrite an existing file - msg = ( _( "%1 exists! Really overwrite?" ) ).arg( fileName ); - } - else - { - // Confirm if the user wishes to overwrite a write-protected file %1 - msg = ( _( "%1 exists and is write-protected!\nReally overwrite?" ) ).arg( fileName ); - } - - int buttonNo = QMessageBox::information( parent, - // Translators: Window title for confirmation dialog - _( "Confirm" ), - msg, - _( "C&ontinue" ), - _( "&Cancel" ) ); - tryAgain = ( buttonNo != 0 ); - } + fileName = QFileDialog::getSaveFileName( parent, // parent + headline, // caption + startWith, // dir + filter ); // filter - } while ( tryAgain ); + if ( fileName.isEmpty() ) // this includes fileName.isNull() + return QString::null; return fileName; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
tgoettlicher@svn.opensuse.org