Fix up file filters for filename fields of device configs for consistency
- Filter descriptions are now translatable - Extensions get uppercase and lowercase variations on *nix - Add "All files" option
This commit is contained in:
@@ -92,6 +92,29 @@ DlgFilter(std::initializer_list<QString> extensions, bool last)
|
||||
return " (" % temp.join(' ') % ")" % (!last ? ";;" : "");
|
||||
}
|
||||
|
||||
QString
|
||||
DlgFilter(QStringList extensions, bool last)
|
||||
{
|
||||
QStringList temp;
|
||||
|
||||
for (auto ext : extensions) {
|
||||
#ifdef Q_OS_UNIX
|
||||
if (ext == "*") {
|
||||
temp.append("*");
|
||||
continue;
|
||||
}
|
||||
temp.append("*." % ext.toUpper());
|
||||
#endif
|
||||
temp.append("*." % ext);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
temp.removeDuplicates();
|
||||
#endif
|
||||
return " (" % temp.join(' ') % ")" % (!last ? ";;" : "");
|
||||
}
|
||||
|
||||
|
||||
QString currentUuid()
|
||||
{
|
||||
auto configPath = QFileInfo(cfg_path).dir().canonicalPath();
|
||||
|
||||
Reference in New Issue
Block a user