[ui][controller] Fix intro screen not popping up on first run

This commit is contained in:
Hylke Bons 2010-11-19 23:25:47 +00:00
parent 76d80d9aad
commit 46f35e3707
2 changed files with 12 additions and 10 deletions

View file

@ -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 ();
} }
@ -136,8 +137,8 @@ namespace SparkleShare {
thread.Start (); thread.Start ();
} }
// Creates a folder in the user's home folder to store configuration // Creates a folder in the user's home folder to store configuration
private void CreateConfigurationFolders () private void CreateConfigurationFolders ()
{ {
@ -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 ()
{ {

View file

@ -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