Commit aea69823ed63f7a41e2df1d39e28208bc51b158a

Authored by Perry Werneck
1 parent b8ab9147
Exists in master and in 1 other branch develop

Fixing build warnings.

src/dialogs/commondialog.c
@@ -50,7 +50,7 @@ static GtkWidget * create_button(GtkWidget *dialog, const gchar *mnemonic, GCall @@ -50,7 +50,7 @@ static GtkWidget * create_button(GtkWidget *dialog, const gchar *mnemonic, GCall
50 return button; 50 return button;
51 } 51 }
52 52
53 -LIB3270_EXPORT GtkWidget * v3270_dialog_new(const gchar *title, GtkWindow *parent, const gchar *apply) 53 +LIB3270_EXPORT GtkWidget * v3270_dialog_new(GtkWidget *widget, const gchar *title, const gchar *apply)
54 { 54 {
55 gboolean use_header; 55 gboolean use_header;
56 g_object_get(gtk_settings_get_default(), "gtk-dialogs-use-header", &use_header, NULL); 56 g_object_get(gtk_settings_get_default(), "gtk-dialogs-use-header", &use_header, NULL);
@@ -67,9 +67,9 @@ LIB3270_EXPORT GtkWidget * v3270_dialog_new(const gchar *title, GtkWindow *paren @@ -67,9 +67,9 @@ LIB3270_EXPORT GtkWidget * v3270_dialog_new(const gchar *title, GtkWindow *paren
67 // https://developer.gnome.org/hig/stable/visual-layout.html.en 67 // https://developer.gnome.org/hig/stable/visual-layout.html.en
68 gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),18); 68 gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),18);
69 69
70 - if(parent) 70 + if(widget)
71 { 71 {
72 - gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(gtk_widget_get_toplevel(parent))); 72 + gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(gtk_widget_get_toplevel(widget)));
73 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); 73 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
74 gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); 74 gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
75 } 75 }
src/dialogs/hostselect.c
@@ -311,7 +311,7 @@ LIB3270_EXPORT void v3270_select_host(GtkWidget *widget) @@ -311,7 +311,7 @@ LIB3270_EXPORT void v3270_select_host(GtkWidget *widget)
311 } 311 }
312 312
313 GtkWidget * dialog = v3270_host_select_new(widget); 313 GtkWidget * dialog = v3270_host_select_new(widget);
314 - GtkWidget * win = v3270_dialog_new(_("Configure host"), GTK_WINDOW(gtk_widget_get_toplevel(widget)), _("C_onnect")); 314 + GtkWidget * win = v3270_dialog_new(widget, _("Configure host"), _("C_onnect"));
315 315
316 gtk_window_set_default_size(GTK_WINDOW(win), 700, 150); 316 gtk_window_set_default_size(GTK_WINDOW(win), 700, 150);
317 317
src/dialogs/tools.c
@@ -70,5 +70,17 @@ @@ -70,5 +70,17 @@
70 return child; 70 return child;
71 } 71 }
72 72
  73 + GtkWidget * v3270_box_pack_start(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding)
  74 + {
  75 + gtk_box_pack_start(GTK_BOX(box),child,expand,fill,padding);
  76 + return child;
  77 + }
  78 +
  79 + GtkWidget * v3270_box_pack_end(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding)
  80 + {
  81 + gtk_box_pack_end(GTK_BOX(box),child,expand,fill,padding);
  82 + return child;
  83 + }
  84 +
73 85
74 86
src/include/internals.h
@@ -52,18 +52,8 @@ @@ -52,18 +52,8 @@
52 52
53 G_BEGIN_DECLS 53 G_BEGIN_DECLS
54 54
55 - inline GtkWidget * v3270_box_pack_start(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding)  
56 - {  
57 - gtk_box_pack_start(GTK_BOX(box),child,expand,fill,padding);  
58 - return child;  
59 - }  
60 -  
61 - inline GtkWidget * v3270_box_pack_end(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding)  
62 - {  
63 - gtk_box_pack_end(GTK_BOX(box),child,expand,fill,padding);  
64 - return child;  
65 - }  
66 - 55 + G_GNUC_INTERNAL GtkWidget * v3270_box_pack_start(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding);
  56 + G_GNUC_INTERNAL GtkWidget * v3270_box_pack_end(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding);
67 G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); 57 G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding);
68 G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); 58 G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding);
69 G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_grid(GtkAlign align); 59 G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_grid(GtkAlign align);
src/include/v3270.h
@@ -289,7 +289,7 @@ @@ -289,7 +289,7 @@
289 289
290 LIB3270_EXPORT int v3270_exec_command(GtkWidget *widget, const gchar *cmdline); 290 LIB3270_EXPORT int v3270_exec_command(GtkWidget *widget, const gchar *cmdline);
291 291
292 - LIB3270_EXPORT GtkWidget * v3270_dialog_new(const gchar *title, GtkWindow *parent, const gchar *apply); 292 + LIB3270_EXPORT GtkWidget * v3270_dialog_new(GtkWidget *widget, const gchar *title, const gchar *apply);
293 293
294 G_END_DECLS 294 G_END_DECLS
295 295
src/testprogram/testprogram.c
@@ -158,8 +158,7 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) @@ -158,8 +158,7 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
158 158
159 static void color_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) 159 static void color_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
160 { 160 {
161 - GtkWidget * dialog = v3270_dialog_new(_("Color setup"), NULL, _("_Save"));  
162 - 161 + GtkWidget * dialog = v3270_dialog_new(terminal, _("Color setup"), _("_Save"));
163 GtkWidget * colors = v3270_color_selection_new(terminal); 162 GtkWidget * colors = v3270_color_selection_new(terminal);
164 163
165 gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),colors,TRUE,TRUE,2); 164 gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),colors,TRUE,TRUE,2);