Commit 76737a9e39a1f6408c869e403e7ef8c98d505675
1 parent
3aa05438
Exists in
master
and in
4 other branches
Updating settings dialogs.
Showing
2 changed files
with
25 additions
and
21 deletions
Show diff stats
src/objects/window/actions/setcolors.c
... | ... | @@ -50,11 +50,7 @@ |
50 | 50 | |
51 | 51 | GtkWidget * factory(GtkWidget *terminal) { |
52 | 52 | |
53 | - GtkWidget * dialog = v3270_settings_dialog_new(terminal, v3270_color_selection_new()); | |
54 | - v3270_dialog_setup(dialog,_("Color setup"),_("_Save")); | |
55 | - g_signal_connect(dialog,"response",G_CALLBACK(gtk_widget_destroy),NULL); | |
56 | - | |
57 | - return dialog; | |
53 | + return v3270_settings_get_edit_dialog(v3270_color_selection_new(),terminal,FALSE); | |
58 | 54 | |
59 | 55 | } |
60 | 56 | ... | ... |
src/objects/window/actions/sethost.c
... | ... | @@ -42,17 +42,24 @@ |
42 | 42 | action->parent.name = "set.host"; |
43 | 43 | action->group.id = LIB3270_ACTION_GROUP_OFFLINE; |
44 | 44 | action->icon_name = "network-server"; |
45 | - action->label = N_("Configure host"); | |
45 | + action->label = N_("Host definition"); | |
46 | 46 | |
47 | 47 | return G_ACTION(action); |
48 | 48 | } |
49 | 49 | |
50 | - static void on_response(GtkDialog *dialog, gint response_id, GtkWidget *settings) { | |
51 | - | |
52 | - v3270_settings_on_dialog_response(dialog,response_id,settings); | |
50 | + static void on_response(GtkWidget *dialog, gint response_id, GtkWidget *settings) { | |
53 | 51 | |
54 | 52 | if(response_id == GTK_RESPONSE_APPLY) { |
55 | - v3270_reconnect(v3270_settings_get_terminal_widget(settings)); | |
53 | + | |
54 | + GtkWidget * terminal = v3270_settings_get_terminal_widget(settings); | |
55 | + | |
56 | + v3270_settings_dialog_apply(dialog); | |
57 | + if(terminal) | |
58 | + lib3270_reconnect(v3270_get_session(terminal),0); | |
59 | + | |
60 | + } else { | |
61 | + | |
62 | + v3270_settings_dialog_revert(dialog); | |
56 | 63 | } |
57 | 64 | |
58 | 65 | gtk_widget_destroy(GTK_WIDGET(dialog)); |
... | ... | @@ -61,20 +68,21 @@ |
61 | 68 | |
62 | 69 | GtkWidget * factory(GtkWidget *terminal) { |
63 | 70 | |
64 | - GtkWidget * settings = v3270_host_select_new(); | |
65 | - GtkWidget * dialog = | |
66 | - v3270_settings_dialog_new( | |
67 | - terminal, | |
68 | - settings | |
69 | - ); | |
71 | + GtkWidget * dialog = v3270_settings_dialog_new(); | |
72 | + V3270Settings * settings = GTK_V3270_SETTINGS(v3270_host_select_new()); | |
70 | 73 | |
71 | - if(dialog) { | |
74 | + if(settings->title) | |
75 | + gtk_window_set_title(GTK_WINDOW(dialog), settings->title); | |
72 | 76 | |
73 | - v3270_dialog_setup(dialog,_("Setup host"),_("C_onnect")); | |
74 | - gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); | |
75 | - g_signal_connect(dialog,"response",G_CALLBACK(on_response),settings); | |
77 | + gtk_container_add(GTK_CONTAINER(dialog), GTK_WIDGET(settings)); | |
76 | 78 | |
77 | - } | |
79 | + gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(terminal))); | |
80 | + gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); | |
81 | + | |
82 | + v3270_settings_dialog_set_terminal_widget(dialog, terminal); | |
83 | + | |
84 | + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | |
85 | + g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),settings); | |
78 | 86 | |
79 | 87 | return dialog; |
80 | 88 | ... | ... |