start sanitising ui code a bit
This commit is contained in:
parent
56e510f70c
commit
8b8c50e6fb
2
Makefile
2
Makefile
|
@ -11,7 +11,7 @@ install:
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm /usr/local/bin/sparklepony
|
rm /usr/local/bin/sparklepony
|
||||||
rm /usr/local/sparklepony/SparklePony.exe
|
rm /usr/local/share/sparklepony/SparklePony.exe
|
||||||
rmdir /usr/local/share/sparklepony
|
rmdir /usr/local/share/sparklepony
|
||||||
rm /usr/share/icons/hicolor/*x*/places/folder-publicshare.png
|
rm /usr/share/icons/hicolor/*x*/places/folder-publicshare.png
|
||||||
|
|
||||||
|
|
|
@ -273,7 +273,7 @@ public class Repository {
|
||||||
// Delay for a few seconds to see if more files change
|
// Delay for a few seconds to see if more files change
|
||||||
BufferTimer.Interval = Interval;
|
BufferTimer.Interval = Interval;
|
||||||
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) { Add (); } ;
|
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) { Add (); } ;
|
||||||
Console.WriteLine ("Waiting for more changes...");
|
Console.WriteLine ("[Buffer] Waiting for more changes...");
|
||||||
BufferTimer.Start();
|
BufferTimer.Start();
|
||||||
} else {
|
} else {
|
||||||
// Extend the delay when something changes
|
// Extend the delay when something changes
|
||||||
|
@ -282,17 +282,15 @@ public class Repository {
|
||||||
BufferTimer.Interval = 3000;
|
BufferTimer.Interval = 3000;
|
||||||
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) { Add (); } ;
|
BufferTimer.Elapsed += delegate (object o, ElapsedEventArgs args) { Add (); } ;
|
||||||
BufferTimer.Start();
|
BufferTimer.Start();
|
||||||
Console.WriteLine ("Waiting for more changes...");
|
Console.WriteLine ("[Buffer] Waiting for more changes...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFileActivity (object o, FileSystemEventArgs args) {
|
public void OnFileActivity (object o, FileSystemEventArgs args) {
|
||||||
WatcherChangeTypes wct = args.ChangeType;
|
WatcherChangeTypes wct = args.ChangeType;
|
||||||
if (!ShouldIgnore (args.Name)) {
|
if (!ShouldIgnore (args.Name)) {
|
||||||
Console.WriteLine(wct.ToString() + " '" + args.Name + "'");
|
Console.WriteLine("[Event] " + wct.ToString() + " '" + args.Name + "'");
|
||||||
StartBufferTimer ();
|
StartBufferTimer ();
|
||||||
} else {
|
|
||||||
// Console.WriteLine("[ignore] " + wct.ToString() + " '" + args.Name + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,19 +302,18 @@ public class Repository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Add () {
|
public void Add () {
|
||||||
Console.WriteLine ("Done waiting.");
|
Console.WriteLine ("[Buffer] Done waiting.");
|
||||||
BufferTimer.Stop ();
|
BufferTimer.Stop ();
|
||||||
Console.WriteLine ("Staging changes...");
|
Console.WriteLine ("[Git] Staging changes...");
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "add --all";
|
Process.StartInfo.Arguments = "add --all";
|
||||||
Process.Start();
|
Process.Start();
|
||||||
// TODO: Format the commit message here
|
// TODO: Format the commit message here
|
||||||
// TODO: Only commit if there are changes
|
|
||||||
Commit ("Stuff happened");
|
Commit ("Stuff happened");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Commit (string Message) {
|
public void Commit (string Message) {
|
||||||
Console.WriteLine ("Commiting changes...");
|
Console.WriteLine ("[Git] Commiting changes...");
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "commit -m '" + Message + "'";
|
Process.StartInfo.Arguments = "commit -m '" + Message + "'";
|
||||||
ShowNotification ("Stuff happened", "");
|
ShowNotification ("Stuff happened", "");
|
||||||
|
@ -326,7 +323,7 @@ public class Repository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Fetch () {
|
public void Fetch () {
|
||||||
Console.WriteLine ("Fetching changes...");
|
Console.WriteLine ("[Git] Fetching changes...");
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "fetch";
|
Process.StartInfo.Arguments = "fetch";
|
||||||
Process.Start();
|
Process.Start();
|
||||||
|
@ -334,7 +331,7 @@ public class Repository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Fetch (object o, ElapsedEventArgs args) {
|
public void Fetch (object o, ElapsedEventArgs args) {
|
||||||
Console.WriteLine ("Fetching changes...");
|
Console.WriteLine ("[Git] Fetching changes...");
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "fetch";
|
Process.StartInfo.Arguments = "fetch";
|
||||||
Process.Start();
|
Process.Start();
|
||||||
|
@ -343,7 +340,7 @@ public class Repository {
|
||||||
|
|
||||||
public void Merge () {
|
public void Merge () {
|
||||||
Watcher.EnableRaisingEvents = false;
|
Watcher.EnableRaisingEvents = false;
|
||||||
Console.WriteLine ("Merging fetched changes...");
|
Console.WriteLine ("[Git] Merging fetched changes...");
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "merge origin/master";
|
Process.StartInfo.Arguments = "merge origin/master";
|
||||||
Process.Start();
|
Process.Start();
|
||||||
|
@ -357,7 +354,7 @@ public class Repository {
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "push";
|
Process.StartInfo.Arguments = "push";
|
||||||
Process.Start();
|
Process.Start();
|
||||||
Console.WriteLine ("Pushing changes...");
|
Console.WriteLine ("[Git] Pushing changes...");
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,27 +414,26 @@ public class SparklePonyWindow : Window {
|
||||||
|
|
||||||
HBox AddRemoveButtons = new HBox ();
|
HBox AddRemoveButtons = new HBox ();
|
||||||
Button AddButton = new Button ("Add...");
|
Button AddButton = new Button ("Add...");
|
||||||
Button RemoveButton = new Button ("Remove");
|
|
||||||
|
|
||||||
AddRemoveButtons.PackStart (AddButton, true, true, 0);
|
AddRemoveButtons.PackStart (AddButton, true, true, 0);
|
||||||
|
Button RemoveButton = new Button ("Remove");
|
||||||
AddRemoveButtons.PackStart (RemoveButton, false, false, 0);
|
AddRemoveButtons.PackStart (RemoveButton, false, false, 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ListStore LogStore = new ListStore (typeof (string), typeof (string));
|
||||||
|
|
||||||
|
|
||||||
Process Process = new Process();
|
Process Process = new Process();
|
||||||
Process.EnableRaisingEvents = false;
|
Process.EnableRaisingEvents = false;
|
||||||
Process.StartInfo.RedirectStandardOutput = true;
|
Process.StartInfo.RedirectStandardOutput = true;
|
||||||
Process.StartInfo.UseShellExecute = false;
|
Process.StartInfo.UseShellExecute = false;
|
||||||
|
|
||||||
// TODO: fix hard coding, system independant
|
// TODO: fix hard coding, system independant
|
||||||
Process.StartInfo.WorkingDirectory = "/home/hbons/Collaboration/Deal";
|
Process.StartInfo.WorkingDirectory = "/home/hbons/Collaboration/Deal";
|
||||||
|
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
Process.StartInfo.Arguments = "log --pretty=oneline -20";
|
Process.StartInfo.Arguments = "log --pretty=oneline -20";
|
||||||
Process.Start();
|
Process.Start();
|
||||||
|
|
||||||
string Output = Process.StandardOutput.ReadToEnd().Trim ();
|
string Output = Process.StandardOutput.ReadToEnd().Trim ();
|
||||||
|
|
||||||
ListStore LogStore = new ListStore (typeof (string), typeof (string));
|
|
||||||
|
|
||||||
foreach (string Message in Regex.Split (Output, "\n"))
|
foreach (string Message in Regex.Split (Output, "\n"))
|
||||||
LogStore.AppendValues ("", "2 hours ago");
|
LogStore.AppendValues ("", "2 hours ago");
|
||||||
|
|
||||||
|
@ -493,28 +489,30 @@ public class SparklePonyWindow : Window {
|
||||||
LayoutVerticalRight.PackStart (Table, false, false, 24);
|
LayoutVerticalRight.PackStart (Table, false, false, 24);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HBox LayoutHorizontal = new HBox (false, 12);
|
HBox LayoutHorizontal = new HBox (false, 12);
|
||||||
LayoutHorizontal.PackStart (LayoutVerticalLeft, false, false, 0);
|
LayoutHorizontal.PackStart (LayoutVerticalLeft, false, false, 0);
|
||||||
LayoutHorizontal.PackStart (LayoutVerticalRight, true, true, 0);
|
LayoutHorizontal.PackStart (LayoutVerticalRight, true, true, 0);
|
||||||
|
|
||||||
Notebook Notebook = new Notebook ();
|
Notebook Notebook = new Notebook ();
|
||||||
|
Notebook.BorderWidth = 6;
|
||||||
Notebook.AppendPage (LayoutHorizontal, new Label ("Folders"));
|
Notebook.AppendPage (LayoutHorizontal, new Label ("Folders"));
|
||||||
Notebook.AppendPage (ScrolledWindow, new Label ("Events"));
|
Notebook.AppendPage (ScrolledWindow, new Label ("Events"));
|
||||||
|
|
||||||
|
|
||||||
VBox LayoutVertical = new VBox (false, 0);
|
|
||||||
Button CloseButton = new Button (Stock.Close);
|
|
||||||
|
|
||||||
HButtonBox DialogButtons = new HButtonBox ();
|
HButtonBox DialogButtons = new HButtonBox ();
|
||||||
DialogButtons.BorderWidth = 6;
|
DialogButtons.BorderWidth = 6;
|
||||||
Notebook.BorderWidth = 6;
|
|
||||||
Button QuitButton = new Button ("Quit Service");
|
Button QuitButton = new Button ("Quit Service");
|
||||||
QuitButton.Clicked += Quit;
|
QuitButton.Clicked += Quit;
|
||||||
DialogButtons.Add (QuitButton);
|
DialogButtons.Add (QuitButton);
|
||||||
|
|
||||||
|
Button CloseButton = new Button (Stock.Close);
|
||||||
|
CloseButton.Clicked += delegate (object o, EventArgs args) { HideAll (); Visibility = false; };
|
||||||
DialogButtons.Add (CloseButton);
|
DialogButtons.Add (CloseButton);
|
||||||
|
|
||||||
CloseButton.Clicked += delegate (object o, EventArgs args) { HideAll (); Visibility = false; };
|
VBox LayoutVertical = new VBox (false, 0);
|
||||||
LayoutVertical.PackStart (Notebook, true, true, 0);
|
LayoutVertical.PackStart (Notebook, true, true, 0);
|
||||||
LayoutVertical.PackStart (DialogButtons, false, false, 0);
|
LayoutVertical.PackStart (DialogButtons, false, false, 0);
|
||||||
Add (LayoutVertical);
|
Add (LayoutVertical);
|
||||||
|
@ -528,6 +526,22 @@ public class SparklePonyWindow : Window {
|
||||||
Application.Quit ();
|
Application.Quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CreateRepoList() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateRepoList() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateEventLog() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateEventLog() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void ToggleVisibility() {
|
public void ToggleVisibility() {
|
||||||
if (Visibility) {
|
if (Visibility) {
|
||||||
if (HasFocus)
|
if (HasFocus)
|
||||||
|
|
|
@ -22,7 +22,7 @@ if [[ "$1" == "stop" ]]; then
|
||||||
echo -n "Stopping SparklePony..."
|
echo -n "Stopping SparklePony..."
|
||||||
kill `cat /tmp/sparklepony/sparklepony.pid`
|
kill `cat /tmp/sparklepony/sparklepony.pid`
|
||||||
rm -f /tmp/sparklepony/sparklepony.pid
|
rm -f /tmp/sparklepony/sparklepony.pid
|
||||||
echo "Done."
|
echo " Done."
|
||||||
else
|
else
|
||||||
echo "SparklePony isn't running."
|
echo "SparklePony isn't running."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue