[gtranslator: 1/5] tm-dialog: Make window an argument of constructor
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator: 1/5] tm-dialog: Make window an argument of constructor
- Date: Thu, 17 Mar 2022 06:55:01 +0000 (UTC)
commit f7267c6fcaaf4a968b1eb68bfce22e20103a753d
Author: Maximiliano Sandoval R <msandova gnome org>
Date: Wed Mar 16 09:30:59 2022 +0100
tm-dialog: Make window an argument of constructor
Type hint is not a thing in gtk 4 anymore.
src/gtr-window.c | 9 ++-------
src/translation-memory/gtr-translation-memory-dialog.c | 11 ++++++-----
src/translation-memory/gtr-translation-memory-dialog.h | 3 ++-
3 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 6be75f41..a0e757c9 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -821,19 +821,14 @@ gtr_window_show_tm_dialog (GtrWindow *window)
if (dlg == NULL)
{
- dlg = gtr_translation_memory_dialog_new (priv->translation_memory);
- gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (window));
+ dlg = gtr_translation_memory_dialog_new (GTK_WINDOW (window),
+ priv->translation_memory);
g_signal_connect (dlg, "destroy",
G_CALLBACK (gtk_widget_destroyed), &dlg);
gtk_widget_show_all (dlg);
}
- if (GTK_WINDOW (window) != gtk_window_get_transient_for (GTK_WINDOW (dlg)))
- {
- gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (window));
- }
-
gtk_window_present (GTK_WINDOW (dlg));
}
diff --git a/src/translation-memory/gtr-translation-memory-dialog.c
b/src/translation-memory/gtr-translation-memory-dialog.c
index 0e88e5d1..3e096953 100644
--- a/src/translation-memory/gtr-translation-memory-dialog.c
+++ b/src/translation-memory/gtr-translation-memory-dialog.c
@@ -371,20 +371,21 @@ gtr_translation_memory_dialog_init (GtrTranslationMemoryDialog *dlg)
}
GtkWidget *
-gtr_translation_memory_dialog_new (GtrTranslationMemory *translation_memory)
+gtr_translation_memory_dialog_new (GtkWindow *window,
+ GtrTranslationMemory *translation_memory)
{
GtrTranslationMemoryDialog *dlg;
GtrTranslationMemoryDialogPrivate *priv;
dlg = GTR_TRANSLATION_MEMORY_DIALOG (g_object_new (GTR_TYPE_TRANSLATION_MEMORY_DIALOG,
- "use-header-bar", TRUE, NULL));
+ "use-header-bar", TRUE,
+ "modal", TRUE,
+ "transient-for", window,
+ NULL));
priv = gtr_translation_memory_dialog_get_instance_private (dlg);
/* FIXME: use a property */
priv->translation_memory = translation_memory;
- gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_DIALOG);
- gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
-
return GTK_WIDGET (dlg);
}
diff --git a/src/translation-memory/gtr-translation-memory-dialog.h
b/src/translation-memory/gtr-translation-memory-dialog.h
index 059aaa27..c950db78 100644
--- a/src/translation-memory/gtr-translation-memory-dialog.h
+++ b/src/translation-memory/gtr-translation-memory-dialog.h
@@ -46,7 +46,8 @@ struct _GtrTranslationMemoryDialogClass
GType gtr_translation_memory_dialog_get_type (void) G_GNUC_CONST;
-GtkWidget *gtr_translation_memory_dialog_new (GtrTranslationMemory *translation_memory);
+GtkWidget *gtr_translation_memory_dialog_new (GtkWindow *window,
+ GtrTranslationMemory *translation_memory);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]