GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
- "Occorre prima selezionare un datasourceso");
+ "Select a datasource.");
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
datasources_on_btn_delete_clicked (GtkButton *button,
gpointer user_data)
{
- /*GtkWidget *dialog;
+ GtkWidget *dialog;
gboolean risp;
GtkTreeIter iter;
if (gtk_tree_selection_get_selected (priv->selection, NULL, &iter))
{
- dialog = gtk_message_dialog_new (priv->wtransient,
+ dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main")),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- "Sicuro di voler eliminare l'datasourceso selezionato?");
+ "Are you sure to want to delete the selected datasource?");
risp = gtk_dialog_run (GTK_DIALOG (dialog));
if (risp == GTK_RESPONSE_YES)
{
- gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_datasources), &iter,
- COL_ID, &id,
+ GError *error;
+ GdaStatement *stmt;
+
+ gtk_tree_model_get (GTK_TREE_MODEL (priv->tstore_datasources), &iter,
+ COL_ID_DS, &id,
-1);
- gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE datasources SET status = 'E' WHERE id = %d", id));
+ error = NULL;
+ stmt = gda_sql_parser_parse_string (priv->commons->gdaparser,
+ g_strdup_printf ("UPDATE datasources SET status = 'D' WHERE id = %d", id),
+ NULL, NULL);
+ if (gda_connection_statement_execute_non_select (priv->commons->gdacon, stmt, NULL, NULL, &error) <= 0)
+ {
+ dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main")),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Error on saving.\n\n%s",
+ (error != NULL && error->message != NULL ? error->message : "No details."));
+ }
- datasources_carica (datasources);
+ datasources_load (datasources);
}
gtk_widget_destroy (dialog);
}
else
{
- dialog = gtk_message_dialog_new (priv->wtransient,
+ dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main")),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
- "Occorre prima selezionare un datasourceso");
+ "Select a datasource.");
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- }*/
+ }
}
static void