Commit c39a1af9d375b290ed7b810bdac7c1d468d4689d

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

Fixing settings dialog.

src/dialogs/settings/dialog.c
@@ -53,6 +53,9 @@ static void add(GtkContainer *container, GtkWidget *widget) @@ -53,6 +53,9 @@ static void add(GtkContainer *container, GtkWidget *widget)
53 53
54 debug("Added settings dialog %p",widget); 54 debug("Added settings dialog %p",widget);
55 55
  56 + // https://developer.gnome.org/hig/stable/visual-layout.html.en
  57 + gtk_container_set_border_width(GTK_CONTAINER(widget),18);
  58 +
56 GtkWidget * label = NULL; 59 GtkWidget * label = NULL;
57 if(GTK_V3270_SETTINGS(widget)->label) 60 if(GTK_V3270_SETTINGS(widget)->label)
58 { 61 {
@@ -158,8 +161,8 @@ static void V3270SettingsDialog_init(V3270SettingsDialog *dialog) @@ -158,8 +161,8 @@ static void V3270SettingsDialog_init(V3270SettingsDialog *dialog)
158 GtkWidget * content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); 161 GtkWidget * content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
159 162
160 // https://developer.gnome.org/hig/stable/visual-layout.html.en 163 // https://developer.gnome.org/hig/stable/visual-layout.html.en
161 - gtk_box_set_spacing(GTK_BOX(content_area),18);  
162 - gtk_container_set_border_width(GTK_CONTAINER(content_area),18); 164 + //gtk_box_set_spacing(GTK_BOX(content_area),18);
  165 + //gtk_container_set_border_width(GTK_CONTAINER(content_area),18);
163 166
164 gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE); 167 gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE);
165 gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); 168 gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
@@ -245,7 +248,7 @@ void v3270_setttings_dialog_response(GtkDialog *dialog, gint response_id, GtkWid @@ -245,7 +248,7 @@ void v3270_setttings_dialog_response(GtkDialog *dialog, gint response_id, GtkWid
245 g_warning("Unexpected settings dialog response \"%d\"",response_id); 248 g_warning("Unexpected settings dialog response \"%d\"",response_id);
246 } 249 }
247 250
248 - gtk_widget_destroy(dialog); 251 + gtk_widget_destroy(GTK_WIDGET(dialog));
249 252
250 } 253 }
251 254
src/testprogram/toolbar.c
@@ -72,6 +72,26 @@ @@ -72,6 +72,26 @@
72 72
73 } 73 }
74 74
  75 + static void preferences_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
  76 + {
  77 + GtkWidget * dialog = v3270_settings_dialog_new();
  78 +
  79 + gtk_window_set_title(GTK_WINDOW(dialog),"Session properties");
  80 + gtk_container_add(GTK_CONTAINER(dialog), v3270_host_select_new());
  81 + gtk_container_add(GTK_CONTAINER(dialog), v3270_color_selection_new());
  82 + gtk_container_add(GTK_CONTAINER(dialog), v3270_font_chooser_widget_new());
  83 +
  84 + gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(terminal)));
  85 +
  86 + v3270_settings_dialog_set_terminal_widget(dialog, terminal);
  87 +
  88 + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL);
  89 + g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),NULL);
  90 +
  91 + gtk_widget_show_all(dialog);
  92 +
  93 + }
  94 +
75 static void connect_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) 95 static void connect_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
76 { 96 {
77 lib3270_reconnect(v3270_get_session(terminal),0); 97 lib3270_reconnect(v3270_get_session(terminal),0);
@@ -228,8 +248,6 @@ @@ -228,8 +248,6 @@
228 } buttons[] = { 248 } buttons[] = {
229 { "gtk-connect", G_CALLBACK(connect_clicked), "Connect to host" }, 249 { "gtk-connect", G_CALLBACK(connect_clicked), "Connect to host" },
230 { "gtk-disconnect", G_CALLBACK(disconnect_clicked), "Disconnect from host" }, 250 { "gtk-disconnect", G_CALLBACK(disconnect_clicked), "Disconnect from host" },
231 - { "gtk-select-color", G_CALLBACK(color_clicked), "Edit or change color scheme" },  
232 - { "network-server", G_CALLBACK(host_clicked), "Configure host" },  
233 { "gtk-print", G_CALLBACK(print_clicked), "Print screen contents" }, 251 { "gtk-print", G_CALLBACK(print_clicked), "Print screen contents" },
234 { "gtk-harddisk", G_CALLBACK(ft_clicked), "Open file transfer dialog" }, 252 { "gtk-harddisk", G_CALLBACK(ft_clicked), "Open file transfer dialog" },
235 { "gtk-copy", G_CALLBACK(copy_clicked), "Copy data" }, 253 { "gtk-copy", G_CALLBACK(copy_clicked), "Copy data" },
@@ -237,7 +255,12 @@ @@ -237,7 +255,12 @@
237 { "document-save", G_CALLBACK(save_all_clicked), "Save screen" }, 255 { "document-save", G_CALLBACK(save_all_clicked), "Save screen" },
238 { "document-open", G_CALLBACK(load_clicked), "Paste file" }, 256 { "document-open", G_CALLBACK(load_clicked), "Paste file" },
239 257
240 - { "preferences-desktop-font", G_CALLBACK(font_clicked), "Select font" }, 258 + { "applications-system", G_CALLBACK(preferences_clicked), "Session properties" },
  259 +
  260 +// { "network-server", G_CALLBACK(host_clicked), "Configure host" },
  261 +// { "preferences-desktop-font", G_CALLBACK(font_clicked), "Select font" },
  262 +// { "gtk-select-color", G_CALLBACK(color_clicked), "Edit or change color scheme" },
  263 +
241 264
242 { "zoom-in", G_CALLBACK(zoom_in_clicked), "Zoom in" }, 265 { "zoom-in", G_CALLBACK(zoom_in_clicked), "Zoom in" },
243 { "zoom-out", G_CALLBACK(zoom_out_clicked), "Zoom out" }, 266 { "zoom-out", G_CALLBACK(zoom_out_clicked), "Zoom out" },
@@ -99,9 +99,6 @@ @@ -99,9 +99,6 @@
99 <Unit filename="src/dialogs/security.c"> 99 <Unit filename="src/dialogs/security.c">
100 <Option compilerVar="CC" /> 100 <Option compilerVar="CC" />
101 </Unit> 101 </Unit>
102 - <Unit filename="src/dialogs/settings.c">  
103 - <Option compilerVar="CC" />  
104 - </Unit>  
105 <Unit filename="src/dialogs/settings/dialog.c"> 102 <Unit filename="src/dialogs/settings/dialog.c">
106 <Option compilerVar="CC" /> 103 <Option compilerVar="CC" />
107 </Unit> 104 </Unit>