File dialog improvements

- Add a globally-accessible function to handle the parsing of filter extensions
- Remove the ability of putting the wildcard ('*') among other patterns; it's either a list of patterns or a single '*' now
- Add a hint to select between portals and Zenity on Unix
This commit is contained in:
Semphris
2024-04-02 16:03:58 -04:00
committed by Sam Lantinga
parent 5fa87e29e7
commit 6ad390fc50
18 changed files with 501 additions and 125 deletions

View File

@@ -19,7 +19,7 @@
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_internal.h"
#include "./SDL_dialog.h"
#include "../SDL_dialog_utils.h"
#include "../../core/linux/SDL_dbus.h"
@@ -270,6 +270,14 @@ static void DBus_OpenDialog(const char *method, const char *method_title, SDL_Di
static char *default_parent_window = "";
SDL_PropertiesID props = SDL_GetWindowProperties(window);
const char *err_msg = validate_filters(filters);
if (err_msg) {
SDL_SetError("%s", err_msg);
callback(userdata, NULL, -1);
return;
}
if (dbus == NULL) {
SDL_SetError("Failed to connect to DBus");
return;