Author: jsuchome Date: Thu Oct 13 10:42:02 2011 New Revision: 66416 URL: http://svn.opensuse.org/viewcvs/yast?rev=66416&view=rev Log: - colorize the diff output (bnc#723660) - 2.21.15 Modified: trunk/snapper/VERSION trunk/snapper/package/yast2-snapper.changes trunk/snapper/src/dialogs.ycp Modified: trunk/snapper/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/snapper/VERSION?rev=66416&r1=66415&r2=66416&view=diff ============================================================================== --- trunk/snapper/VERSION (original) +++ trunk/snapper/VERSION Thu Oct 13 10:42:02 2011 @@ -1 +1 @@ -2.21.14 +2.21.15 Modified: trunk/snapper/package/yast2-snapper.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/snapper/package/yast2-snapper.changes?rev=66416&r1=66415&r2=66416&view=diff ============================================================================== --- trunk/snapper/package/yast2-snapper.changes (original) +++ trunk/snapper/package/yast2-snapper.changes Thu Oct 13 10:42:02 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Oct 13 10:40:50 CEST 2011 - jsuchome@suse.cz + +- colorize the diff output (bnc#723660) +- 2.21.15 + +------------------------------------------------------------------- Wed Oct 12 16:40:44 CEST 2011 - jsuchome@suse.cz - more optimalization in C++ code Modified: trunk/snapper/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/snapper/src/dialogs.ycp?rev=66416&r1=66415&r2=66416&view=diff ============================================================================== --- trunk/snapper/src/dialogs.ycp (original) +++ trunk/snapper/src/dialogs.ycp Thu Oct 13 10:42:02 2011 @@ -375,9 +375,29 @@ if (haskey (modification, "diff")) { string diff = String::EscapeTags (modification["diff"]:""); - diff = mergestring (splitstring (diff, "\n"), "<br>"); - // show fixed font in diff - diff = "<tt>" + diff + "</tt>"; + list<string> l = splitstring (diff, "\n"); + if (!textmode) + { + // colorize diff output + l = (list<string>) maplist (string line, l, { + string first = substring (line, 0, 1); + if (first == "+") + { + line = sformat ("<font color=blue>%1</font>", line); + } + else if (first == "-") + { + line = sformat ("<font color=red>%1</font>", line); + } + return line; + }); + } + diff = mergestring (l, "<br>"); + if (!textmode) + { + // show fixed font in diff + diff = "<tt>" + diff + "</tt>"; + } content = add (content, `RichText (`id (`diff), diff)); } else -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org