[gcompris] core, add display of the profile if defined



commit d4321d4ca204745504c09584c78ef94845308d08
Author: Bruno Coudoin <bcoudoin gcompris net>
Date:   Sat Oct 26 14:58:30 2013 +0200

    core, add display of the profile if defined
    
    The profile is displayed on the main menu on the lower
    right.

 src/boards/menu2.c         |   19 +++++++++++++++++++
 src/gcompris/gcompris_db.c |    2 +-
 src/gcompris/profile.h     |    2 ++
 3 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/src/boards/menu2.c b/src/boards/menu2.c
index 04790f7..181352b 100644
--- a/src/boards/menu2.c
+++ b/src/boards/menu2.c
@@ -266,6 +266,25 @@ static void menu_start (GcomprisBoard *agcomprisBoard)
        display_welcome(menuitems);
 
       {
+       if ( strcmp(gc_prop_get()->profile->name, GC_PROFILE_DEFAULT) != 0 )
+         {
+           gchar *text = g_strdup_printf(_("Profile: %s"),
+                                         gc_prop_get()->profile->name);
+           goo_canvas_text_new (boardRootItem,
+                                text,
+                                BOARDWIDTH - 10,
+                                BOARDHEIGHT - 30,
+                                -1,
+                                GTK_ANCHOR_EAST,
+                                "font", gc_skin_font_board_tiny,
+                                "fill-color-rgba", gc_skin_get_color("menu/text"),
+                                "alignment", PANGO_ALIGN_RIGHT,
+                                NULL);
+           g_free(text);
+         }
+      }
+
+      {
        gchar *text = g_strdup_printf(_("Number of activities: %d"),
                                      gc_board_get_number_of_activity());
        goo_canvas_text_new (boardRootItem,
diff --git a/src/gcompris/gcompris_db.c b/src/gcompris/gcompris_db.c
index bc91cf8..6854c84 100644
--- a/src/gcompris/gcompris_db.c
+++ b/src/gcompris/gcompris_db.c
@@ -83,7 +83,7 @@ static sqlite3 *gcompris_db=NULL;
   "SELECT gcompris_version FROM informations;"
 
 #define SET_DEFAULT_PROFILE                                            \
-  "INSERT INTO profiles (profile_id, name, profile_directory, description) VALUES ( 1, \'Default\', 
\'Default\', \'Default profil for gcompris\');"
+  "INSERT INTO profiles (profile_id, name, profile_directory, description) VALUES ( 1, \'" 
GC_PROFILE_DEFAULT "\', \'Default\', \'Default profil for gcompris\');"
 #define ACTIVATE_DEFAULT_PROFILE               \
   "UPDATE informations SET profile_id=1;"
 
diff --git a/src/gcompris/profile.h b/src/gcompris/profile.h
index ff6f9f7..fca82a8 100644
--- a/src/gcompris/profile.h
+++ b/src/gcompris/profile.h
@@ -30,6 +30,8 @@
 #ifndef PROFILES_H
 #define PROFILES_H
 
+#define GC_PROFILE_DEFAULT "Default"
+
 /*****************************************************************************/
 /* The following structure dsecribes a class, partitionning the users set     */
 struct _GcomprisClass {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]