Coherent naming for backdrop styles

Greygjhart <[email protected]> Fri, 16 Mar 2012 21:55:57 +0900
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <20120316125557.GA737@hazel>
--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello there,

I had a very hard time trying to figure out what I was expected to write
to get a RPC command to actually set my wallpaper in a given mode. Of
course my first instinct was to look at the config file to find a hint,
as I could perfectly set it with rox' utility.

I was very surprised to find that what was called Centred in one was
Centre in the other one, and that's the same for others, though there
doesn't seem to be any generality here. As I still could manage to get
the 'Fit' mode to work (even after having commited atrocities like
'Fitted' or such), I proceeded to read the source code.

This is when I was flabbergasted to discover that Fit mode wasn't even
possible to set with a RPC command because its line had obviously been
forgotten.

I promised I searched a long time on the forum but I couldn't find any
topic mentioning that. Plus, it's not really a feature request or a bug
report, it's just a tiny mistake that takes no time to correct so I
really think it would've been corrected at once.

So here is the patch I propose to solve this issue and use the same
names everywhere (in the config and in the RPC commands).

Thanks a lot everybody and keep up the good work ! I've never found
anything quite like Rox among other file managers.

Greygjhart


--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="0001_coherent_naming_scheme_for_backdrops.patch"

diff --git a/ROX-Filer/src/pinboard.c b/ROX-Filer/src/pinboard.c
index 466930b..fcfde98 100644
--- a/ROX-Filer/src/pinboard.c
+++ b/ROX-Filer/src/pinboard.c
@@ -1511,11 +1511,11 @@ static void backdrop_from_xml(xmlNode *node)
 	if (style)
 	{
 		current_pinboard->backdrop_style =
-		  g_strcasecmp(style, "Tiled") == 0 ? BACKDROP_TILE :
-		  g_strcasecmp(style, "Scaled") == 0 ? BACKDROP_SCALE :
+		  g_strcasecmp(style, "Tile") == 0 ? BACKDROP_TILE :
+		  g_strcasecmp(style, "Scale") == 0 ? BACKDROP_SCALE :
+		  g_strcasecmp(style, "Stretch") == 0 ? BACKDROP_STRETCH :
+		  g_strcasecmp(style, "Centre") == 0 ? BACKDROP_CENTRE :
 		  g_strcasecmp(style, "Fit") == 0 ? BACKDROP_FIT :
-		  g_strcasecmp(style, "Stretched") == 0 ? BACKDROP_STRETCH :
-		  g_strcasecmp(style, "Centred") == 0 ? BACKDROP_CENTRE :
 		  g_strcasecmp(style, "Program") == 0 ? BACKDROP_PROGRAM :
 							     BACKDROP_NONE;
 		g_free(style);
@@ -1660,11 +1660,11 @@ static void pinboard_save(void)
 		tree = xmlNewTextChild(root, NULL, "backdrop",
 				current_pinboard->backdrop);
 		xmlSetProp(tree, "style",
-			style == BACKDROP_TILE   ? "Tiled" :
-			style == BACKDROP_CENTRE ? "Centred" :
-			style == BACKDROP_SCALE  ? "Scaled" :
+			style == BACKDROP_TILE   ? "Tile" :
+			style == BACKDROP_SCALE  ? "Scale" :
+			style == BACKDROP_STRETCH  ? "Stretch" :
+			style == BACKDROP_CENTRE ? "Centre" :
 			style == BACKDROP_FIT    ? "Fit" :
-			style == BACKDROP_STRETCH  ? "Stretched" :
 						   "Program");
 	}
 
diff --git a/ROX-Filer/src/remote.c b/ROX-Filer/src/remote.c
index b71a06a..abe1503 100644
--- a/ROX-Filer/src/remote.c
+++ b/ROX-Filer/src/remote.c
@@ -885,6 +885,7 @@ static xmlNodePtr rpc_SetBackdrop(GList *args)
 	    !g_strcasecmp(style, "Scale") ? BACKDROP_SCALE :
 	    !g_strcasecmp(style, "Stretch") ? BACKDROP_STRETCH :
 	    !g_strcasecmp(style, "Centre") ? BACKDROP_CENTRE :
+	    !g_strcasecmp(style, "Fit") ? BACKDROP_FIT :
 					     BACKDROP_NONE;
 
 	if (s == BACKDROP_NONE)

--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
rox-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rox-devel

--NzB8fVQJ5HfG6fxh--