summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/notice.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-08 11:53:00 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-08 11:53:00 +0200
commitb623f5953691b2a0614e6f1f4def86bdbb9a4113 (patch)
tree18102bd36f7e22eb2ba2b9f880e4cb29346f4cb8 /app/wlib/gtklib/notice.c
parent359b557176b9bb2ff1aed2082641eed39c358d0d (diff)
New upstream version 5.2.0Beta2.1upstream/5.2.0Beta2.1
Diffstat (limited to 'app/wlib/gtklib/notice.c')
-rw-r--r--app/wlib/gtklib/notice.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/app/wlib/gtklib/notice.c b/app/wlib/gtklib/notice.c
index b72afd6..0134b4f 100644
--- a/app/wlib/gtklib/notice.c
+++ b/app/wlib/gtklib/notice.c
@@ -58,8 +58,13 @@ static void doNotice(
GtkWidget * widget,
long value)
{
- noticeValue = value;
- gtk_widget_destroy(noticeW.win);
+ if (value != 2) {
+ // event not from from closing the window but from a button press
+ // Close the Notice dialog
+ gtk_widget_destroy(noticeW.win);
+ // Remember the button
+ noticeValue = value;
+ }
wlibDoModal(NULL, FALSE);
}
@@ -106,6 +111,8 @@ int wNoticeEx(int type,
parent = GTK_WINDOW(gtkMainW->gtkwin);
}
+ wDestroySplash();
+
dialog = gtk_message_dialog_new(parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
flag,
@@ -113,6 +120,8 @@ int wNoticeEx(int type,
"%s", msg);
gtk_window_set_title(GTK_WINDOW(dialog), headline);
+ gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
+
res = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
@@ -174,6 +183,7 @@ int wNotice3(
char *can = NULL;
char *alt = NULL;
+ wDestroySplash();
nw->win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@@ -243,6 +253,9 @@ int wNotice3(
}
}
+ g_signal_connect(GTK_WINDOW(nw->win),
+ "destroy", G_CALLBACK(doNotice), (void*)2);
+
gtk_widget_grab_default(nw->butt[ 0 ]);
gtk_widget_grab_focus(nw->butt[ 0 ]);
@@ -253,6 +266,7 @@ int wNotice3(
/* gdk_window_set_group( nw->win->window, gtkMainW->gtkwin->window ); */
}
+ noticeValue = 0; // Default: Cancel
wlibDoModal(NULL, TRUE);
if (aff) {