<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
/*
- * Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
*/
+#include <gdk/gdkkeysyms.h>
+
#include <libautoz/autoz.h>
#include "comuni.h"
GValue *value,
GParamSpec *pspec);
+static gboolean territorio_comuni_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data);
+
+static void territorio_comuni_on_map (GtkWidget *widget,
+ gpointer user_data);
+
static void territorio_comuni_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void territorio_comuni_on_btn_modifica_clicked (GtkButton *button,
gboolean selezione;
GtkWindow *wtransient;
+
+ guint signal_map;
};
G_DEFINE_TYPE (TerritorioComuni, territorio_comuni, G_TYPE_OBJECT)
priv->wtransient = GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
}
+ g_signal_connect (priv->widget,
+ "key-release-event", G_CALLBACK (territorio_comuni_on_key_release_event), (gpointer)a);
+ priv->signal_map = g_signal_connect (priv->widget,
+ "map", G_CALLBACK (territorio_comuni_on_map), (gpointer)a);
+
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button22"),
"clicked", G_CALLBACK (territorio_comuni_on_btn_nuovo_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button23"),
gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "button26")));
}
- territorio_comuni_carica (a);
-
ires1 = autoz_get_resource_from_id (priv->commons->autoz, "territorio_rw");
if (!autoz_is_allowed (priv->commons->autoz, priv->commons->role_utente, ires1, FALSE))
{
}
/* CALLBACK */
+static gboolean
+territorio_comuni_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ if (event->keyval == GDK_Escape)
+ {
+ TerritorioComuniPrivate *priv = TERRITORIO_COMUNI_GET_PRIVATE ((TerritorioComuni *)user_data);
+
+ if (priv->selezione)
+ {
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button25")));
+ return TRUE;
+ }
+ }
+ else if (event->keyval == GDK_F2)
+ {
+ TerritorioComuniPrivate *priv = TERRITORIO_COMUNI_GET_PRIVATE ((TerritorioComuni *)user_data);
+
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button58")));
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+territorio_comuni_on_map (GtkWidget *widget,
+ gpointer user_data)
+{
+ TerritorioComuni *territorio_comuni = (TerritorioComuni *)user_data;
+ TerritorioComuniPrivate *priv = TERRITORIO_COMUNI_GET_PRIVATE (territorio_comuni);
+
+ territorio_comuni_carica (territorio_comuni);
+ g_signal_handler_disconnect (G_OBJECT (priv->widget), priv->signal_map);
+}
+
static void
territorio_comuni_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
/*
- * Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
*/
+#include <gdk/gdkkeysyms.h>
+
#include <libautoz/autoz.h>
#include "province.h"
static void territorio_province_on_filtra (gpointer instance, gpointer parametri, gpointer user_data);
static void territorio_province_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
static void territorio_province_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static gboolean territorio_province_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data);
+
+static void territorio_province_on_map (GtkWidget *widget,
+ gpointer user_data);
static void territorio_province_on_btn_nuovo_clicked (GtkButton *button,
- gpointer user_data);
+ gpointer user_data);
static void territorio_province_on_btn_modifica_clicked (GtkButton *button,
- gpointer user_data);
+ gpointer user_data);
static void territorio_province_on_btn_elimina_clicked (GtkButton *button,
- gpointer user_data);
+ gpointer user_data);
static void territorio_province_on_trv_territorio_province_row_activated (GtkTreeView *tree_view,
GtkTreePath *tree_path,
GtkTreeViewColumn *column,
gpointer user_data);
static void territorio_province_on_btn_trova_clicked (GtkButton *button,
- gpointer user_data);
+ gpointer user_data);
static void territorio_province_on_btn_annulla_clicked (GtkButton *button,
- gpointer user_data);
+ gpointer user_data);
static void territorio_province_on_btn_seleziona_clicked (GtkButton *button,
- gpointer user_data);
+ gpointer user_data);
#define TERRITORIO_PROVINCE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_TERRITORIO_PROVINCE, TerritorioProvincePrivate))
gboolean selezione;
GtkWindow *wtransient;
+
+ guint signal_map;
};
G_DEFINE_TYPE (TerritorioProvince, territorio_province, G_TYPE_OBJECT)
*
*/
klass->selezionato_signal_id = g_signal_new ("selezionato",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__UINT,
- G_TYPE_NONE,
- 1, G_TYPE_UINT);
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__UINT,
+ G_TYPE_NONE,
+ 1, G_TYPE_UINT);
}
static void
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit (g_strconcat ("lstore_province|",
- (selezione ? "w_province" : "vbox6"),
- NULL), "|", -1),
+ g_strsplit (g_strconcat ("lstore_province",
+ selezione ? "|w_province" : "|vbox6",
+ NULL),
+ "|", -1),
&error);
if (error != NULL)
{
priv->wtransient = GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
}
+ g_signal_connect (priv->widget,
+ "key-release-event", G_CALLBACK (territorio_province_on_key_release_event), (gpointer)a);
+ priv->signal_map = g_signal_connect (priv->widget,
+ "map", G_CALLBACK (territorio_province_on_map), (gpointer)a);
+
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button15"),
"clicked", G_CALLBACK (territorio_province_on_btn_nuovo_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button16"),
gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "button19")));
}
- territorio_province_carica (a);
-
ires1 = autoz_get_resource_from_id (priv->commons->autoz, "territorio_rw");
if (!autoz_is_allowed (priv->commons->autoz, priv->commons->role_utente, ires1, FALSE))
{
sql_where);
dm = gdaex_query (priv->commons->gdaex, sql);
+ g_free (sql);
+ g_free (sql_where);
if (dm != NULL)
{
rows = gda_data_model_get_n_rows (dm);
}
/* CALLBACK */
+static gboolean
+territorio_province_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ if (event->keyval == GDK_Escape)
+ {
+ TerritorioProvincePrivate *priv = TERRITORIO_PROVINCE_GET_PRIVATE ((TerritorioProvince *)user_data);
+
+ if (priv->selezione)
+ {
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button18")));
+ return TRUE;
+ }
+ }
+ else if (event->keyval == GDK_F2)
+ {
+ TerritorioProvincePrivate *priv = TERRITORIO_PROVINCE_GET_PRIVATE ((TerritorioProvince *)user_data);
+
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button53")));
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+territorio_province_on_map (GtkWidget *widget,
+ gpointer user_data)
+{
+ TerritorioProvince *territorio_province = (TerritorioProvince *)user_data;
+ TerritorioProvincePrivate *priv = TERRITORIO_PROVINCE_GET_PRIVATE (territorio_province);
+
+ territorio_province_carica (territorio_province);
+ g_signal_handler_disconnect (G_OBJECT (priv->widget), priv->signal_map);
+}
+
static void
territorio_province_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
/*
- * Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
*/
+#include <gdk/gdkkeysyms.h>
+
#include <libautoz/autoz.h>
#include "regioni.h"
GValue *value,
GParamSpec *pspec);
+static gboolean territorio_regioni_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data);
+
static void territorio_regioni_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void territorio_regioni_on_btn_modifica_clicked (GtkButton *button,
priv->wtransient = GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
}
+ g_signal_connect (priv->widget,
+ "key-release-event", G_CALLBACK (territorio_regioni_on_key_release_event), (gpointer)a);
+
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button8"),
"clicked", G_CALLBACK (territorio_regioni_on_btn_nuovo_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button9"),
}
/* CALLBACK */
+static gboolean
+territorio_regioni_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ if (event->keyval == GDK_Escape)
+ {
+ TerritorioRegioniPrivate *priv = TERRITORIO_REGIONI_GET_PRIVATE ((TerritorioRegioni *)user_data);
+
+ if (priv->selezione)
+ {
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button11")));
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
static void
territorio_regioni_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
/*
- * Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
*/
+#include <gdk/gdkkeysyms.h>
+
#include <libautoz/autoz.h>
#include "stati.h"
GValue *value,
GParamSpec *pspec);
+static gboolean territorio_stati_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data);
+
static void territorio_stati_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void territorio_stati_on_btn_modifica_clicked (GtkButton *button,
priv->wtransient = GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
}
+ g_signal_connect (priv->widget,
+ "key-release-event", G_CALLBACK (territorio_stati_on_key_release_event), (gpointer)a);
+
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button1"),
"clicked", G_CALLBACK (territorio_stati_on_btn_nuovo_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button2"),
}
/* CALLBACK */
+static gboolean
+territorio_stati_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ if (event->keyval == GDK_Escape)
+ {
+ TerritorioStatiPrivate *priv = TERRITORIO_STATI_GET_PRIVATE ((TerritorioStati *)user_data);
+
+ if (priv->selezione)
+ {
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button4")));
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
static void
territorio_stati_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
/*
- * Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*/
#include <string.h>
+
+#include <gdk/gdkkeysyms.h>
+
#include <libautoz/autoz.h>
#include "vie.h"
GValue *value,
GParamSpec *pspec);
+static gboolean territorio_vie_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data);
+
+static void territorio_vie_on_map (GtkWidget *widget,
+ gpointer user_data);
+
static void territorio_vie_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void territorio_vie_on_btn_modifica_clicked (GtkButton *button,
gboolean selezione;
GtkWindow *wtransient;
+
+ guint signal_map;
};
G_DEFINE_TYPE (TerritorioVie, territorio_vie, G_TYPE_OBJECT)
priv->wtransient = GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
}
+ g_signal_connect (priv->widget,
+ "key-release-event", G_CALLBACK (territorio_vie_on_key_release_event), (gpointer)a);
+ priv->signal_map = g_signal_connect (priv->widget,
+ "map", G_CALLBACK (territorio_vie_on_map), (gpointer)a);
+
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button45"),
"clicked", G_CALLBACK (territorio_vie_on_btn_nuovo_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button46"),
gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "button49")));
}
- territorio_vie_carica (a);
-
ires1 = autoz_get_resource_from_id (priv->commons->autoz, "territorio_rw");
if (!autoz_is_allowed (priv->commons->autoz, priv->commons->role_utente, ires1, FALSE))
{
}
/* CALLBACK */
+static gboolean
+territorio_vie_on_key_release_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ if (event->keyval == GDK_Escape)
+ {
+ TerritorioViePrivate *priv = TERRITORIO_VIE_GET_PRIVATE ((TerritorioVie *)user_data);
+
+ if (priv->selezione)
+ {
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button48")));
+ return TRUE;
+ }
+ }
+ else if (event->keyval == GDK_F2)
+ {
+ TerritorioViePrivate *priv = TERRITORIO_VIE_GET_PRIVATE ((TerritorioVie *)user_data);
+
+ gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->commons->gtkbuilder, "button63")));
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+territorio_vie_on_map (GtkWidget *widget,
+ gpointer user_data)
+{
+ TerritorioVie *territorio_vie = (TerritorioVie *)user_data;
+ TerritorioViePrivate *priv = TERRITORIO_VIE_GET_PRIVATE (territorio_vie);
+
+ territorio_vie_carica (territorio_vie);
+ g_signal_handler_disconnect (G_OBJECT (priv->widget), priv->signal_map);
+}
+
static void
territorio_vie_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)