projects
/
wordblah.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for invalid puzzle file added
[wordblah.git]
/
wordblah_player.c
diff --git
a/wordblah_player.c
b/wordblah_player.c
index
26dab29
..
08db02e
100644
(file)
--- a/
wordblah_player.c
+++ b/
wordblah_player.c
@@
-622,15
+622,22
@@
void on_menu_open_activate (GtkMenuItem *item, GtkDrawingArea* area)
MainPlayerData temp;
reset_player_data (&temp, filename);
MainPlayerData temp;
reset_player_data (&temp, filename);
- /* if the grid is not frozen then the game cannot be played */
- if (temp.is_loaded == false)
+ /* if the puzzle is either an invalid puzzle file or grid is not frozen
+ then the game cannot be played */
+ if (temp.puzzle.grid_size == 0 || temp.is_loaded == false)
{
GtkWidget *errordlg ;
{
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,
errordlg = gtk_message_dialog_new (GTK_WINDOW(main_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
-
UNFROZEN_GRID_PLAYER
);
+
"%s",message
);
gtk_dialog_run (GTK_DIALOG(errordlg));
gtk_widget_destroy (errordlg);
}
gtk_dialog_run (GTK_DIALOG(errordlg));
gtk_widget_destroy (errordlg);
}