Commit 904ef2b0374091e5a6a9170494ddd117c550b71f
1 parent
e124aa4d
Exists in
master
and in
4 other branches
Moving dialog action to terminal library.
Showing
7 changed files
with
28 additions
and
28 deletions
Show diff stats
src/include/pw3270/actions.h
| @@ -180,6 +180,7 @@ | @@ -180,6 +180,7 @@ | ||
| 180 | /// @brief Update simple action from LIB3270's property description. | 180 | /// @brief Update simple action from LIB3270's property description. |
| 181 | void pw3270_simple_action_set_lib3270_property(pw3270SimpleAction *action, const LIB3270_PROPERTY * property); | 181 | void pw3270_simple_action_set_lib3270_property(pw3270SimpleAction *action, const LIB3270_PROPERTY * property); |
| 182 | 182 | ||
| 183 | + /* | ||
| 183 | // | 184 | // |
| 184 | // Dialog action | 185 | // Dialog action |
| 185 | // | 186 | // |
| @@ -194,6 +195,7 @@ | @@ -194,6 +195,7 @@ | ||
| 194 | typedef struct _pw3270DialogActionClass pw3270DialogActionClass; | 195 | typedef struct _pw3270DialogActionClass pw3270DialogActionClass; |
| 195 | 196 | ||
| 196 | pw3270SimpleAction * pw3270_dialog_action_new(GtkWidget * (*factory)(pw3270SimpleAction *action, GtkWidget *)); | 197 | pw3270SimpleAction * pw3270_dialog_action_new(GtkWidget * (*factory)(pw3270SimpleAction *action, GtkWidget *)); |
| 198 | + */ | ||
| 197 | 199 | ||
| 198 | // | 200 | // |
| 199 | // V3270 Property Action | 201 | // V3270 Property Action |
src/objects/actions/dialog.c
| @@ -32,6 +32,7 @@ | @@ -32,6 +32,7 @@ | ||
| 32 | * | 32 | * |
| 33 | */ | 33 | */ |
| 34 | 34 | ||
| 35 | + /* | ||
| 35 | #include "private.h" | 36 | #include "private.h" |
| 36 | #include <v3270.h> | 37 | #include <v3270.h> |
| 37 | #include <v3270/settings.h> | 38 | #include <v3270/settings.h> |
| @@ -122,3 +123,4 @@ | @@ -122,3 +123,4 @@ | ||
| 122 | 123 | ||
| 123 | } | 124 | } |
| 124 | 125 | ||
| 126 | +*/ |
src/objects/actions/save.c
| @@ -38,14 +38,14 @@ | @@ -38,14 +38,14 @@ | ||
| 38 | #include <pw3270/application.h> | 38 | #include <pw3270/application.h> |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | - static GtkWidget * factory(pw3270SimpleAction *action, GtkWidget *terminal); | 41 | + static GtkWidget * factory(V3270SimpleAction *action, GtkWidget *terminal); |
| 42 | static void response(GtkWidget *dialog, gint response_id, GtkWidget *terminal); | 42 | static void response(GtkWidget *dialog, gint response_id, GtkWidget *terminal); |
| 43 | 43 | ||
| 44 | GAction * pw3270_action_save_session_as_new(void) { | 44 | GAction * pw3270_action_save_session_as_new(void) { |
| 45 | 45 | ||
| 46 | - pw3270SimpleAction * action = pw3270_dialog_action_new(factory); | 46 | + V3270SimpleAction * action = v3270_dialog_action_new(factory); |
| 47 | 47 | ||
| 48 | - action->parent.name = "save.session.as"; | 48 | + action->name = "save.session.as"; |
| 49 | action->label = _("Save As"); | 49 | action->label = _("Save As"); |
| 50 | action->icon_name = "document-save-as"; | 50 | action->icon_name = "document-save-as"; |
| 51 | action->tooltip = _("Save session properties"); | 51 | action->tooltip = _("Save session properties"); |
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | 54 | ||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | - GtkWidget * factory(pw3270SimpleAction *action, GtkWidget *terminal) { | 57 | + GtkWidget * factory(V3270SimpleAction *action, GtkWidget *terminal) { |
| 58 | 58 | ||
| 59 | GtkWidget * dialog = | 59 | GtkWidget * dialog = |
| 60 | gtk_file_chooser_dialog_new( | 60 | gtk_file_chooser_dialog_new( |
| @@ -75,9 +75,9 @@ | @@ -75,9 +75,9 @@ | ||
| 75 | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog),current_file); | 75 | gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog),current_file); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | - g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | ||
| 79 | g_signal_connect(dialog,"response",G_CALLBACK(response),terminal); | 78 | g_signal_connect(dialog,"response",G_CALLBACK(response),terminal); |
| 80 | 79 | ||
| 80 | + gtk_widget_show_all(dialog); | ||
| 81 | return dialog; | 81 | return dialog; |
| 82 | } | 82 | } |
| 83 | 83 |
src/objects/application/application.c
| @@ -291,7 +291,9 @@ | @@ -291,7 +291,9 @@ | ||
| 291 | 291 | ||
| 292 | if(application->plugins) { | 292 | if(application->plugins) { |
| 293 | #pragma GCC diagnostic push | 293 | #pragma GCC diagnostic push |
| 294 | +#ifdef _WIN32 | ||
| 294 | #pragma GCC diagnostic ignored "-Wcast-function-type" | 295 | #pragma GCC diagnostic ignored "-Wcast-function-type" |
| 296 | +#endif // _WIN32 | ||
| 295 | g_slist_free_full(application->plugins,(GDestroyNotify) g_module_close); | 297 | g_slist_free_full(application->plugins,(GDestroyNotify) g_module_close); |
| 296 | #pragma GCC diagnostic pop | 298 | #pragma GCC diagnostic pop |
| 297 | application->plugins = NULL; | 299 | application->plugins = NULL; |
src/objects/window/actions/hostproperties.c
| @@ -33,13 +33,13 @@ | @@ -33,13 +33,13 @@ | ||
| 33 | #include <v3270/settings.h> | 33 | #include <v3270/settings.h> |
| 34 | #include <v3270/dialogs.h> | 34 | #include <v3270/dialogs.h> |
| 35 | 35 | ||
| 36 | - static GtkWidget * factory(pw3270SimpleAction *action, GtkWidget *terminal); | 36 | + static GtkWidget * factory(V3270SimpleAction *action, GtkWidget *terminal); |
| 37 | 37 | ||
| 38 | GAction * pw3270_action_host_properties_new(void) { | 38 | GAction * pw3270_action_host_properties_new(void) { |
| 39 | 39 | ||
| 40 | - pw3270SimpleAction * action = pw3270_dialog_action_new(factory); | 40 | + V3270SimpleAction * action = v3270_dialog_action_new(factory); |
| 41 | 41 | ||
| 42 | - action->parent.name = "host.properties"; | 42 | + action->name = "host.properties"; |
| 43 | action->group.id = LIB3270_ACTION_GROUP_OFFLINE; | 43 | action->group.id = LIB3270_ACTION_GROUP_OFFLINE; |
| 44 | action->icon_name = "network-server"; | 44 | action->icon_name = "network-server"; |
| 45 | action->label = N_("Host properties"); | 45 | action->label = N_("Host properties"); |
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | return G_ACTION(action); | 47 | return G_ACTION(action); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | - GtkWidget * factory(pw3270SimpleAction G_GNUC_UNUSED(*action), GtkWidget *terminal) { | 50 | + GtkWidget * factory(V3270SimpleAction G_GNUC_UNUSED(*action), GtkWidget *terminal) { |
| 51 | 51 | ||
| 52 | GtkWidget * dialog = v3270_settings_dialog_new(); | 52 | GtkWidget * dialog = v3270_settings_dialog_new(); |
| 53 | V3270Settings * settings = GTK_V3270_SETTINGS(v3270_host_settings_new()); | 53 | V3270Settings * settings = GTK_V3270_SETTINGS(v3270_host_settings_new()); |
| @@ -62,9 +62,9 @@ | @@ -62,9 +62,9 @@ | ||
| 62 | 62 | ||
| 63 | v3270_settings_dialog_set_terminal_widget(dialog, terminal); | 63 | v3270_settings_dialog_set_terminal_widget(dialog, terminal); |
| 64 | 64 | ||
| 65 | - g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | ||
| 66 | g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),settings); | 65 | g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),settings); |
| 67 | 66 | ||
| 67 | + gtk_widget_show_all(dialog); | ||
| 68 | return dialog; | 68 | return dialog; |
| 69 | 69 | ||
| 70 | } | 70 | } |
src/objects/window/actions/sessionproperties.c
| @@ -34,22 +34,20 @@ | @@ -34,22 +34,20 @@ | ||
| 34 | #include <v3270/dialogs.h> | 34 | #include <v3270/dialogs.h> |
| 35 | #include <v3270/colorscheme.h> | 35 | #include <v3270/colorscheme.h> |
| 36 | 36 | ||
| 37 | - static GtkWidget * factory(pw3270SimpleAction *action, GtkWidget *terminal); | 37 | + static GtkWidget * factory(V3270SimpleAction *action, GtkWidget *terminal); |
| 38 | 38 | ||
| 39 | GAction * pw3270_action_session_properties_new(void) { | 39 | GAction * pw3270_action_session_properties_new(void) { |
| 40 | 40 | ||
| 41 | - pw3270SimpleAction * action = pw3270_dialog_action_new(factory); | 41 | + V3270SimpleAction * action = v3270_dialog_action_new(factory); |
| 42 | 42 | ||
| 43 | - action->parent.name = "session.properties"; | 43 | + action->name = "session.properties"; |
| 44 | action->icon_name = "preferences-other"; | 44 | action->icon_name = "preferences-other"; |
| 45 | action->label = _("Session properties"); | 45 | action->label = _("Session properties"); |
| 46 | 46 | ||
| 47 | return G_ACTION(action); | 47 | return G_ACTION(action); |
| 48 | - | ||
| 49 | - | ||
| 50 | } | 48 | } |
| 51 | 49 | ||
| 52 | - GtkWidget * factory(pw3270SimpleAction *action, GtkWidget *terminal) { | 50 | + GtkWidget * factory(V3270SimpleAction *action, GtkWidget *terminal) { |
| 53 | 51 | ||
| 54 | size_t ix; | 52 | size_t ix; |
| 55 | 53 | ||
| @@ -69,12 +67,6 @@ | @@ -69,12 +67,6 @@ | ||
| 69 | gtk_container_add(GTK_CONTAINER(dialog), elements[ix]); | 67 | gtk_container_add(GTK_CONTAINER(dialog), elements[ix]); |
| 70 | } | 68 | } |
| 71 | 69 | ||
| 72 | - /* | ||
| 73 | - gtk_container_add(GTK_CONTAINER(dialog), v3270_host_select_new()); | ||
| 74 | - gtk_container_add(GTK_CONTAINER(dialog), v3270_color_selection_new()); | ||
| 75 | - gtk_container_add(GTK_CONTAINER(dialog), v3270_font_chooser_widget_new()); | ||
| 76 | - */ | ||
| 77 | - | ||
| 78 | // Setup dialog box | 70 | // Setup dialog box |
| 79 | gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(terminal))); | 71 | gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(terminal))); |
| 80 | gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); | 72 | gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); |
| @@ -84,6 +76,7 @@ | @@ -84,6 +76,7 @@ | ||
| 84 | g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | 76 | g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); |
| 85 | g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),terminal); | 77 | g_signal_connect(dialog,"response",G_CALLBACK(v3270_setttings_dialog_response),terminal); |
| 86 | 78 | ||
| 79 | + gtk_widget_show_all(dialog); | ||
| 87 | return dialog; | 80 | return dialog; |
| 88 | 81 | ||
| 89 | } | 82 | } |
src/objects/window/actions/setcolors.c
| @@ -34,13 +34,13 @@ | @@ -34,13 +34,13 @@ | ||
| 34 | #include <v3270/dialogs.h> | 34 | #include <v3270/dialogs.h> |
| 35 | #include <v3270/colorscheme.h> | 35 | #include <v3270/colorscheme.h> |
| 36 | 36 | ||
| 37 | - static GtkWidget * factory(pw3270SimpleAction *action, GtkWidget *terminal); | 37 | + static GtkWidget * factory(V3270SimpleAction *action, GtkWidget *terminal); |
| 38 | 38 | ||
| 39 | GAction * pw3270_set_color_action_new(void) { | 39 | GAction * pw3270_set_color_action_new(void) { |
| 40 | 40 | ||
| 41 | - pw3270SimpleAction * action = pw3270_dialog_action_new(factory); | 41 | + V3270SimpleAction * action = v3270_dialog_action_new(factory); |
| 42 | 42 | ||
| 43 | - action->parent.name = "set.colors"; | 43 | + action->name = "set.colors"; |
| 44 | action->icon_name = "gtk-select-color"; | 44 | action->icon_name = "gtk-select-color"; |
| 45 | action->label = _("Colors"); | 45 | action->label = _("Colors"); |
| 46 | action->tooltip = _("Change terminal colors"); | 46 | action->tooltip = _("Change terminal colors"); |
| @@ -49,9 +49,10 @@ | @@ -49,9 +49,10 @@ | ||
| 49 | 49 | ||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | - GtkWidget * factory(pw3270SimpleAction G_GNUC_UNUSED(*action), GtkWidget *terminal) { | ||
| 53 | - | ||
| 54 | - return v3270_settings_get_edit_dialog(v3270_color_settings_new(),terminal,FALSE); | 52 | + GtkWidget * factory(V3270SimpleAction G_GNUC_UNUSED(*action), GtkWidget *terminal) { |
| 55 | 53 | ||
| 54 | + GtkWidget *dialog = v3270_settings_get_edit_dialog(v3270_color_settings_new(),terminal,FALSE); | ||
| 55 | + gtk_widget_show_all(dialog); | ||
| 56 | + return dialog; | ||
| 56 | } | 57 | } |
| 57 | 58 |