[ghex/gtk4-port: 73/91] Don't create a new prefs dialog if already shown.
- From: Logan Rathbone <larathbone src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ghex/gtk4-port: 73/91] Don't create a new prefs dialog if already shown.
- Date: Thu, 12 Aug 2021 23:35:12 +0000 (UTC)
commit 0dd48c48a3ebaed21989cb7537355d0d0edabccb
Author: Logan Rathbone <poprocks gmail com>
Date: Wed Feb 3 12:40:11 2021 -0500
Don't create a new prefs dialog if already shown.
src/ghex-application-window.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/ghex-application-window.c b/src/ghex-application-window.c
index 84fb83ed..3eba2729 100644
--- a/src/ghex-application-window.c
+++ b/src/ghex-application-window.c
@@ -54,6 +54,7 @@ struct _GHexApplicationWindow
GtkWidget *jump_dialog;
GtkWidget *chartable;
GtkWidget *converter;
+ GtkWidget *prefs_dialog;
GtkWidget *paste_special_dialog;
GtkWidget *copy_special_dialog;
@@ -1283,7 +1284,6 @@ open_about (GtkWidget *widget,
GVariant *parameter)
{
GHexApplicationWindow *self = GHEX_APPLICATION_WINDOW(widget);
- GtkWidget *prefs_dialog;
(void)parameter, (void)action_name; /* unused */
@@ -1296,12 +1296,13 @@ open_preferences (GtkWidget *widget,
GVariant *parameter)
{
GHexApplicationWindow *self = GHEX_APPLICATION_WINDOW(widget);
- GtkWidget *prefs_dialog;
(void)parameter, (void)action_name; /* unused */
- prefs_dialog = create_preferences_dialog (GTK_WINDOW(self));
- gtk_widget_show (prefs_dialog);
+ if (! GTK_IS_WIDGET (self->prefs_dialog)) {
+ self->prefs_dialog = create_preferences_dialog (GTK_WINDOW(self));
+ }
+ gtk_widget_show (self->prefs_dialog);
}
/* --- */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]