[ui] allow adding repos by hand whilst running

This commit is contained in:
Hylke Bons 2010-08-08 15:45:28 +01:00
parent 0a0b9d1786
commit 47b27f45c6
3 changed files with 26 additions and 5 deletions

View file

@ -125,7 +125,7 @@ namespace SparkleLib {
// Add everything that changed
// since SparkleShare was stopped TODO: Push if there are changes
// since SparkleShare was stopped
AddCommitAndPush ();
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Idling...");
@ -427,8 +427,18 @@ namespace SparkleLib {
}
public void Stop ()
{
FetchTimer.Stop ();
BufferTimer.Stop ();
}
// Ignores repos, dotfiles, swap files and the like.
private bool ShouldIgnore (string file_name) {
private bool ShouldIgnore (string file_name)
{
if (file_name [0].Equals (".") ||
file_name.Contains (".lock") ||

View file

@ -359,6 +359,7 @@ namespace SparkleShare {
name += ".git";
string canonical_name = System.IO.Path.GetFileNameWithoutExtension (name);
FolderEntry.Text = canonical_name;
string url = server + "/" + name;
string tmp_folder = SparkleHelpers.CombineMore (SparklePaths.SparkleTmpPath,
@ -553,7 +554,7 @@ namespace SparkleShare {
};
Label header = new Label ("<span size='x-large'><b>" +
_("Folder successfully retrieved!") +
_("Folder synced successfully!") +
"</b></span>") {
UseMarkup = true,
Xalign = 0
@ -619,7 +620,7 @@ namespace SparkleShare {
};
Label header = new Label ("<span size='x-large'><b>" +
String.Format (_("Retrieving folder {0}’…"), FolderEntry.Text) +
String.Format (_("Syncing folder {0}’…"), FolderEntry.Text) +
"</b></span>") {
UseMarkup = true,
Xalign = 0,

View file

@ -69,7 +69,6 @@ namespace SparkleShare {
// Watch the SparkleShare folder and update the repo list
// when a deletion occurs.
FileSystemWatcher watcher = new FileSystemWatcher (SparklePaths.SparklePath) {
IncludeSubdirectories = false,
EnableRaisingEvents = true,
@ -77,7 +76,18 @@ namespace SparkleShare {
};
watcher.Deleted += delegate {
foreach (SparkleRepo repo in Repositories)
repo.Stop ();
Application.Invoke (delegate { UpdateRepositories (); } );
};
watcher.Created += delegate {
Application.Invoke (delegate {UpdateRepositories (); } );
};