mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 13:30:19 +00:00
Merge branch 'fix-file-dialog-title' into 'main'
filedialog: Use title if set Closes #5415 See merge request GNOME/gtk!5308
This commit is contained in:
commit
860c2f8ddd
@ -656,29 +656,34 @@ create_file_chooser (GtkFileDialog *self,
|
||||
{
|
||||
GtkFileChooserNative *chooser;
|
||||
const char *accept;
|
||||
const char *title;
|
||||
const char *default_title, *title;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GTK_FILE_CHOOSER_ACTION_OPEN:
|
||||
accept = _("_Open");
|
||||
title = select_multiple ? _("Pick Files") : _("Pick a File");
|
||||
default_title = select_multiple ? _("Pick Files") : _("Pick a File");
|
||||
break;
|
||||
|
||||
case GTK_FILE_CHOOSER_ACTION_SAVE:
|
||||
accept = _("_Save");
|
||||
title = _("Save a File");
|
||||
default_title = _("Save a File");
|
||||
break;
|
||||
|
||||
case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
|
||||
accept = _("_Select");
|
||||
title = select_multiple ? _("Select Folders") : _("Select a Folder");
|
||||
default_title = select_multiple ? _("Select Folders") : _("Select a Folder");
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
if (self->title)
|
||||
title = self->title;
|
||||
else
|
||||
title = default_title;
|
||||
|
||||
chooser = gtk_file_chooser_native_new (title, parent, action, accept, _("_Cancel"));
|
||||
gtk_file_chooser_native_set_use_portal (chooser, TRUE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user