Closed duganchen closed 8 years ago
ZDL includes filename filters for the file-open dialogs. For ZDL's "add a WAD" dialog, the filtering options are:
WAD/PK3/ZIP/PK7/PKZ/P7Z (*.wad *.pk3 *.zip *.pk7 *.pkz *.p7z) WAD Files (*.wad) PK3 Files (*.pk3) Patch Files (*bex *.deh) PK7 Files (*.pk7) PKZ File (*.pkz) P7Z Files (*.p7z)
As RocketLauncher 2 is using QFileDialog.getOpenFileName, this is easily implemented by changing
QFileDialog::getOpenFileName(this,tr("Add a pwad")
to
const QString filters = "..."; QFileDialog::getOpenFileName(this,tr("Add a pwad","",filters)
Where the filter string is documented here:
http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileName
I've found, testing on Linux, that I can get a case-insensitive filter like this, but I haven't tested it on Windows yet and it also looks ugly in the UI:
const QString filters = "WAD Files (*.[Ww][Aa]][Dd])";
Anyway, implementing this would actually make RocketLauncher 2 much more usable and friendly to me.
Good idea, also since you seem familiar with the code feel free to send a pull request. Otherwise, I'll update it when I get time.
ZDL includes filename filters for the file-open dialogs. For ZDL's "add a WAD" dialog, the filtering options are:
As RocketLauncher 2 is using QFileDialog.getOpenFileName, this is easily implemented by changing
to
Where the filter string is documented here:
http://doc.qt.io/qt-5/qfiledialog.html#getOpenFileName
I've found, testing on Linux, that I can get a case-insensitive filter like this, but I haven't tested it on Windows yet and it also looks ugly in the UI:
Anyway, implementing this would actually make RocketLauncher 2 much more usable and friendly to me.