From c77c08299fa3456921af08bb4ba902b4eaf3585d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sun, 25 Aug 2019 22:11:36 +0200 Subject: [PATCH] Issue #25: Add select all button to GUI and connect callback. --- gds-render-gui.c | 14 ++++++++++++++ resources/main.glade | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/gds-render-gui.c b/gds-render-gui.c index 6520ae1..ba94960 100644 --- a/gds-render-gui.c +++ b/gds-render-gui.c @@ -62,6 +62,7 @@ struct _GdsRenderGui { GtkWidget *open_button; GtkWidget *load_layer_button; GtkWidget *save_layer_button; + GtkWidget *select_all_button; GtkTreeStore *cell_tree_store; GtkWidget *cell_search_entry; LayerSelector *layer_selector; @@ -540,6 +541,7 @@ static void gds_render_gui_dispose(GObject *gobject) g_clear_object(&self->load_layer_button); g_clear_object(&self->save_layer_button); g_clear_object(&self->open_button); + g_clear_object(&self->select_all_button); if (self->main_window) { g_signal_handlers_destroy(self->main_window); @@ -569,6 +571,13 @@ static void gds_render_gui_class_init(GdsRenderGuiClass *klass) gobject_class->dispose = gds_render_gui_dispose; } +static void on_select_all_layers_clicked(GtkWidget *button, gpointer user_data) +{ + GdsRenderGui *gui; + + gui = RENDERER_GUI(user_data); +} + GtkWindow *gds_render_gui_get_main_window(GdsRenderGui *gui) { return gui->main_window; @@ -651,6 +660,10 @@ static void gds_render_gui_init(GdsRenderGui *self) self->render_dialog_settings.tex_pdf_layers = FALSE; self->render_dialog_settings.tex_standalone = FALSE; + /* Get select all button and connect callback */ + self->select_all_button = GTK_WIDGET(gtk_builder_get_object(main_builder, "button-select-all")); + g_signal_connect(self->select_all_button, "clicked", G_CALLBACK(on_select_all_layers_clicked), self); + g_object_unref(main_builder); /* Setup default button sensibility data */ @@ -669,6 +682,7 @@ static void gds_render_gui_init(GdsRenderGui *self) g_object_ref(self->open_button); g_object_ref(self->load_layer_button); g_object_ref(self->save_layer_button); + g_object_ref(self->select_all_button); } GdsRenderGui *gds_render_gui_new() diff --git a/resources/main.glade b/resources/main.glade index b666578..299b49f 100644 --- a/resources/main.glade +++ b/resources/main.glade @@ -17,6 +17,21 @@ False gtk-save-as + + True + False + gtk-apply + + + True + False + gtk-sort-ascending + + + True + False + gtk-sort-descending + 250 False @@ -205,6 +220,20 @@ 2 + + + True + True + True + select-all-img + True + + + False + True + 3 + + False @@ -270,14 +299,4 @@ - - True - False - gtk-sort-ascending - - - True - False - gtk-sort-descending -