#include "QtxResourceMgr.h"
#include <SUIT_MessageBox.h>
+#include <SUIT_FileDlg.h>
#include <QAbstractButton>
#include <QVBoxLayout>
void LightApp_PreferencesDlg::onImportPref()
{
QtxResourceMgr* mgr = myPrefs->resourceMgr();
- if( !mgr )
- return;
-
- QFileDialog dlg( this, tr("IMPORT_PREFERENCES"), ".", "*" );
- dlg.setObjectName( "" );
- //dlg.setShowHiddenFiles( true );
- dlg.exec();
+ QStringList filtersList;
+ filtersList.append(tr("XML_FILES_FILTER"));
+ QString anInitialPath = "";
+ if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+ anInitialPath = QDir::currentPath();
- QStringList files = dlg.selectedFiles();
- if ( files.isEmpty() )
- return;
+ QString aName = SUIT_FileDlg::getFileName( this, anInitialPath, filtersList, tr("IMPORT_PREFERENCES"), true, true );
- QString fname = files[0];
- if( mgr->import( fname ) )
+ if( mgr->import( aName ) )
{
myPrefs->retrieve();
myPrefs->toBackup();
<source>IMPORT_PREFERENCES</source>
<translation>Import preferences</translation>
</message>
+ <message>
+ <source>XML_FILES_FILTER</source>
+ <translation>XML Files (*.xml)</translation>
+ </message>
<message>
<source>CAPTION</source>
<translation>Preferences</translation>
<source>IMPORT_PREFERENCES</source>
<translation>Importer les préférences</translation>
</message>
+ <message>
+ <source>XML_FILES_FILTER</source>
+ <translation type="unfinished">XML Files (*.xml)</translation>
+ </message>
<message>
<source>CAPTION</source>
<translation>Préférences</translation>