{
char *filename;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
- load_user_data (&app_data, filename);
+ MainPlayerData temp;
+ load_user_data (&temp, filename);
+ /* if the puzzle file is invalid or the grid is frozen */
+ if (temp.puzzle.grid_size == 0 ||
+ temp.puzzle.grid_frozen == false)
+ {
+ GtkWidget *errordlg;
+ char message[256];
+ if (temp.puzzle.grid_size == 0)
+ strcpy (message, INVALID_PUZZLE);
+ else
+ strcpy (message, UNFROZEN_GRID_PLAYER);
+
+ errordlg = gtk_message_dialog_new (GTK_WINDOW(main_window),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ "%s",message);
+ gtk_dialog_run (GTK_DIALOG(errordlg));
+ gtk_widget_destroy (errordlg);
+
+ }
+ else
+ app_data = temp;
g_free (filename);
}
"comments", COMMENTS,
"website", WEBSITE,
"website-label", WEBSITE_LABEL,
- "license-type", GTK_LICENSE_GPL_2_0,
+ "license-type", GTK_LICENSE_CUSTOM,
+ "license", LICENSE_BSD,
"version", VERSION,
(char*)NULL);
}