Commit d66293c271afb19846b59abbd09aad0c184c2a83
1 parent
05d9253b
Exists in
master
and in
4 other branches
Cleaning up.
Showing
4 changed files
with
0 additions
and
165 deletions
Show diff stats
src/objects/application/actions/about.c
| ... | ... | @@ -58,14 +58,6 @@ |
| 58 | 58 | |
| 59 | 59 | GtkAboutDialog * dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new()); |
| 60 | 60 | |
| 61 | - // Associate with the window | |
| 62 | - { | |
| 63 | - GtkWindow * window = gtk_application_get_active_window(GTK_APPLICATION(application)); | |
| 64 | - if(window) { | |
| 65 | - gtk_window_set_transient_for(GTK_WINDOW(dialog), window); | |
| 66 | - } | |
| 67 | - } | |
| 68 | - | |
| 69 | 61 | // Get application logo |
| 70 | 62 | { |
| 71 | 63 | lib3270_autoptr(char) logo = lib3270_build_data_filename(G_STRINGIFY(PRODUCT_NAME) "-logo.png",NULL); | ... | ... |
src/objects/application/actions/preferences.c
| ... | ... | @@ -66,154 +66,3 @@ |
| 66 | 66 | return G_ACTION(action); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - /* | |
| 70 | - typedef struct _Pw3270SettingsDialog { | |
| 71 | - GApplication * application; | |
| 72 | - GSimpleAction * action; | |
| 73 | - GtkDialog * dialog; | |
| 74 | - GtkNotebook * notebook; | |
| 75 | - GSList * pages; | |
| 76 | - } Pw3270SettingsDialog; | |
| 77 | - | |
| 78 | - static void on_destroy(GtkWidget G_GNUC_UNUSED(*dialog), Pw3270SettingsDialog *settings) { | |
| 79 | - settings->dialog = NULL; | |
| 80 | - g_slist_free_full(settings->pages,g_free); | |
| 81 | - g_free(settings); | |
| 82 | - g_simple_action_set_enabled(settings->action,TRUE); | |
| 83 | - } | |
| 84 | - | |
| 85 | - void on_response(GtkDialog *dialog, gint response_id, Pw3270SettingsDialog * settings) { | |
| 86 | - | |
| 87 | - if(response_id== GTK_RESPONSE_APPLY) { | |
| 88 | - | |
| 89 | - g_message("Aplying application settings"); | |
| 90 | - | |
| 91 | - GSList * page; | |
| 92 | - for(page = settings->pages;page;page = page->next) { | |
| 93 | - Pw3270SettingsPage * widget = (Pw3270SettingsPage *) page->data; | |
| 94 | - if(widget->apply) { | |
| 95 | - widget->apply(widget,GTK_APPLICATION(settings->application)); | |
| 96 | - } | |
| 97 | - } | |
| 98 | - | |
| 99 | - } | |
| 100 | - | |
| 101 | - gtk_widget_destroy(GTK_WIDGET(dialog)); | |
| 102 | - } | |
| 103 | - | |
| 104 | - static void on_page_added(GtkNotebook G_GNUC_UNUSED(*notebook), GtkWidget *widget, guint G_GNUC_UNUSED(page_num), Pw3270SettingsDialog G_GNUC_UNUSED(*settings)) { | |
| 105 | - | |
| 106 | - // https://developer.gnome.org/hig/stable/visual-layout.html.en | |
| 107 | - | |
| 108 | - if(GTK_IS_GRID(widget)) { | |
| 109 | - gtk_grid_set_row_spacing(GTK_GRID(widget),6); | |
| 110 | - gtk_grid_set_column_spacing(GTK_GRID(widget),12); | |
| 111 | - } | |
| 112 | - | |
| 113 | - if(GTK_IS_CONTAINER(widget)) { | |
| 114 | - gtk_container_set_border_width(GTK_CONTAINER(widget),18); | |
| 115 | - } | |
| 116 | - | |
| 117 | - } | |
| 118 | - | |
| 119 | - static void on_switch_page(GtkNotebook G_GNUC_UNUSED(*notebook), GtkWidget *widget, guint G_GNUC_UNUSED(page_num), Pw3270SettingsDialog * settings) | |
| 120 | - { | |
| 121 | - | |
| 122 | - debug("%s: %p",__FUNCTION__,settings->dialog); | |
| 123 | - | |
| 124 | - if(!settings->dialog) | |
| 125 | - return; | |
| 126 | - | |
| 127 | - GtkWidget * header_bar = gtk_dialog_get_header_bar(settings->dialog); | |
| 128 | - | |
| 129 | - if(header_bar) { | |
| 130 | - GSList * page; | |
| 131 | - for(page = settings->pages;page;page = page->next) { | |
| 132 | - Pw3270SettingsPage * pg = (Pw3270SettingsPage *) page->data; | |
| 133 | - if(pg->widget == widget) { | |
| 134 | - if(pg->title) | |
| 135 | - gtk_header_bar_set_subtitle(GTK_HEADER_BAR(header_bar),pg->title); | |
| 136 | - return; | |
| 137 | - } | |
| 138 | - } | |
| 139 | - } | |
| 140 | - | |
| 141 | - } | |
| 142 | - | |
| 143 | - void pw3270_application_settings_dialog_add_page(Pw3270SettingsDialog *settings, Pw3270SettingsPage *page) { | |
| 144 | - | |
| 145 | - settings->pages = g_slist_prepend(settings->pages,page); | |
| 146 | - | |
| 147 | - GtkWidget * label = NULL; | |
| 148 | - if(page->label) | |
| 149 | - label = gtk_label_new(page->label); | |
| 150 | - | |
| 151 | - gtk_notebook_append_page( | |
| 152 | - settings->notebook, | |
| 153 | - page->widget, | |
| 154 | - label | |
| 155 | - ); | |
| 156 | - | |
| 157 | - } | |
| 158 | - | |
| 159 | - void pw3270_application_preferences_activated(GSimpleAction *action, GVariant G_GNUC_UNUSED(*parameter), gpointer application) { | |
| 160 | - | |
| 161 | - size_t ix; | |
| 162 | - | |
| 163 | - debug("%s",__FUNCTION__); | |
| 164 | - | |
| 165 | - // Create dialog. | |
| 166 | - GtkWidget * dialog = pw3270_settings_dialog_new( | |
| 167 | - _("Application preferences"), | |
| 168 | - gtk_application_get_active_window(GTK_APPLICATION(application)) | |
| 169 | - ); | |
| 170 | - | |
| 171 | - // Create setttings data. | |
| 172 | - Pw3270SettingsDialog * settings = g_new0(Pw3270SettingsDialog,1); | |
| 173 | - settings->action = action; | |
| 174 | - settings->dialog = GTK_DIALOG(dialog); | |
| 175 | - settings->application = G_APPLICATION(application); | |
| 176 | - | |
| 177 | - g_simple_action_set_enabled(action,FALSE); | |
| 178 | - | |
| 179 | - // Create settings notebook. | |
| 180 | - | |
| 181 | - settings->notebook = GTK_NOTEBOOK(gtk_notebook_new()); | |
| 182 | - | |
| 183 | - gtk_notebook_set_scrollable(settings->notebook,TRUE); | |
| 184 | - gtk_notebook_set_show_tabs(settings->notebook,TRUE); | |
| 185 | - gtk_notebook_set_show_border(settings->notebook, FALSE); | |
| 186 | - | |
| 187 | - g_signal_connect(G_OBJECT(settings->notebook), "page-added", G_CALLBACK(on_page_added), settings); | |
| 188 | -// g_signal_connect(G_OBJECT(settings->notebook), "page-removed", G_CALLBACK(on_page_changed), settings); | |
| 189 | - g_signal_connect(G_OBJECT(settings->notebook), "switch-page", G_CALLBACK(on_switch_page), settings); | |
| 190 | - gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),GTK_WIDGET(settings->notebook),TRUE,TRUE,0); | |
| 191 | - | |
| 192 | - // Connection signals. | |
| 193 | - g_signal_connect(dialog,"destroy",G_CALLBACK(on_destroy),settings); | |
| 194 | - g_signal_connect(dialog,"response",G_CALLBACK(on_response),settings); | |
| 195 | - | |
| 196 | - // Load pages. | |
| 197 | - Pw3270SettingsPage * pages[] = { | |
| 198 | - pw3270_toolbar_settings_new() | |
| 199 | - }; | |
| 200 | - | |
| 201 | - for(ix = 0; ix < G_N_ELEMENTS(pages); ix++) { | |
| 202 | - pw3270_application_settings_dialog_add_page(settings,pages[ix]); | |
| 203 | - } | |
| 204 | - | |
| 205 | - // Load page contents. | |
| 206 | - GSList * page; | |
| 207 | - for(page = settings->pages;page;page = page->next) { | |
| 208 | - Pw3270SettingsPage * widget = (Pw3270SettingsPage *) page->data; | |
| 209 | - if(widget->load) { | |
| 210 | - widget->load(widget,GTK_APPLICATION(settings->application)); | |
| 211 | - } | |
| 212 | - } | |
| 213 | - | |
| 214 | - // Show dialog. | |
| 215 | - gtk_widget_show_all(dialog); | |
| 216 | - | |
| 217 | - } | |
| 218 | - | |
| 219 | -*/ | ... | ... |
src/objects/application/private.h
| ... | ... | @@ -59,6 +59,4 @@ |
| 59 | 59 | G_GNUC_INTERNAL GAction * pw3270_open_window_action_new(); |
| 60 | 60 | G_GNUC_INTERNAL GAction * pw3270_open_tab_action_new(); |
| 61 | 61 | |
| 62 | - G_GNUC_INTERNAL void pw3270_application_generic_activated(GSimpleAction * action, GVariant *parameter, gpointer application); | |
| 63 | - | |
| 64 | 62 | #endif // PRIVATE_H_INCLUDED | ... | ... |
src/objects/window/window.c
| ... | ... | @@ -478,10 +478,6 @@ |
| 478 | 478 | |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - void pw3270_application_generic_activated(GSimpleAction * action, GVariant G_GNUC_UNUSED(*parameter), gpointer G_GNUC_UNUSED(application)) { | |
| 482 | - g_message("Generic action %s was activated",g_action_get_name(G_ACTION(action))); | |
| 483 | - } | |
| 484 | - | |
| 485 | 481 | GtkWidget * pw3270_application_window_get_active_terminal(GtkWidget *widget) { |
| 486 | 482 | return PW3270_APPLICATION_WINDOW(widget)->terminal; |
| 487 | 483 | } | ... | ... |