X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLogWindow%2FLogWindow.cxx;h=0b846b720476a4753c4e593784557c78cd7d7bd6;hb=82c798c0db395e1f2aa725d1c74bc24f014751cc;hp=a676a7645f89273652d275fccaab1f3e89782f96;hpb=2e750f9ded92337bc3c44e9d7388180974cc4a43;p=modules%2Fgui.git diff --git a/src/LogWindow/LogWindow.cxx b/src/LogWindow/LogWindow.cxx index a676a7645..0b846b720 100755 --- a/src/LogWindow/LogWindow.cxx +++ b/src/LogWindow/LogWindow.cxx @@ -27,9 +27,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -214,33 +214,23 @@ void LogWindow::updateActions() void LogWindow::onSaveToFile() { - QString aUsedFilter; - QString aName = QFileDialog::getSaveFileName( QString::null, QString( "*.log" ), this, - 0, QString::null, &aUsedFilter ); - if ( aName.isNull() ) + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if ( !app ) return; - int aStart = aUsedFilter.find('*'); - int aEnd = aUsedFilter.find(')', aStart + 1); - QString aExt = aUsedFilter.mid(aStart + 1, aEnd - aStart - 1); - if ( aExt.contains('*') == 0 ) - { - if ( aName.contains( aExt, false ) == 0 ) - aName += aExt; - } - + // call application-specific "Save file" dialog box + QString aName = app->getFileName( false, QString::null, QString( "*.log" ), QString::null, 0 ); + if ( aName.isNull() ) + return; - if ( !aName.isNull() ) - { - QApplication::setOverrideCursor( Qt::waitCursor ); + QApplication::setOverrideCursor( Qt::waitCursor ); - bool bOk = saveLog( aName ); + bool bOk = saveLog( aName ); - QApplication::restoreOverrideCursor(); + QApplication::restoreOverrideCursor(); - if ( !bOk ) - SUIT_MessageBox::error1( this, tr( "Error" ), tr( "Can't save file" ), tr( "OK" ) ); - } + if ( !bOk ) + SUIT_MessageBox::error1( this, tr( "Error" ), tr( "Can't save file" ), tr( "OK" ) ); } void LogWindow::onSelectAll()