[gtranslator: 8/9] Make all message dialogs modal
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator: 8/9] Make all message dialogs modal
- Date: Fri, 18 Mar 2022 09:37:22 +0000 (UTC)
commit 56e0b86d5f5ee0139f5ba25ddf106ac0f5e4fd6d
Author: Maximiliano Sandoval R <msandova gnome org>
Date: Sun Mar 6 21:13:35 2022 +0100
Make all message dialogs modal
Also specify the root window in alternate-language-panel.c.
src/codeview/gtr-viewer.c | 3 ++-
src/gtr-actions-file.c | 19 +++++++++++++------
2 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/codeview/gtr-viewer.c b/src/codeview/gtr-viewer.c
index 203f3c47..72b46b8d 100644
--- a/src/codeview/gtr-viewer.c
+++ b/src/codeview/gtr-viewer.c
@@ -135,13 +135,14 @@ error_dialog (GtkWindow *parent, const gchar *msg, ...)
va_list ap;
gchar *tmp;
GtkWidget *dialog;
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
va_start (ap, msg);
tmp = g_strdup_vprintf (msg, ap);
va_end (ap);
dialog = gtk_message_dialog_new (parent,
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ flags,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, "%s", tmp);
g_free (tmp);
diff --git a/src/gtr-actions-file.c b/src/gtr-actions-file.c
index 851186e6..1e9a8fe5 100644
--- a/src/gtr-actions-file.c
+++ b/src/gtr-actions-file.c
@@ -201,13 +201,15 @@ gtr_want_to_save_current_dialog (GtrWindow * window)
g_autofree gchar *filename = NULL;
g_autofree gchar *markup = NULL;
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
+
tab = gtr_window_get_active_tab (window);
po = gtr_tab_get_po (tab);
location = gtr_po_get_location (po);
filename = g_file_get_path (location);
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ flags,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE, NULL);
@@ -303,8 +305,9 @@ save_dialog_response_cb (GtkNativeDialog * dialog,
if (error)
{
GtkWidget *dialog;
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ flags,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
"%s", error->message);
@@ -566,8 +569,9 @@ gtr_save_current_file_dialog (GtkWidget * widget, GtrWindow * window)
if (error)
{
GtkWidget *dialog;
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ flags,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK, "%s", error->message);
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
@@ -655,11 +659,12 @@ load_file_list (GtrWindow * window, const GSList * locations)
if (error != NULL)
{
GtkWidget *dialog;
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
/*
* We have to show the error in a dialog
*/
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ flags,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", error->message);
@@ -725,8 +730,9 @@ save_and_close_all_documents (GList * unsaved_documents, GtrWindow * window)
if (error)
{
GtkWidget *dialog;
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ flags,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
"%s", error->message);
@@ -950,9 +956,10 @@ _gtr_actions_file_save_all (GtrWindow * window)
if (error)
{
GtkWidget *dialog;
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
+ flags,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
"%s", error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]