Commit d8c13e00d38c5f60052339f31c44b199445efb5f

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

Workin on settings dialogs.

src/dialogs/settings/dialog.c
... ... @@ -276,4 +276,26 @@ void v3270_settings_popup_dialog(GtkWidget *widget, GtkWidget *terminal, gboolea
276 276  
277 277 }
278 278  
  279 +GtkWidget * v3270_settings_get_edit_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal) {
  280 +
  281 + const gchar * title = GTK_V3270_SETTINGS(settings)->title;
  282 +
  283 + GtkWidget * dialog = v3270_settings_dialog_new();
  284 +
  285 + if(title)
  286 + gtk_window_set_title(GTK_WINDOW(dialog), title);
  287 +
  288 + gtk_container_add(GTK_CONTAINER(dialog), settings);
  289 +
  290 + gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(terminal)));
  291 + gtk_window_set_modal(GTK_WINDOW(dialog),modal);
  292 +
  293 + v3270_settings_dialog_set_terminal_widget(dialog, terminal);
  294 +
  295 + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL);
  296 + g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),settings);
  297 +
  298 + return dialog;
  299 +
  300 + }
279 301  
... ...
src/include/v3270/settings.h
... ... @@ -73,6 +73,9 @@
73 73 /// @brief Popup a settings dialog for the terminal.
74 74 LIB3270_EXPORT void v3270_settings_popup_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal);
75 75  
  76 + /// @brief Get an edit dialog for the settings widget.
  77 + LIB3270_EXPORT GtkWidget * v3270_settings_get_edit_dialog(GtkWidget *settings, GtkWidget *terminal, gboolean modal);
  78 +
76 79 /*--[ V3270 Settings Dialog ]------------------------------------------------------------------------*/
77 80  
78 81 #define GTK_TYPE_V3270_SETTINGS_DIALOG (V3270SettingsDialog_get_type())
... ...