cheese r862 - in trunk: . data src



Author: dgsiegel
Date: Thu Aug  7 12:16:51 2008
New Revision: 862
URL: http://svn.gnome.org/viewvc/cheese?rev=862&view=rev

Log:
selected effects gconf key values are now standardized, fixes bug #513776


Modified:
   trunk/ChangeLog
   trunk/data/cheese.schemas.in
   trunk/src/cheese-gconf.c

Modified: trunk/data/cheese.schemas.in
==============================================================================
--- trunk/data/cheese.schemas.in	(original)
+++ trunk/data/cheese.schemas.in	Thu Aug  7 12:16:51 2008
@@ -8,7 +8,7 @@
 			<default>1</default>
 			<locale name="C">
 				<short>Use a countdown</short>
-				<long>Whether a countdown should be used when taking a photo</long>
+				<long>Set to True to show countdown when taking a photo</long>
 			</locale>
     	</schema>
 
@@ -20,7 +20,7 @@
 			<default></default>
 			<locale name="C">
 				<short>Webcam device string indicator</short>
-				<long>The device-string which points to the webcam, e.g. /dev/video0</long>
+				<long>The device which points to the webcam (e.g. /dev/video0)</long>
 			</locale>
 		</schema>
 
@@ -33,9 +33,9 @@
 			<default>[]</default>
 			<locale name="C">
 				<short>Selected Effects</short>
-				<long>Effects, that are applied on startup. Possible values are: Mauve,
-				Noir/Blanc, Saturation, Hulk, Vertical Flip, Horizontal Flip,
-				Shagadelic, Vertigo, Edge, Dice and Warp</long>
+				<long>A list of effects applied on startup. Possible values are: "mauve",
+				"noir_blanc", "saturation", "hulk", "vertical-flip", "horizontal-flip",
+				"shagadelic", "vertigo", "edge", "dice" and "warp"</long>
 			</locale>
 		</schema>
 		

Modified: trunk/src/cheese-gconf.c
==============================================================================
--- trunk/src/cheese-gconf.c	(original)
+++ trunk/src/cheese-gconf.c	Thu Aug  7 12:16:51 2008
@@ -74,10 +74,26 @@
       tmp = list;
       while (tmp != NULL)
       {
+        char *str = tmp->data;
+        int j;
+        str[0] = g_ascii_toupper (str[0]);
+        for (j = 1; j < g_utf8_strlen (str, -1); j++)
+        {
+          if (str[j] == '-')
+          {
+            str[j] = ' ';
+            str[j + 1] = g_ascii_toupper (str[j + 1]);
+          }
+          else if (str[j] == '_')
+          {
+            str[j] = '/';
+            str[j + 1] = g_ascii_toupper (str[j + 1]);
+          }
+        }
         if (effects == NULL)
-          effects = tmp->data;
+          effects = str;
         else
-          effects = g_strjoin (",", effects, tmp->data, NULL);
+          effects = g_strjoin (",", effects, str, NULL);
 
         tmp = g_slist_next (tmp);
       }
@@ -151,11 +167,29 @@
       }
       else
       {
-        effects = g_strsplit (g_value_get_string (value), ",", 12);
+        char *str = g_value_dup_string (value);
+        int j;
+        for (j = 0; j < g_utf8_strlen (str, -1); j++)
+        {
+          if (g_ascii_isupper (str[j]))
+          {
+            str[j] = g_ascii_tolower (str[j]);
+          }
+          else if (str[j] == ' ')
+          {
+            str[j] = '-';
+          }
+          else if (str[j] == '/')
+          {
+            str[j] = '_';
+          }
+        }
+        effects = g_strsplit (str, ",", 12);
         for (i = 0; effects[i] != NULL; i++)
         {
           list = g_slist_append (list, effects[i]);
         }
+        g_free (str);
       }
       gconf_client_set_list (priv->client,
                                CHEESE_GCONF_PREFIX "/selected_effects",



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