Fixed: Allow to select PNG and TGA for bitmaps

--HG--
branch : develop
This commit is contained in:
kervala 2016-01-06 12:31:53 +01:00
parent 2923fe7c89
commit af14cbe3aa

View file

@ -210,7 +210,7 @@ void CTile_browser_dlg::on_actionAddTile_triggered(bool checked)
{ {
QFileDialog::Options options; QFileDialog::Options options;
QString selectedFilter; QString selectedFilter;
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options); QStringList fileNames = QFileDialog::getOpenFileNames(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "All supported files (*.png;*.tga);;PNG Bitmap (*.png);;Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
qSort(fileNames.begin(), fileNames.end()); qSort(fileNames.begin(), fileNames.end());
@ -284,7 +284,7 @@ void CTile_browser_dlg::on_actionReplaceImage_triggered(bool checked)
{ {
QFileDialog::Options options; QFileDialog::Options options;
QString selectedFilter; QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options); QString fileName = QFileDialog::getOpenFileName(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "All supported files (*.png;*.tga);;PNG Bitmap (*.png);;Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
@ -396,7 +396,7 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked()
{ {
QFileDialog::Options options; QFileDialog::Options options;
QString selectedFilter; QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , tr("Targa Bitmap (*.tga);;PNG Image (*.png);;All Files (*.*);;"), &selectedFilter, options); QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , tr("All supported files (*.png;*.tga);;PNG Bitmap (*.png);;Targa Bitmap (*.tga);;All Files (*.*);;"), &selectedFilter, options);
QFileInfo fi(fileName); QFileInfo fi(fileName);
QString baseName = fi.baseName() ; QString baseName = fi.baseName() ;
@ -497,7 +497,7 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked()
// Select a file // Select a file
QFileDialog::Options options; QFileDialog::Options options;
QString selectedFilter; QString selectedFilter;
QString fileName = QFileDialog::getSaveFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options); QString fileName = QFileDialog::getSaveFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , "All supported files (*.png;*.tga);;PNG Bitmap (*.png);;Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {
@ -568,7 +568,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked()
{ {
QFileDialog::Options options; QFileDialog::Options options;
QString selectedFilter; QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options); QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , "All supported files (*.png;*.tga);;PNG Bitmap (*.png);;Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
if (!fileName.isEmpty()) if (!fileName.isEmpty())
{ {