From 14a7b0642046b8c91f8de96a0456dfc9c3cc0482 Mon Sep 17 00:00:00 2001 From: Alberto Fanjul Date: Tue, 2 Apr 2024 22:52:40 +0200 Subject: [PATCH] fix details on dialog building --- gitg/commit/gitg-commit-dialog.vala | 2 +- gitg/gitg-author-details-dialog.vala | 2 +- gitg/gitg-window.vala | 8 +++----- libgitg/gitg-repository-list-box.vala | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gitg/commit/gitg-commit-dialog.vala b/gitg/commit/gitg-commit-dialog.vala index f5f12f42..ce020a94 100644 --- a/gitg/commit/gitg-commit-dialog.vala +++ b/gitg/commit/gitg-commit-dialog.vala @@ -942,7 +942,7 @@ class Dialog : Gtk.Dialog try { file.delete_async.end (res); } catch (Error e) { - warning ("Error deleting %S file: %s", PREPARE_COMMIT_MSG_FILENAME, e.message); + warning ("Error deleting %s file: %s", PREPARE_COMMIT_MSG_FILENAME, e.message); } }); } diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala index 76df26cd..2756e71d 100644 --- a/gitg/gitg-window.vala +++ b/gitg/gitg-window.vala @@ -1146,14 +1146,12 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable public void user_query(GitgExt.UserQuery query) { - var dlg = new Gtk.MessageDialog(this, + var dlg = new Gtk.MessageDialog.with_markup(this, Gtk.DialogFlags.MODAL, query.message_type, Gtk.ButtonsType.NONE, - ""); - - var primary = "%s".printf(Markup.escape_text(query.title)); - dlg.set_markup(primary); + "%s", + query.title); dlg.format_secondary_text("%s", query.message); diff --git a/libgitg/gitg-repository-list-box.vala b/libgitg/gitg-repository-list-box.vala index 5f2e6de7..ab14df20 100644 --- a/libgitg/gitg-repository-list-box.vala +++ b/libgitg/gitg-repository-list-box.vala @@ -569,7 +569,7 @@ namespace Gitg { var alert_dialog = new Gtk.MessageDialog((Gtk.Window) row.get_toplevel(), Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.NONE, - _("Deleting repository source files ā€œ%sā€ will delete them from disk and cannot be undone. Are you sure?").printf(uri), null); + _("Deleting repository source files ā€œ%sā€ will delete them from disk and cannot be undone. Are you sure?"), uri); alert_dialog.add_button(_("Cancel"), DeleteSources.CANCEL); alert_dialog.add_button(_("Move to trash"), DeleteSources.TRASH); alert_dialog.add_button(_("Delete permanently"), DeleteSources.DELETE); -- GitLab