make
This commit is contained in:
parent
4123169544
commit
10c6e2f5b3
|
@ -16,8 +16,9 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
|
||||
|
@ -126,6 +127,9 @@ namespace SparkleLib.Git {
|
|||
|
||||
} else {
|
||||
SparkleHelpers.DebugInfo ("Fetcher", line);
|
||||
|
||||
if (line.StartsWith ("fatal:"))
|
||||
base.errors.Add (line);
|
||||
}
|
||||
|
||||
|
||||
|
@ -140,6 +144,7 @@ namespace SparkleLib.Git {
|
|||
}
|
||||
|
||||
this.git.WaitForExit ();
|
||||
|
||||
SparkleHelpers.DebugInfo ("Git", "Exit code: " + this.git.ExitCode);
|
||||
|
||||
if (this.git.ExitCode == 0) {
|
||||
|
@ -157,6 +162,7 @@ namespace SparkleLib.Git {
|
|||
|
||||
InstallConfiguration ();
|
||||
InstallExcludeRules ();
|
||||
|
||||
AddWarnings ();
|
||||
|
||||
return true;
|
||||
|
@ -439,7 +445,8 @@ namespace SparkleLib.Git {
|
|||
|
||||
private void AddWarnings ()
|
||||
{
|
||||
/*SparkleGit git = new SparkleGit (TargetFolder,
|
||||
/*
|
||||
SparkleGit git = new SparkleGit (TargetFolder,
|
||||
"config --global core.excludesfile");
|
||||
|
||||
git.Start ();
|
||||
|
@ -453,6 +460,7 @@ namespace SparkleLib.Git {
|
|||
return;
|
||||
else
|
||||
this.warnings.Add ("You seem to have a system wide ‘gitignore’ file, this may affect SparkleShare files.");
|
||||
*/ }
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,8 +158,7 @@ namespace SparkleLib.Git {
|
|||
if (git.ExitCode != 0)
|
||||
return false;
|
||||
|
||||
string remote_revision = git.StandardOutput.ReadToEnd ().TrimEnd ();
|
||||
remote_revision = remote_revision.Substring (0, 40);
|
||||
string remote_revision = git.StandardOutput.ReadToEnd ().Substring (0, 40);
|
||||
|
||||
if (!remote_revision.StartsWith (current_revision)) {
|
||||
SparkleHelpers.DebugInfo ("Git",
|
||||
|
|
|
@ -58,7 +58,15 @@ namespace SparkleLib {
|
|||
}
|
||||
}
|
||||
|
||||
public string [] Errors {
|
||||
get {
|
||||
return this.errors.ToArray ();
|
||||
}
|
||||
}
|
||||
|
||||
protected List<string> warnings = new List<string> ();
|
||||
protected List<string> errors = new List<string> ();
|
||||
|
||||
private Thread thread;
|
||||
|
||||
|
||||
|
|
|
@ -450,26 +450,18 @@ namespace SparkleShare {
|
|||
Image list_point_three = new Image (SparkleUIHelpers.GetIcon ("list-point", 16));
|
||||
|
||||
Label label_one = new Label () {
|
||||
Text = "Is the host online?",
|
||||
Wrap = true,
|
||||
Xalign = 0
|
||||
};
|
||||
|
||||
Label label_two = new Label () {
|
||||
Markup = "<b>" + Controller.PreviousUrl + "</b> is the address we've compiled. " +
|
||||
"Does this look alright?",
|
||||
Wrap = true,
|
||||
Xalign = 0
|
||||
};
|
||||
|
||||
Label label_three = new Label () {
|
||||
Text = "The host needs to know who you are. Did you upload the key that's in " +
|
||||
"your SparkleShare folder?",
|
||||
Label label_two = new Label () {
|
||||
Text = "Do you have access rights to this remote project?",
|
||||
Wrap = true,
|
||||
Xalign = 0
|
||||
};
|
||||
|
||||
|
||||
points.PackStart (new Label ("Please check the following:") { Xalign = 0 }, false, false, 6);
|
||||
|
||||
HBox point_one = new HBox (false, 0);
|
||||
|
@ -482,10 +474,18 @@ namespace SparkleShare {
|
|||
point_two.PackStart (label_two, true, true, 12);
|
||||
points.PackStart (point_two, false, false, 12);
|
||||
|
||||
if (warnings.Length > 0) {
|
||||
Label label_three = new Label () {
|
||||
Markup = "Here's the raw error message:\n<b>" + warnings [0] + "</b>",
|
||||
Wrap = true,
|
||||
Xalign = 0
|
||||
};
|
||||
|
||||
HBox point_three = new HBox (false, 0);
|
||||
point_three.PackStart (list_point_three, false, false, 0);
|
||||
point_three.PackStart (label_three, true, true, 12);
|
||||
points.PackStart (point_three, false, false, 12);
|
||||
}
|
||||
|
||||
points.PackStart (new Label (""), true, true, 0);
|
||||
|
||||
|
|
|
@ -152,8 +152,8 @@ namespace SparkleShare {
|
|||
|
||||
this.background = new NSBox () {
|
||||
Frame = new RectangleF (
|
||||
new PointF (0, -1),
|
||||
new SizeF (Frame.Width, this.web_view.Frame.Height + 2)),
|
||||
new PointF (-1, -1),
|
||||
new SizeF (Frame.Width + 2, this.web_view.Frame.Height + 2)),
|
||||
FillColor = NSColor.White,
|
||||
BoxType = NSBoxType.NSBoxCustom
|
||||
};
|
||||
|
|
|
@ -574,11 +574,13 @@ namespace SparkleShare {
|
|||
"}" +
|
||||
"</style>" +
|
||||
"<ul>" +
|
||||
" <li>Is the host online?</li>" +
|
||||
" <li><b>" + Controller.PreviousUrl + "</b> is the address we've compiled. Does this look alright?</li>" +
|
||||
" <li>The host needs to know who you are. Did you upload the key that's in your SparkleShare folder?</li>" +
|
||||
" <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>");
|
||||
|
||||
web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
|
||||
web_view.DrawsBackground = false;
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace SparkleShare {
|
|||
public delegate void FolderFetchedEventHandler (string remote_url, string [] warnings);
|
||||
|
||||
public event FolderFetchErrorHandler FolderFetchError;
|
||||
public delegate void FolderFetchErrorHandler (string remote_url);
|
||||
public delegate void FolderFetchErrorHandler (string remote_url, string [] errors);
|
||||
|
||||
public event FolderFetchingHandler FolderFetching;
|
||||
public delegate void FolderFetchingHandler (double percentage);
|
||||
|
@ -939,7 +939,9 @@ namespace SparkleShare {
|
|||
"Failed to load \"" + backend + "\" backend for \"" + canonical_name + "\"");
|
||||
|
||||
if (FolderFetchError != null)
|
||||
FolderFetchError (Path.Combine (address, remote_path).Replace (@"\", "/"));
|
||||
FolderFetchError (
|
||||
Path.Combine (address, remote_path).Replace (@"\", "/"),
|
||||
new string [] {"Failed to load \"" + backend + "\" backend for \"" + canonical_name + "\""});
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -961,7 +963,7 @@ namespace SparkleShare {
|
|||
|
||||
this.fetcher.Failed += delegate {
|
||||
if (FolderFetchError != null)
|
||||
FolderFetchError (this.fetcher.RemoteUrl.ToString ());
|
||||
FolderFetchError (this.fetcher.RemoteUrl.ToString (), this.fetcher.Errors);
|
||||
|
||||
StopFetcher ();
|
||||
};
|
||||
|
|
|
@ -453,13 +453,13 @@ namespace SparkleShare {
|
|||
Program.Controller.FolderFetching -= SyncingPageFetchingDelegate;
|
||||
}
|
||||
|
||||
private void AddPageFetchErrorDelegate (string remote_url)
|
||||
private void AddPageFetchErrorDelegate (string remote_url, string [] errors)
|
||||
{
|
||||
SyncingFolder = "";
|
||||
PreviousUrl = remote_url;
|
||||
|
||||
if (ChangePageEvent != null)
|
||||
ChangePageEvent (PageType.Error, null);
|
||||
ChangePageEvent (PageType.Error, errors);
|
||||
|
||||
Program.Controller.FolderFetched -= AddPageFetchedDelegate;
|
||||
Program.Controller.FolderFetchError -= AddPageFetchErrorDelegate;
|
||||
|
@ -515,13 +515,13 @@ namespace SparkleShare {
|
|||
Program.Controller.FolderFetching -= SyncingPageFetchingDelegate;
|
||||
}
|
||||
|
||||
private void InvitePageFetchErrorDelegate (string remote_url)
|
||||
private void InvitePageFetchErrorDelegate (string remote_url, string [] errors)
|
||||
{
|
||||
SyncingFolder = "";
|
||||
PreviousUrl = remote_url;
|
||||
|
||||
if (ChangePageEvent != null)
|
||||
ChangePageEvent (PageType.Error, null);
|
||||
ChangePageEvent (PageType.Error, errors);
|
||||
|
||||
Program.Controller.FolderFetched -= AddPageFetchedDelegate;
|
||||
Program.Controller.FolderFetchError -= AddPageFetchErrorDelegate;
|
||||
|
|
|
@ -486,21 +486,24 @@ namespace SparkleShare {
|
|||
Header = "Something went wrong…";
|
||||
Description = "Please check the following:";
|
||||
|
||||
|
||||
TextBlock help_block = new TextBlock () {
|
||||
TextWrapping = TextWrapping.Wrap,
|
||||
Width = 310
|
||||
};
|
||||
|
||||
help_block.Inlines.Add ("Is the host online?\n\n");
|
||||
help_block.Inlines.Add (new Bold (new Run (Controller.PreviousUrl)));
|
||||
help_block.Inlines.Add (" is the address we've compiled. Does this look alright?\n\n");
|
||||
help_block.Inlines.Add ("The host needs to know who you are. Did you upload the key that's in your SparkleShare folder?");
|
||||
|
||||
TextBlock bullets_block = new TextBlock () {
|
||||
Text = "•\n\n•\n\n\n•"
|
||||
Text = "•\n\n•"
|
||||
};
|
||||
|
||||
help_block.Inlines.Add (new Bold (new Run (Controller.PreviousUrl)));
|
||||
help_block.Inlines.Add (" is the address we've compiled. Does this look alright?\n\n");
|
||||
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•";
|
||||
}
|
||||
|
||||
Button cancel_button = new Button () {
|
||||
Content = "Cancel"
|
||||
|
@ -511,7 +514,6 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
|
||||
|
||||
ContentCanvas.Children.Add (bullets_block);
|
||||
Canvas.SetLeft (bullets_block, 195);
|
||||
Canvas.SetTop (bullets_block, 100);
|
||||
|
|
Loading…
Reference in a new issue