Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Coudoin <bruno.coudoin@free.fr>2009-07-12 19:02:45 (GMT)
committer Bruno Coudoin <bruno.coudoin@free.fr>2009-07-13 11:16:04 (GMT)
commitb009f8b407dd6d797ecca9d957f22a5499beeb08 (patch)
tree7edc7d22678d7047c9e9e45ab9cf8b395494bff6
parentdb996572005c478ff6161451f31d31c4ce4eed11 (diff)
Added a demo case windows.
-rw-r--r--src/gcompris/gcompris.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 4ec26e4..281e24c 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -74,7 +74,7 @@ static void single_instance_release();
* For the Activation dialog
*/
#ifdef STATIC_MODULE
-int gc_activation_check(char *code);
+int gc_activation_check(const char *code);
static void activation_enter_callback(GtkWidget *widget,
GtkWidget *entry );
static void activation_done();
@@ -869,7 +869,7 @@ display_activation_dialog()
* 0 if the code is valid but out of date
* 1 if the code is valid and under 2 years
*/
-int gc_activation_check(char *code)
+int gc_activation_check(const char *code)
{
#ifdef DISABLE_ACTIVATION_CODE
return 1;
@@ -878,7 +878,7 @@ int gc_activation_check(char *code)
int i;
char crc1 = 0;
char crc2 = 0;
- char codeddate[4];
+ char codeddate[5];
if(strlen(code) != 6)
return -1;
@@ -925,7 +925,16 @@ static void
activation_enter_callback( GtkWidget *entry,
GtkWidget *notused )
{
- switch(gc_activation_check((char *)gtk_entry_get_text(GTK_ENTRY(entry))))
+ const char *code = gtk_entry_get_text(GTK_ENTRY(entry));
+ // A special code to test the full version without
+ // saving the activation
+ if (strncmp(code, "123321", 6) == 0)
+ {
+ gtk_entry_set_text(GTK_ENTRY(entry), "GOOD");
+ return;
+ }
+
+ switch(gc_activation_check(code))
{
case 1:
gc_prop_get()->key = strdup(gtk_entry_get_text(GTK_ENTRY(entry)));