setup: show raw (git) error message on failed add

This commit is contained in:
Hylke Bons 2012-06-17 22:57:15 +01:00
parent 6d796f35bf
commit ace1fb2c40
4 changed files with 24 additions and 6 deletions

View file

@ -128,8 +128,11 @@ namespace SparkleLib.Git {
} else {
SparkleHelpers.DebugInfo ("Fetcher", line);
if (line.StartsWith ("fatal:"))
if (line.StartsWith ("fatal:", true, null) ||
line.StartsWith ("error:", true, null)) {
base.errors.Add (line);
}
}

View file

@ -475,8 +475,13 @@ namespace SparkleShare {
points.PackStart (point_two, false, false, 12);
if (warnings.Length > 0) {
string warnings_markup = "";
foreach (string warning in warnings)
warnings_markup += "\n<b>" + warning + "</b>";
Label label_three = new Label () {
Markup = "Here's the raw error message:\n<b>" + warnings [0] + "</b>",
Markup = "Here's the raw error message:" + warnings_markup,
Wrap = true,
Xalign = 0
};

View file

@ -578,8 +578,14 @@ namespace SparkleShare {
" <li>Do you have access rights to this remote project?</li>" +
"</ul>";
if (warnings.Length > 0)
html = html.Replace ("</ul>", "<li>Here's the raw error message:<br/> <b>" + warnings [0] + "</b></li></ul>");
if (warnings.Length > 0) {
string warnings_markup = "";
foreach (string warning in warnings)
warnings_markup += "<br><b>" + warning + "</b>";
html = html.Replace ("</ul>", "<li>Here's the raw error message: " + warnings_markup + "</li></ul>");
}
web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
web_view.DrawsBackground = false;

View file

@ -500,9 +500,13 @@ namespace SparkleShare {
help_block.Inlines.Add ("Do you have access rights to this remote project?");
if (warnings.Length > 0) {
help_block.Inlines.Add ("\n\nHere's the raw error message:\n");
help_block.Inlines.Add (new Bold (new Run (warning [0])));
bullets_block.Text += "\n\n•";
help_block.Inlines.Add ("\n\nHere's the raw error message:");
foreach (string warning in warnings) {
help_block.Inlines.Add ("\n");
help_block.Inlines.Add (new Bold (new Run (warning)));
}
}
Button cancel_button = new Button () {