]> saetta.ns0.it Git - zakautho/gui/commitdiff
Missing buttons cancel and ok functionalities. gtk2 v0.0.1
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 14 Dec 2012 07:57:35 +0000 (08:57 +0100)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Fri, 14 Dec 2012 07:57:35 +0000 (08:57 +0100)
src/resources.c
src/roles.c

index 0fb8928773d37548c1a4583cf3b646b66f057925..80a2c44942230e9a3b2ef4ad29f24c4765bdbfaa 100644 (file)
@@ -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);
+}
index 34bf6df4b85116988af8ff5edbb4428b89dab669..ac9f96bd5a716c5e24128207c6c32d815d09a17b 100644 (file)
@@ -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);
+}