This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository e16-keyedit.

View the commit online.

commit 0507ae2053cc3d301bbca67f29c75d858778752f
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Fri Dec 8 13:24:35 2023 +0100

    Move error message display to separate function
---
 viewer.c | 48 +++++++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/viewer.c b/viewer.c
index 82c4cfe..9854d96 100644
--- a/viewer.c
+++ b/viewer.c
@@ -1177,6 +1177,29 @@ load_actions(void)
     action_count = nao;
 }
 
+static void
+show_msg_win(const char *txt)
+{
+    GtkWidget      *win, *frame, *vbox, *label, *button;
+
+    win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
+    frame = gtk_frame_new(NULL);
+    gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
+    vbox = gtk_vbox_new(FALSE, 5);
+    button = gtk_button_new_with_label("Quit");
+    g_signal_connect(G_OBJECT(button), "clicked",
+                     G_CALLBACK(on_exit_application), NULL);
+    label = gtk_label_new(txt);
+    gtk_container_add(GTK_CONTAINER(win), frame);
+    gtk_container_add(GTK_CONTAINER(frame), vbox);
+    gtk_container_set_border_width(GTK_CONTAINER(vbox), 16);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
+    gtk_widget_show_all(win);
+    gtk_main();
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -1188,27 +1211,10 @@ main(int argc, char *argv[])
 
     if (CommsInit(receive_ipc_msg))
     {
-        GtkWidget      *win, *frame, *vbox, *label, *button;
-
-        win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-        gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
-        frame = gtk_frame_new(NULL);
-        gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
-        vbox = gtk_vbox_new(FALSE, 5);
-        button = gtk_button_new_with_label("Quit");
-        g_signal_connect(G_OBJECT(button), "clicked",
-                         G_CALLBACK(on_exit_application), NULL);
-        label = gtk_label_new("You are not running Enlightenment\n"
-                              "\n"
-                              "This window manager has to be running in order\n"
-                              "to configure it.\n" "\n");
-        gtk_container_add(GTK_CONTAINER(win), frame);
-        gtk_container_add(GTK_CONTAINER(frame), vbox);
-        gtk_container_set_border_width(GTK_CONTAINER(vbox), 16);
-        gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-        gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
-        gtk_widget_show_all(win);
-        gtk_main();
+        show_msg_win("You are not running e16\n"
+                     "\n"
+                     "This window manager has to be running in order\n"
+                     "to configure it.\n" "\n");
         exit(1);
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to