invite: start new thread to not freeze the UI when accepting
This commit is contained in:
parent
91451a5b5f
commit
b7e640d51d
|
@ -29,7 +29,7 @@
|
|||
<body>
|
||||
<div>
|
||||
<b>hbons's stuff</b> on <b>Github</b>
|
||||
<a href="sparkleshare://www.sparkleshare.org/test-invite.xml">
|
||||
<a href="sparkleshare://raw.github.com/hbons/SparkleShare/master/SparkleShare/Common/HTML/protocol-handler-test/invite.xml">
|
||||
<img src="add-to-sparkleshare-button.png" alt="Add to SparkleShare">
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -417,11 +417,11 @@ namespace SparkleShare {
|
|||
// fully downloaded yet, so we try to read it several times
|
||||
int tries = 0;
|
||||
while (!invite.IsValid) {
|
||||
Thread.Sleep (250);
|
||||
Thread.Sleep (100);
|
||||
invite = new SparkleInvite (args.FullPath);
|
||||
tries++;
|
||||
|
||||
if (tries > 20) {
|
||||
if (tries > 10) {
|
||||
AlertNotificationRaised ("Oh noes!", "This invite seems screwed up...");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -429,17 +429,20 @@ namespace SparkleShare {
|
|||
|
||||
ChangePageEvent (PageType.Syncing, null);
|
||||
|
||||
if (!PendingInvite.Accept ()) {
|
||||
ChangePageEvent (PageType.Error, null);
|
||||
return;
|
||||
}
|
||||
new Thread (() => {
|
||||
if (!PendingInvite.Accept ()) {
|
||||
ChangePageEvent (PageType.Error, null);
|
||||
return;
|
||||
}
|
||||
|
||||
Program.Controller.FolderFetched += InvitePageFetchedDelegate;
|
||||
Program.Controller.FolderFetchError += InvitePageFetchErrorDelegate;
|
||||
Program.Controller.FolderFetching += SyncingPageFetchingDelegate;
|
||||
Program.Controller.FolderFetched += InvitePageFetchedDelegate;
|
||||
Program.Controller.FolderFetchError += InvitePageFetchErrorDelegate;
|
||||
Program.Controller.FolderFetching += SyncingPageFetchingDelegate;
|
||||
|
||||
Program.Controller.StartFetcher (PendingInvite.Address, PendingInvite.Fingerprint,
|
||||
PendingInvite.RemotePath, PendingInvite.AnnouncementsUrl, false); // TODO: checkbox on invite page
|
||||
Program.Controller.StartFetcher (PendingInvite.Address, PendingInvite.Fingerprint,
|
||||
PendingInvite.RemotePath, PendingInvite.AnnouncementsUrl, false); // TODO: checkbox on invite page
|
||||
|
||||
}).Start ();
|
||||
}
|
||||
|
||||
// The following private methods are
|
||||
|
|
Loading…
Reference in a new issue