static void test_win (GooCanvasItem **board) { int i; #if 0 GtkWidget *dlg; #endif for (i = 0; i < 15; i++) if (!board[i] || (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (board[i]), "piece_num")) != i)) return; #if 0 dlg=gnome_ok_dialog ("You stud, you win!"); gtk_window_set_modal(GTK_WINDOW(dlg),TRUE); gnome_dialog_run (GNOME_DIALOG (dlg)); #endif }
void gmdb_table_export_button_cb(GtkWidget *w, gpointer data) { gchar *file_path; FILE *outfile; gchar *bound_data[256]; MdbTableDef *table; MdbColumn *col; int i; int need_headers = 0; int need_quote = 0; gchar delimiter[11]; gchar quotechar; gchar lineterm[5]; gchar *str; int rows=0; char msg[100]; GtkWidget *exportwin; gmdb_export_get_delimiter(exportwin_xml, delimiter, 10); gmdb_export_get_lineterm(exportwin_xml, lineterm, 5); need_quote = gmdb_export_get_quote(exportwin_xml); quotechar = gmdb_export_get_quotechar(exportwin_xml); need_headers = gmdb_export_get_headers(exportwin_xml); file_path = gmdb_export_get_filepath(exportwin_xml); // printf("file path %s\n",file_path); if ((outfile=fopen(file_path, "w"))==NULL) { gnome_warning_dialog("Unable to Open File!"); return; } /* read table */ table = mdb_read_table(cat_entry); mdb_read_columns(table); mdb_rewind_table(table); for (i=0;i<table->num_cols;i++) { /* bind columns */ bound_data[i] = (char *) malloc(MDB_BIND_SIZE); bound_data[i][0] = '\0'; mdb_bind_column(table, i+1, bound_data[i]); /* display column titles */ col=g_ptr_array_index(table->columns,i); if (need_headers) { if (i>0) fprintf(outfile,delimiter); gmdb_print_quote(outfile, need_quote, quotechar, delimiter, col->name); fprintf(outfile,"%s", col->name); gmdb_print_quote(outfile, need_quote, quotechar, delimiter, col->name); } } if (need_headers) fprintf(outfile,lineterm); /* fetch those rows! */ while(mdb_fetch_row(table)) { for (i=0;i<table->num_cols;i++) { if (i>0) fprintf(outfile,delimiter); gmdb_print_quote(outfile, need_quote, quotechar, delimiter, bound_data[i]); fprintf(outfile,"%s", bound_data[i]); gmdb_print_quote(outfile, need_quote, quotechar, delimiter, bound_data[i]); } fprintf(outfile,lineterm); rows++; } /* free the memory used to bind */ for (i=0;i<table->num_cols;i++) { free(bound_data[i]); } fclose(outfile); exportwin = glade_xml_get_widget (exportwin_xml, "export_dialog"); gtk_widget_destroy(exportwin); sprintf(msg,"%d Rows exported successfully.\n", rows); gnome_ok_dialog(msg); }
static void notimpl(GtkObject *object, gpointer data) { gnome_ok_dialog("Not implemented..."); }
void DisplayMsg(char *msg) { gnome_ok_dialog(msg); }