if (id != 0)
{
stmt = gda_sql_parser_parse_string (priv->commons->gdaparser,
- g_strdup_printf ("UPDATE %sdatasources SET status = 'D' WHERE id = %d", priv->commons->prefix, id),
- NULL, NULL);
+ g_strdup_printf ("UPDATE %sdatasources SET status = 'D' WHERE id = %d", priv->commons->prefix, id),
+ NULL, NULL);
}
else
{
gtk_tree_model_get (GTK_TREE_MODEL (priv->tstore_datasources), &iter,
- COL_ID_TABLE, &id,
- -1);
+ COL_ID_TABLE, &id,
+ -1);
if (id != 0)
{
stmt = gda_sql_parser_parse_string (priv->commons->gdaparser,
- g_strdup_printf ("UPDATE %stables SET status = 'D' WHERE id = %d", priv->commons->prefix, id),
- NULL, NULL);
-
+ g_strdup_printf ("UPDATE %stables SET status = 'D' WHERE id = %d", priv->commons->prefix, id),
+ NULL, NULL);
}
}
- if (stmt != NULL)
+ if (stmt == NULL)
{
+ gtk_widget_destroy (dialog);
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,
- _("You must select a datasource or a table."));
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ _("You must select a datasource or a table."));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
return;
}
if (gda_connection_statement_execute_non_select (priv->commons->gdacon, stmt, NULL, NULL, &error) <= 0)
{
+ gtk_widget_destroy (dialog);
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.")));
+ 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.")));
+ gtk_dialog_run (GTK_DIALOG (dialog));
}
datasources_load (datasources);