[intro] don't let the user close the window while syncing

This commit is contained in:
Hylke Bons 2010-10-26 11:45:57 +01:00
parent 5dca8312eb
commit 2d7a1c902c
2 changed files with 20 additions and 4 deletions

View file

@ -142,6 +142,16 @@ namespace SparkleShare {
}
private void PreventClose (object o, DeleteEventArgs e)
{
// Cancel closing when the "Close"
// button of the window is pressed
e.RetVal = true;
}
public void ShowServerForm (bool server_form_only)
{
@ -155,7 +165,7 @@ namespace SparkleShare {
{
Reset ();
VBox layout_vertical = new VBox (false, 0);
Label header = new Label ("<span size='x-large'><b>" +
@ -270,7 +280,7 @@ namespace SparkleShare {
FolderEntry.Changed += CheckServerForm;
Label folder_label = new Label ("<b>" + _("Remote Folder Name:") + "</b>") {
Label folder_label = new Label ("<b>" + _("Folder Name:") + "</b>") {
UseMarkup = true,
Xalign = 1
};
@ -483,7 +493,7 @@ namespace SparkleShare {
{
Reset ();
VBox layout_vertical = new VBox (false, 0);
Label header = new Label ("<span size='x-large'><b>" +
@ -623,6 +633,8 @@ namespace SparkleShare {
fetcher.CloningStarted += delegate {
DeleteEvent += PreventClose;
SparkleHelpers.DebugInfo ("Git", "[" + canonical_name + "] Cloning Repository");
};
@ -630,6 +642,8 @@ namespace SparkleShare {
fetcher.CloningFinished += delegate {
DeleteEvent -= PreventClose;
SparkleHelpers.DebugInfo ("Git", "[" + canonical_name + "] Repository cloned");
SparkleHelpers.ClearAttributes (tmp_folder);
@ -654,6 +668,8 @@ namespace SparkleShare {
fetcher.CloningFailed += delegate {
DeleteEvent -= PreventClose;
SparkleHelpers.DebugInfo ("Git", "[" + canonical_name + "] Cloning failed");
if (Directory.Exists (tmp_folder)) {

View file

@ -202,7 +202,7 @@ namespace SparkleShare {
Application.Invoke (delegate {
SparkleIntro intro = new SparkleIntro ();
intro.ShowServerForm ();
intro.ShowServerForm (true);
});
};