From: Andrea Zagli Date: Fri, 14 Dec 2012 07:57:35 +0000 (+0100) Subject: Missing buttons cancel and ok functionalities. X-Git-Tag: v0.0.1^0 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=2db9c02627cd6b53c232302b09852cfa48dc267a;p=zakautho%2Fgui Missing buttons cancel and ok functionalities. --- diff --git a/src/resources.c b/src/resources.c index 0fb8928..80a2c44 100644 --- a/src/resources.c +++ b/src/resources.c @@ -53,6 +53,11 @@ static void autoz_gui_resources_on_trv_autoz_gui_resources_row_activated (GtkTre GtkTreeViewColumn *column, gpointer user_data); +static void autoz_gui_resources_on_btn_cancel_clicked (GtkButton *button, + gpointer user_data); +static void autoz_gui_resources_on_btn_ok_clicked (GtkButton *button, + gpointer user_data); + #define AUTOZ_GUI_RESOURCES_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_AUTOZ_GUI_RESOURCES, AutozGuiResourcesPrivate)) enum @@ -153,6 +158,11 @@ AutozGuiResources g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview1"), "row-activated", G_CALLBACK (autoz_gui_resources_on_trv_autoz_gui_resources_row_activated), (gpointer)a); + g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button15"), + "clicked", G_CALLBACK (autoz_gui_resources_on_btn_cancel_clicked), (gpointer)a); + g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button16"), + "clicked", G_CALLBACK (autoz_gui_resources_on_btn_ok_clicked), (gpointer)a); + if (!selection) { gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "button15"))); @@ -452,3 +462,20 @@ autoz_gui_resources_on_trv_autoz_gui_resources_row_activated (GtkTreeView *tree_ autoz_gui_resources_edit ((AutozGuiResources *)user_data); } } + +static void +autoz_gui_resources_on_btn_cancel_clicked (GtkButton *button, + gpointer user_data) +{ + AutozGuiResourcesPrivate *priv = AUTOZ_GUI_RESOURCES_GET_PRIVATE ((AutozGuiResources *)user_data); + + gtk_widget_destroy (priv->widget); + g_object_unref (G_OBJECT (user_data)); +} + +static void +autoz_gui_resources_on_btn_ok_clicked (GtkButton *button, + gpointer user_data) +{ + autoz_gui_resources_selected ((AutozGuiResources *)user_data); +} diff --git a/src/roles.c b/src/roles.c index 34bf6df..ac9f96b 100644 --- a/src/roles.c +++ b/src/roles.c @@ -53,6 +53,11 @@ static void autoz_gui_roles_on_trv_autoz_gui_roles_row_activated (GtkTreeView *t GtkTreeViewColumn *column, gpointer user_data); +static void autoz_gui_roles_on_btn_cancel_clicked (GtkButton *button, + gpointer user_data); +static void autoz_gui_roles_on_btn_ok_clicked (GtkButton *button, + gpointer user_data); + #define AUTOZ_GUI_ROLES_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_AUTOZ_GUI_ROLES, AutozGuiRolesPrivate)) enum @@ -153,6 +158,11 @@ AutozGuiRoles g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview2"), "row-activated", G_CALLBACK (autoz_gui_roles_on_trv_autoz_gui_roles_row_activated), (gpointer)a); + g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button10"), + "clicked", G_CALLBACK (autoz_gui_roles_on_btn_cancel_clicked), (gpointer)a); + g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button13"), + "clicked", G_CALLBACK (autoz_gui_roles_on_btn_ok_clicked), (gpointer)a); + if (!selection) { gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "button10"))); @@ -452,3 +462,20 @@ autoz_gui_roles_on_trv_autoz_gui_roles_row_activated (GtkTreeView *tree_view, autoz_gui_roles_edit ((AutozGuiRoles *)user_data); } } + +static void +autoz_gui_roles_on_btn_cancel_clicked (GtkButton *button, + gpointer user_data) +{ + AutozGuiRolesPrivate *priv = AUTOZ_GUI_ROLES_GET_PRIVATE ((AutozGuiRoles *)user_data); + + gtk_widget_destroy (priv->widget); + g_object_unref (G_OBJECT (user_data)); +} + +static void +autoz_gui_roles_on_btn_ok_clicked (GtkButton *button, + gpointer user_data) +{ + autoz_gui_roles_selected ((AutozGuiRoles *)user_data); +}