libgtkform >= 0.3.1
libgtkformui >= 0.3.1
libaute >= 0.0.2
- libautoz >= 0.0.1
+ libautoz >= 0.0.2
libsolipa >= 0.3.1])
AC_SUBST(TERRITORIO_CFLAGS)
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button43">
+ <property name="label" translatable="yes">E_sporta</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="button36">
<property name="label">gtk-new</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button59">
+ <property name="label" translatable="yes">E_sporta</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="button15">
<property name="label">gtk-new</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button54">
+ <property name="label" translatable="yes">E_sporta</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="button8">
<property name="label">gtk-new</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button50">
+ <property name="label" translatable="yes">E_sporta</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-new</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button44">
+ <property name="label" translatable="yes">E_sporta</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="button29">
<property name="label">gtk-new</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
<property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button64">
+ <property name="label" translatable="yes">E_sporta</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkButton" id="button45">
<property name="label">gtk-new</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
GValue *value,
GParamSpec *pspec);
+static void territorio_aggregazioni_territoriali_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data);
static void territorio_aggregazioni_territoriali_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void territorio_aggregazioni_territoriali_on_btn_modifica_clicked (GtkButton *button,
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
g_strsplit (g_strconcat ("lstore_aggregazioni_territoriali|",
- (selezione ? "w_aggregazioni_territoriali" : "vbox12"),
- NULL), "|", -1),
+ (selezione ? "w_aggregazioni_territoriali" : "vbox12"),
+ NULL),
+ "|", -1),
&error);
if (error != NULL)
{
priv->wtransient = GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
}
+ g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button43"),
+ "clicked", G_CALLBACK (territorio_aggregazioni_territoriali_on_btn_esporta_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button36"),
"clicked", G_CALLBACK (territorio_aggregazioni_territoriali_on_btn_nuovo_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button37"),
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare un'aggregazione territoriale");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare un'aggregazione territoriale");
}
}
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare un'aggregazione territoriale");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare un'aggregazione territoriale");
}
}
territorio_aggregazioni_territoriali_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
TerritorioAggregazioniTerritoriali *territorio_aggregazioni_territoriali = TERRITORIO_AGGREGAZIONI_TERRITORIALI (object);
-
TerritorioAggregazioniTerritorialiPrivate *priv = TERRITORIO_AGGREGAZIONI_TERRITORIALI_GET_PRIVATE (territorio_aggregazioni_territoriali);
switch (property_id)
territorio_aggregazioni_territoriali_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
TerritorioAggregazioniTerritoriali *territorio_aggregazioni_territoriali = TERRITORIO_AGGREGAZIONI_TERRITORIALI (object);
-
TerritorioAggregazioniTerritorialiPrivate *priv = TERRITORIO_AGGREGAZIONI_TERRITORIALI_GET_PRIVATE (territorio_aggregazioni_territoriali);
switch (property_id)
}
/* CALLBACK */
+static void
+territorio_aggregazioni_territoriali_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ GtkWidget *transient;
+
+ guint ret;
+
+ TerritorioAggregazioniTerritoriali *territorio_aggregazioni_territoriali = (TerritorioAggregazioniTerritoriali *)user_data;
+ TerritorioAggregazioniTerritorialiPrivate *priv = TERRITORIO_AGGREGAZIONI_TERRITORIALI_GET_PRIVATE (territorio_aggregazioni_territoriali);
+
+ gchar **columns_title = g_strsplit ("ID|Tipo|Aggregazione", "|", -1);
+
+ if (priv->selezione)
+ {
+ transient = priv->widget;
+ }
+ else
+ {
+ transient = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
+ }
+
+ ret = solipa_gtktreemodel_to_csv_gui (priv->commons->solipa, GTK_WINDOW (transient), GTK_TREE_MODEL (priv->lstore_aggregazioni_territoriali),
+ columns_title, g_strv_length (columns_title));
+ if (ret == 1)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK,
+ "Salvataggio eseguito con successo.");
+ }
+ else if (ret == 0)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Errore durante il salvataggio.");
+ }
+
+ g_strfreev (columns_title);
+}
+
static void
territorio_aggregazioni_territoriali_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
}
else
{
- dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare un'aggregazione territoriale");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare un'aggregazione territoriale");
}
}
static void territorio_province_on_map (GtkWidget *widget,
gpointer user_data);
+static void territorio_province_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data);
static void territorio_province_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void territorio_province_on_btn_modifica_clicked (GtkButton *button,
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, "button59"),
+ "clicked", G_CALLBACK (territorio_province_on_btn_esporta_clicked), (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"),
for (row = 0; row < rows; row++)
{
gtk_list_store_append (priv->lstore_province, &iter);
-
gtk_list_store_set (priv->lstore_province, &iter,
COL_ID, gdaex_data_model_get_field_value_integer_at (dm, row, "id"),
COL_NOME, gdaex_data_model_get_field_value_stringify_at (dm, row, "nome"),
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare una provincia.");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare una provincia.");
}
}
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare una provincia.");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare una provincia.");
}
}
g_signal_handler_disconnect (G_OBJECT (priv->widget), priv->signal_map);
}
+static void
+territorio_province_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ GtkWidget *transient;
+
+ guint ret;
+
+ TerritorioProvince *territorio_province = (TerritorioProvince *)user_data;
+ TerritorioProvincePrivate *priv = TERRITORIO_PROVINCE_GET_PRIVATE (territorio_province);
+
+ gchar **columns_title = g_strsplit ("ID|Provincia|Sigla|Regione", "|", -1);
+
+ if (priv->selezione)
+ {
+ transient = priv->widget;
+ }
+ else
+ {
+ transient = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
+ }
+
+ ret = solipa_gtktreemodel_to_csv_gui (priv->commons->solipa, GTK_WINDOW (transient), GTK_TREE_MODEL (priv->lstore_province),
+ columns_title, g_strv_length (columns_title));
+ if (ret == 1)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK,
+ "Salvataggio eseguito con successo.");
+ }
+ else if (ret == 0)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Errore durante il salvataggio.");
+ }
+
+ g_strfreev (columns_title);
+}
+
static void
territorio_province_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
{
AutozIResource *ires1;
- GtkWidget *dialog;
- gboolean risp;
-
GtkTreeIter iter;
guint id;
return;
}
- dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- "Sicuro di voler eliminare la provincia selezionata?");
- risp = gtk_dialog_run (GTK_DIALOG (dialog));
- if (risp == GTK_RESPONSE_YES)
+ if (solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ "Sicuro di voler eliminare la provincia selezionata?") == GTK_RESPONSE_YES)
{
gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_province), &iter,
COL_ID, &id,
territorio_province_carica (territorio_province);
}
- gtk_widget_destroy (dialog);
}
else
{
- dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare una provincia.");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare una provincia.");
}
}
GdkEventKey *event,
gpointer user_data);
+static void territorio_regioni_on_btn_esporta_clicked (GtkButton *button,
+ 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,
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
g_strsplit (g_strconcat ("lstore_regioni|",
- (selezione ? "w_regioni" : "vbox4"),
- NULL), "|", -1),
+ (selezione ? "w_regioni" : "vbox4"),
+ NULL),
+ "|", -1),
&error);
if (error != NULL)
{
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, "button54"),
+ "clicked", G_CALLBACK (territorio_regioni_on_btn_esporta_clicked), (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"),
for (row = 0; row < rows; row++)
{
gtk_list_store_append (priv->lstore_regioni, &iter);
-
gtk_list_store_set (priv->lstore_regioni, &iter,
COL_ID, gdaex_data_model_get_field_value_integer_at (dm, row, "id"),
COL_NOME, gdaex_data_model_get_field_value_stringify_at (dm, row, "nome"),
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare una regione");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare una regione");
}
}
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare una regione");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare una regione");
}
}
return FALSE;
}
+static void
+territorio_regioni_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ GtkWidget *transient;
+
+ guint ret;
+
+ TerritorioRegioni *territorio_regioni = (TerritorioRegioni *)user_data;
+ TerritorioRegioniPrivate *priv = TERRITORIO_REGIONI_GET_PRIVATE (territorio_regioni);
+
+ gchar **columns_title = g_strsplit ("ID|Regione", "|", -1);
+
+ if (priv->selezione)
+ {
+ transient = priv->widget;
+ }
+ else
+ {
+ transient = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
+ }
+
+ ret = solipa_gtktreemodel_to_csv_gui (priv->commons->solipa, GTK_WINDOW (transient), GTK_TREE_MODEL (priv->lstore_regioni),
+ columns_title, g_strv_length (columns_title));
+ if (ret == 1)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK,
+ "Salvataggio eseguito con successo.");
+ }
+ else if (ret == 0)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Errore durante il salvataggio.");
+ }
+
+ g_strfreev (columns_title);
+}
+
static void
territorio_regioni_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
{
AutozIResource *ires1;
- GtkWidget *dialog;
- gboolean risp;
-
GtkTreeIter iter;
guint id;
return;
}
- dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- "Sicuro di voler eliminare la regione selezionata?");
- risp = gtk_dialog_run (GTK_DIALOG (dialog));
- if (risp == GTK_RESPONSE_YES)
+ if (solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ "Sicuro di voler eliminare la regione selezionata?") == GTK_RESPONSE_YES)
{
gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_regioni), &iter,
COL_ID, &id,
territorio_regioni_carica (territorio_regioni);
}
- gtk_widget_destroy (dialog);
}
else
{
- dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare una regione");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare una regione");
}
}
GdkEventKey *event,
gpointer user_data);
+static void territorio_stati_on_btn_esporta_clicked (GtkButton *button,
+ 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,
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, "button50"),
+ "clicked", G_CALLBACK (territorio_stati_on_btn_esporta_clicked), (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"),
for (row = 0; row < rows; row++)
{
gtk_list_store_append (priv->lstore_stati, &iter);
-
gtk_list_store_set (priv->lstore_stati, &iter,
COL_ID, gdaex_data_model_get_field_value_integer_at (dm, row, "id"),
COL_NOME, gdaex_data_model_get_field_value_stringify_at (dm, row, "nome"),
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare uno stato");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare uno stato");
}
}
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare uno stato");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare uno stato");
}
}
return FALSE;
}
+static void
+territorio_stati_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ GtkWidget *transient;
+
+ guint ret;
+
+ TerritorioStati *territorio_stati = (TerritorioStati *)user_data;
+ TerritorioStatiPrivate *priv = TERRITORIO_STATI_GET_PRIVATE (territorio_stati);
+
+ gchar **columns_title = g_strsplit ("ID|Stato", "|", -1);
+
+ if (priv->selezione)
+ {
+ transient = priv->widget;
+ }
+ else
+ {
+ transient = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
+ }
+
+ ret = solipa_gtktreemodel_to_csv_gui (priv->commons->solipa, GTK_WINDOW (transient), GTK_TREE_MODEL (priv->lstore_stati),
+ columns_title, g_strv_length (columns_title));
+ if (ret == 1)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK,
+ "Salvataggio eseguito con successo.");
+ }
+ else if (ret == 0)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Errore durante il salvataggio.");
+ }
+
+ g_strfreev (columns_title);
+}
+
static void
territorio_stati_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
}
else
{
- dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare uno stato");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare uno stato");
}
}
GValue *value,
GParamSpec *pspec);
+static void territorio_tipi_aggregazione_territoriale_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data);
static void territorio_tipi_aggregazione_territoriale_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data);
static void territorio_tipi_aggregazione_territoriale_on_btn_modifica_clicked (GtkButton *button,
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
g_strsplit (g_strconcat ("lstore_tipi_aggregazione_territoriale|",
- (selezione ? "w_tipi_aggregazione_territoriale" : "vbox10"),
- NULL), "|", -1),
+ (selezione ? "w_tipi_aggregazione_territoriale" : "vbox10"),
+ NULL),
+ "|", -1),
&error);
if (error != NULL)
{
priv->wtransient = GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
}
+ g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button44"),
+ "clicked", G_CALLBACK (territorio_tipi_aggregazione_territoriale_on_btn_esporta_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button29"),
"clicked", G_CALLBACK (territorio_tipi_aggregazione_territoriale_on_btn_nuovo_clicked), (gpointer)a);
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button30"),
for (row = 0; row < rows; row++)
{
gtk_list_store_append (priv->lstore_tipi_aggregazione_territoriale, &iter);
-
gtk_list_store_set (priv->lstore_tipi_aggregazione_territoriale, &iter,
COL_ID, gdaex_data_model_get_field_value_stringify_at (dm, row, "id"),
COL_NOME, gdaex_data_model_get_field_value_stringify_at (dm, row, "nome"),
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare un tipo aggregazione territoriale");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare un tipo aggregazione territoriale.");
}
}
}
else
{
- GtkWidget *dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare un tipo aggregazione territoriale");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare un tipo aggregazione territoriale.");
}
}
}
/* CALLBACK */
+static void
+territorio_tipi_aggregazione_territoriale_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ GtkWidget *transient;
+
+ guint ret;
+
+ TerritorioTipiAggregazioneTerritoriale *territorio_tipi_aggregazione_territoriale = (TerritorioTipiAggregazioneTerritoriale *)user_data;
+ TerritorioTipiAggregazioneTerritorialePrivate *priv = TERRITORIO_TIPI_AGGREGAZIONE_TERRITORIALE_GET_PRIVATE (territorio_tipi_aggregazione_territoriale);
+
+ gchar **columns_title = g_strsplit ("ID|Tipo aggregazione", "|", -1);
+
+ if (priv->selezione)
+ {
+ transient = priv->widget;
+ }
+ else
+ {
+ transient = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
+ }
+
+ ret = solipa_gtktreemodel_to_csv_gui (priv->commons->solipa, GTK_WINDOW (transient), GTK_TREE_MODEL (priv->lstore_tipi_aggregazione_territoriale),
+ columns_title, g_strv_length (columns_title));
+ if (ret == 1)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK,
+ "Salvataggio eseguito con successo.");
+ }
+ else if (ret == 0)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Errore durante il salvataggio.");
+ }
+
+ g_strfreev (columns_title);
+}
+
static void
territorio_tipi_aggregazione_territoriale_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)
}
else
{
- dialog = gtk_message_dialog_new (priv->wtransient,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare un tipo aggregazione territoriale");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ solipa_message_dialog (GTK_WIDGET (priv->wtransient),
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Occorre prima selezionare un tipo aggregazione territoriale");
}
}
}
}
-
static void
territorio_tipi_aggregazione_territoriale_on_btn_annulla_clicked (GtkButton *button,
gpointer user_data)
static void territorio_vie_on_map (GtkWidget *widget,
gpointer user_data);
+static void territorio_vie_on_btn_esporta_clicked (GtkButton *button,
+ 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,
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, "button64"),
+ "clicked", G_CALLBACK (territorio_vie_on_btn_esporta_clicked), (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"),
g_signal_handler_disconnect (G_OBJECT (priv->widget), priv->signal_map);
}
+static void
+territorio_vie_on_btn_esporta_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ GtkWidget *transient;
+
+ guint ret;
+
+ TerritorioVie *territorio_vie = (TerritorioVie *)user_data;
+ TerritorioViePrivate *priv = TERRITORIO_VIE_GET_PRIVATE (territorio_vie);
+
+ gchar **columns_title = g_strsplit ("ID|Via|{SKIP}|Comune|Provincia|Regione", "|", -1);
+
+ if (priv->selezione)
+ {
+ transient = priv->widget;
+ }
+ else
+ {
+ transient = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main"));
+ }
+
+ ret = solipa_gtktreemodel_to_csv_gui (priv->commons->solipa, GTK_WINDOW (transient), GTK_TREE_MODEL (priv->lstore_vie),
+ columns_title, g_strv_length (columns_title));
+ if (ret == 1)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK,
+ "Salvataggio eseguito con successo.");
+ }
+ else if (ret == 0)
+ {
+ solipa_message_dialog (transient,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Errore durante il salvataggio.");
+ }
+
+ g_strfreev (columns_title);
+}
+
static void
territorio_vie_on_btn_nuovo_clicked (GtkButton *button,
gpointer user_data)