[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 List <SparkleRepo> Repositories;
|
||||||
public string FolderSize;
|
public string FolderSize;
|
||||||
|
public bool FirstRun;
|
||||||
|
|
||||||
|
|
||||||
public event OnQuitWhileSyncingEventHandler OnQuitWhileSyncing;
|
public event OnQuitWhileSyncingEventHandler OnQuitWhileSyncing;
|
||||||
|
@ -120,11 +121,11 @@ namespace SparkleShare {
|
||||||
// Show the introduction screen if SparkleShare isn't configured
|
// Show the introduction screen if SparkleShare isn't configured
|
||||||
if (!File.Exists (global_config_file_path)) {
|
if (!File.Exists (global_config_file_path)) {
|
||||||
|
|
||||||
if (OnFirstRun != null)
|
FirstRun = true;
|
||||||
OnFirstRun ();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
FirstRun = false;
|
||||||
AddKey ();
|
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 ()
|
public void TryQuit ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -747,6 +749,7 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Quits the program
|
||||||
public void Quit ()
|
public void Quit ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -53,14 +53,13 @@ namespace SparkleShare {
|
||||||
// Keep track of which event logs are open
|
// Keep track of which event logs are open
|
||||||
SparkleUI.OpenLogs = new List <SparkleLog> ();
|
SparkleUI.OpenLogs = new List <SparkleLog> ();
|
||||||
|
|
||||||
SparkleShare.Controller.OnFirstRun += delegate {
|
if (SparkleShare.Controller.FirstRun) {
|
||||||
Application.Invoke (delegate {
|
|
||||||
|
|
||||||
SparkleIntro intro = new SparkleIntro ();
|
SparkleIntro intro = new SparkleIntro ();
|
||||||
intro.ShowAll ();
|
intro.ShowAll ();
|
||||||
|
intro.Present ();
|
||||||
|
|
||||||
});
|
}
|
||||||
};
|
|
||||||
|
|
||||||
SparkleShare.Controller.OnQuitWhileSyncing += delegate {
|
SparkleShare.Controller.OnQuitWhileSyncing += delegate {
|
||||||
// TODO: Pop up a warning when quitting whilst syncing
|
// TODO: Pop up a warning when quitting whilst syncing
|
||||||
|
|
Loading…
Reference in a new issue