[linux] Keep setup dialog in memory

This commit is contained in:
Hylke Bons 2011-03-16 00:01:20 +00:00
parent ec4785eec6
commit 0275d7e17d
4 changed files with 44 additions and 46 deletions

View file

@ -61,7 +61,7 @@ namespace SparkleShare {
VBox layout_vertical = new VBox (false, 0);
DeleteEvent += PreventClose;
Deletable = false;
Label header = new Label ("<span size='x-large'><b>" +
_("Welcome to SparkleShare!") +
@ -131,7 +131,7 @@ namespace SparkleShare {
SparkleShare.Controller.FirstRun = false;
DeleteEvent += PreventClose;
Deletable = false;
ShowServerForm ();
};
@ -152,16 +152,6 @@ namespace SparkleShare {
}
private void PreventClose (object o, DeleteEventArgs args)
{
// Cancel closing when the "Close"
// button of the window is pressed
args.RetVal = true;
}
public void ShowServerForm (bool server_form_only)
{
@ -364,13 +354,13 @@ namespace SparkleShare {
string canonical_name = System.IO.Path.GetFileNameWithoutExtension (name);
DeleteEvent += PreventClose;
Deletable = false;
ShowSyncingPage (canonical_name);
SparkleShare.Controller.FolderFetched += delegate {
DeleteEvent -= PreventClose;
Deletable = true;
Application.Invoke (delegate {
ShowSuccessPage (name);
@ -380,7 +370,7 @@ namespace SparkleShare {
SparkleShare.Controller.FolderFetchError += delegate {
DeleteEvent -= PreventClose;
Deletable = true;
Application.Invoke (delegate { ShowErrorPage (); });
@ -397,7 +387,7 @@ namespace SparkleShare {
Button cancel_button = new Button (_("Cancel"));
cancel_button.Clicked += delegate {
Destroy ();
Close ();
};
AddButton (cancel_button);
@ -485,9 +475,7 @@ namespace SparkleShare {
Button accept_button = new Button (_("Accept and Sync"));
reject_button.Clicked += delegate {
Destroy ();
Close ();
};
accept_button.Clicked += delegate {
@ -599,7 +587,7 @@ namespace SparkleShare {
Button finish_button = new Button (_("Finish"));
finish_button.Clicked += delegate (object o, EventArgs args) {
Destroy ();
Close ();
};
AddButton (open_folder_button);
@ -644,7 +632,7 @@ namespace SparkleShare {
};
button.Clicked += delegate {
Destroy ();
Close ();
};
AddButton (button);
@ -658,28 +646,13 @@ namespace SparkleShare {
HBox box = new HBox (false, 0);
table.Attach (spinner, 0, 1, 0, 1);
table.Attach (spinner, 0, 1, 0, 1);
table.Attach (header, 1, 2, 0, 1);
table.Attach (information, 1, 2, 1, 2);
box.PackStart (table, false, false, 0);
ProgressBar progress_bar = new ProgressBar () {
};
Timer timer = new Timer () {
Interval = 100
};
timer.Elapsed += delegate {
progress_bar.Pulse ();
};
layout_vertical.PackStart (box, false, false, 0);
layout_vertical.PackStart (progress_bar, true, false, 0);
timer.Start ();
Add (layout_vertical);
@ -725,7 +698,7 @@ namespace SparkleShare {
Button finish_button = new Button (_("Finish"));
finish_button.Clicked += delegate (object o, EventArgs args) {
Destroy ();
Close ();
};
AddButton (finish_button);

View file

@ -203,8 +203,18 @@ namespace SparkleShare {
sync_item.Activated += delegate {
Application.Invoke (delegate {
SparkleIntro intro = new SparkleIntro ();
intro.ShowServerForm (true);
if (SparkleUI.Intro == null) {
SparkleUI.Intro = new SparkleIntro ();
SparkleUI.Intro.ShowServerForm (true);
}
if (!SparkleUI.Intro.Visible)
SparkleUI.Intro.ShowServerForm (true);
SparkleUI.Intro.ShowAll ();
SparkleUI.Intro.Present ();
});
};

View file

@ -34,6 +34,7 @@ namespace SparkleShare {
public static SparkleStatusIcon StatusIcon;
public static List <SparkleLog> OpenLogs;
public static SparkleIntro Intro;
// Short alias for the translations
@ -57,8 +58,8 @@ namespace SparkleShare {
if (SparkleShare.Controller.FirstRun) {
SparkleIntro intro = new SparkleIntro ();
intro.ShowAccountForm ();
Intro = new SparkleIntro ();
Intro.ShowAccountForm ();
}

View file

@ -39,10 +39,17 @@ namespace SparkleShare {
BorderWidth = 0;
IconName = "folder-sparkleshare";
Resizable = true;
WindowPosition = WindowPosition.Center;
Resizable = false;
WindowPosition = WindowPosition.Center; // FIXME: seems to have broken
SetDefaultSize (640, 425);
SetSizeRequest (680, 440);
DeleteEvent += delegate (object o, DeleteEventArgs args) {
args.RetVal = true;
Close ();
};
HBox = new HBox (false, 6);
@ -71,7 +78,7 @@ namespace SparkleShare {
box.Add (side_splash);
HBox.PackStart (box, true, true, 0);
HBox.PackStart (box, false, false, 0);
HBox.PackStart (VBox, true, true, 0);
base.Add (HBox);
@ -130,6 +137,13 @@ namespace SparkleShare {
}
public void Close ()
{
HideAll ();
}
}
}