~paulbrianstewart/ubuntu/oneiric/gcompris/825448-Spelling-And-Grammar-Error

« back to all changes in this revision

Viewing changes to src/wordsgame-activity/wordsgame.c

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2010-06-27 22:51:30 UTC
  • mfrom: (1.1.16 upstream) (5.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100627225130-mf7h4m5r8m7bd9fb
Tags: 9.3-1
* New upstream release.
* Drop GTK_DISABLE_DEPRECATED patch, useless for now.
* Provide RELEASE_NOTE_9.3.txt downloaded from sourceforge.
* New voice package for Asturian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
    {
179
179
      gcomprisBoard=agcomprisBoard;
180
180
 
 
181
      GHashTable *config = gc_db_get_board_conf();
 
182
      gc_locale_change(g_hash_table_lookup( config, "locale"));
 
183
      g_hash_table_destroy(config);
 
184
 
181
185
      /* disable im_context */
182
186
      //gcomprisBoard->disable_im_context = TRUE;
183
187
 
233
237
        gc_wordlist_free(gc_wordlist);
234
238
        gc_wordlist = NULL;
235
239
      }
236
 
 
237
240
    }
 
241
 
 
242
  gc_locale_reset();
238
243
}
239
244
 
240
245
static void
755
760
  gc_sound_play_ogg ("sounds/crash.wav", NULL);
756
761
}
757
762
 
758
 
static void conf_ok(gpointer data)
759
 
{
760
 
        pause_board(FALSE);
761
 
}
762
 
 
763
 
static void wordsgame_config_start(GcomprisBoard *agcomprisBoard, GcomprisProfile *aProfile)
764
 
{
765
 
        if (gcomprisBoard)
766
 
                pause_board(TRUE);
767
 
 
768
 
        gchar *label = g_strdup_printf(_("<b>%s</b> configuration\n for profile <b>%s</b>"),
769
 
                        agcomprisBoard->name,
770
 
                        aProfile? aProfile->name: "");
771
 
        GcomprisBoardConf *bconf;
772
 
        bconf = gc_board_config_window_display( label,
773
 
                        (GcomprisConfCallback )conf_ok);
774
 
 
775
 
        g_free(label);
776
 
 
777
 
        gc_board_config_wordlist(bconf, "wordsgame/default-$LOCALE.xml");
 
763
/* ************************************* */
 
764
/* *            Configuration          * */
 
765
/* ************************************* */
 
766
 
 
767
 
 
768
/* ======================= */
 
769
/* = config_start        = */
 
770
/* ======================= */
 
771
 
 
772
static GcomprisProfile *profile_conf;
 
773
static GcomprisBoard   *board_conf;
 
774
static void save_table (gpointer key,
 
775
                        gpointer value,
 
776
                        gpointer user_data)
 
777
{
 
778
  gc_db_set_board_conf ( profile_conf,
 
779
                            board_conf,
 
780
                            (gchar *) key,
 
781
                            (gchar *) value);
 
782
}
 
783
 
 
784
static void conf_ok(GHashTable *table)
 
785
{
 
786
  if (!table){
 
787
    if (gcomprisBoard)
 
788
      pause_board(FALSE);
 
789
    return;
 
790
  }
 
791
 
 
792
  g_hash_table_foreach(table, (GHFunc) save_table, NULL);
 
793
 
 
794
  if (gcomprisBoard){
 
795
    GHashTable *config;
 
796
 
 
797
    if (profile_conf)
 
798
      config = gc_db_get_board_conf();
 
799
    else
 
800
      config = table;
 
801
 
 
802
    gc_locale_set(g_hash_table_lookup( config, "locale"));
 
803
 
 
804
    if (profile_conf)
 
805
      g_hash_table_destroy(config);
 
806
 
 
807
    wordsgame_next_level();
 
808
 
 
809
    pause_board(FALSE);
 
810
  }
 
811
 
 
812
  board_conf = NULL;
 
813
  profile_conf = NULL;
 
814
}
 
815
 
 
816
static void
 
817
wordsgame_config_start(GcomprisBoard *agcomprisBoard,
 
818
                       GcomprisProfile *aProfile)
 
819
{
 
820
  GcomprisBoardConf *conf;
 
821
  board_conf = agcomprisBoard;
 
822
  profile_conf = aProfile;
 
823
 
 
824
  if (gcomprisBoard)
 
825
    pause_board(TRUE);
 
826
 
 
827
  gchar *label = g_strdup_printf(_("<b>%s</b> configuration\n for profile <b>%s</b>"),
 
828
                                 agcomprisBoard->name,
 
829
                                 aProfile? aProfile->name: "");
 
830
 
 
831
  conf = gc_board_config_window_display( label,
 
832
                                 (GcomprisConfCallback )conf_ok);
 
833
 
 
834
  g_free(label);
 
835
 
 
836
  /* init the combo to previously saved value */
 
837
  GHashTable *config = gc_db_get_conf( profile_conf, board_conf);
 
838
 
 
839
  gchar *locale = g_hash_table_lookup( config, "locale");
 
840
 
 
841
  gc_board_config_combo_locales(conf, locale);
 
842
  gc_board_config_wordlist(conf, "wordsgame/default-$LOCALE.xml");
778
843
}
779
844
 
780
845
static void wordsgame_config_stop(void)