[ui][controller] Fix intro screen not popping up on first run
This commit is contained in:
parent
76d80d9aad
commit
46f35e3707
|
@ -29,6 +29,7 @@ namespace SparkleShare {
|
|||
|
||||
public List <SparkleRepo> Repositories;
|
||||
public string FolderSize;
|
||||
public bool FirstRun;
|
||||
|
||||
|
||||
public event OnQuitWhileSyncingEventHandler OnQuitWhileSyncing;
|
||||
|
@ -120,11 +121,11 @@ namespace SparkleShare {
|
|||
// Show the introduction screen if SparkleShare isn't configured
|
||||
if (!File.Exists (global_config_file_path)) {
|
||||
|
||||
if (OnFirstRun != null)
|
||||
OnFirstRun ();
|
||||
FirstRun = true;
|
||||
|
||||
} else {
|
||||
|
||||
FirstRun = false;
|
||||
AddKey ();
|
||||
|
||||
}
|
||||
|
@ -720,12 +721,13 @@ namespace SparkleShare {
|
|||
|
||||
};
|
||||
|
||||
fetcher.Clone ();
|
||||
fetcher.Start ();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Quits the program
|
||||
// Checks whether there are any folders syncing and
|
||||
// quits if safe
|
||||
public void TryQuit ()
|
||||
{
|
||||
|
||||
|
@ -747,6 +749,7 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
// Quits the program
|
||||
public void Quit ()
|
||||
{
|
||||
|
||||
|
|
|
@ -53,14 +53,13 @@ namespace SparkleShare {
|
|||
// Keep track of which event logs are open
|
||||
SparkleUI.OpenLogs = new List <SparkleLog> ();
|
||||
|
||||
SparkleShare.Controller.OnFirstRun += delegate {
|
||||
Application.Invoke (delegate {
|
||||
if (SparkleShare.Controller.FirstRun) {
|
||||
|
||||
SparkleIntro intro = new SparkleIntro ();
|
||||
intro.ShowAll ();
|
||||
intro.Present ();
|
||||
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
SparkleShare.Controller.OnQuitWhileSyncing += delegate {
|
||||
// TODO: Pop up a warning when quitting whilst syncing
|
||||
|
|
Loading…
Reference in a new issue