mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user