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 10c6e2f5b3
commit c17ad92a73
4 changed files with 24 additions and 6 deletions

View file

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

View file

@ -475,8 +475,13 @@ namespace SparkleShare {
points.PackStart (point_two, false, false, 12); points.PackStart (point_two, false, false, 12);
if (warnings.Length > 0) { if (warnings.Length > 0) {
string warnings_markup = "";
foreach (string warning in warnings)
warnings_markup += "\n<b>" + warning + "</b>";
Label label_three = new Label () { 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, Wrap = true,
Xalign = 0 Xalign = 0
}; };

View file

@ -578,8 +578,14 @@ namespace SparkleShare {
" <li>Do you have access rights to this remote project?</li>" + " <li>Do you have access rights to this remote project?</li>" +
"</ul>"; "</ul>";
if (warnings.Length > 0) if (warnings.Length > 0) {
html = html.Replace ("</ul>", "<li>Here's the raw error message:<br/> <b>" + warnings [0] + "</b></li></ul>"); 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.MainFrame.LoadHtmlString (html, new NSUrl (""));
web_view.DrawsBackground = false; 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?"); help_block.Inlines.Add ("Do you have access rights to this remote project?");
if (warnings.Length > 0) { 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•"; 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 () { Button cancel_button = new Button () {