update help a bit
This commit is contained in:
parent
f0b70537df
commit
987b579b4e
|
@ -72,6 +72,13 @@ public class SparklePony {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ShowHelp () {
|
public static void ShowHelp () {
|
||||||
|
Console.WriteLine ("SparklePony Copyright (C) 2010 Hylke Bons");
|
||||||
|
Console.WriteLine ("This program comes with ABSOLUTELY NO WARRANTY.");
|
||||||
|
Console.WriteLine ("This is free software, and you are welcome to redistribute it ");
|
||||||
|
Console.WriteLine ("under certain conditions. Please read the GNU GPLv3 for details.");
|
||||||
|
Console.WriteLine ("");
|
||||||
|
Console.WriteLine ("SparklePony syncs the ~/Collaboration folder with remote repositories.");
|
||||||
|
Console.WriteLine ("");
|
||||||
Console.WriteLine ("Usage: sparklepony [start|stop|restart] [OPTION]...");
|
Console.WriteLine ("Usage: sparklepony [start|stop|restart] [OPTION]...");
|
||||||
Console.WriteLine ("Sync Collaboration folder with remote repositories.");
|
Console.WriteLine ("Sync Collaboration folder with remote repositories.");
|
||||||
Console.WriteLine ("");
|
Console.WriteLine ("");
|
||||||
|
@ -88,7 +95,7 @@ public class SparklePonyUI {
|
||||||
|
|
||||||
public SparklePonyWindow SparklePonyWindow;
|
public SparklePonyWindow SparklePonyWindow;
|
||||||
public SparklePonyStatusIcon SparklePonyStatusIcon;
|
public SparklePonyStatusIcon SparklePonyStatusIcon;
|
||||||
public string FoldersPath;
|
public string ReposPath;
|
||||||
public string UserHome;
|
public string UserHome;
|
||||||
public Repository [] Repositories;
|
public Repository [] Repositories;
|
||||||
|
|
||||||
|
@ -103,18 +110,18 @@ public class SparklePonyUI {
|
||||||
UserHome = Environment.GetEnvironmentVariable("HOME");
|
UserHome = Environment.GetEnvironmentVariable("HOME");
|
||||||
|
|
||||||
// Create 'Collaboration' folder in the user's home folder
|
// Create 'Collaboration' folder in the user's home folder
|
||||||
FoldersPath = UserHome + "/Collaboration";
|
ReposPath = UserHome + "/Collaboration";
|
||||||
if (!Directory.Exists (FoldersPath)) {
|
if (!Directory.Exists (ReposPath)) {
|
||||||
Directory.CreateDirectory (FoldersPath);
|
Directory.CreateDirectory (ReposPath);
|
||||||
Console.WriteLine ("Created '" + FoldersPath + "'");
|
Console.WriteLine ("Created '" + ReposPath + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all the folders in ~/Collaboration
|
// Get all the Repos in ~/Collaboration
|
||||||
string [] Folders = Directory.GetDirectories (FoldersPath);
|
string [] Repos = Directory.GetDirectories (ReposPath);
|
||||||
Repositories = new Repository [Folders.Length];
|
Repositories = new Repository [Repos.Length];
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (string Folder in Folders) {
|
foreach (string Folder in Repos) {
|
||||||
Repositories [i] = new Repository (Folder);
|
Repositories [i] = new Repository (Folder);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -377,7 +384,7 @@ public class Repository {
|
||||||
Process.WaitForExit ();
|
Process.WaitForExit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore folders, dotfiles, swap files and the like.
|
// Ignore Repos, dotfiles, swap files and the like.
|
||||||
public bool ShouldIgnore (string s) {
|
public bool ShouldIgnore (string s) {
|
||||||
if (s.Substring (0, 1).Equals (".") ||
|
if (s.Substring (0, 1).Equals (".") ||
|
||||||
s.Contains (".lock") ||
|
s.Contains (".lock") ||
|
||||||
|
@ -464,11 +471,6 @@ public class Repository {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: To UI
|
|
||||||
public string [] GetPeopleList () {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can potentially be moved from this class as well
|
// Can potentially be moved from this class as well
|
||||||
public void ShowNotification (string Title, string SubText) {
|
public void ShowNotification (string Title, string SubText) {
|
||||||
Notification Notification = new Notification (Title, SubText);
|
Notification Notification = new Notification (Title, SubText);
|
||||||
|
@ -499,20 +501,20 @@ public class SparklePonyWindow : Window {
|
||||||
BorderWidth = 6;
|
BorderWidth = 6;
|
||||||
IconName = "folder-remote";
|
IconName = "folder-remote";
|
||||||
|
|
||||||
ListStore FoldersStore = new ListStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));
|
ListStore ReposStore = new ListStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));
|
||||||
string RemoteFolderIcon = "/usr/share/icons/gnome/16x16/places/folder.png";
|
string RemoteFolderIcon = "/usr/share/icons/gnome/16x16/places/folder.png";
|
||||||
|
|
||||||
TreeIter Iter2;
|
TreeIter Iter2;
|
||||||
|
|
||||||
foreach (Repository Repository in Repositories) {
|
foreach (Repository Repository in Repositories) {
|
||||||
Iter2 = FoldersStore.Prepend ();
|
Iter2 = ReposStore.Prepend ();
|
||||||
FoldersStore.SetValue (Iter2, 1, null);
|
ReposStore.SetValue (Iter2, 1, null);
|
||||||
FoldersStore.SetValue (Iter2, 1, Repository.Name);
|
ReposStore.SetValue (Iter2, 1, Repository.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeView FoldersView = new TreeView (FoldersStore);
|
TreeView ReposView = new TreeView (ReposStore);
|
||||||
FoldersView.AppendColumn ("", new CellRendererPixbuf () , "pixbuf", 0);
|
ReposView.AppendColumn ("", new CellRendererPixbuf () , "pixbuf", 0);
|
||||||
FoldersView.AppendColumn ("", new Gtk.CellRendererText (), "text", 1);
|
ReposView.AppendColumn ("", new Gtk.CellRendererText (), "text", 1);
|
||||||
|
|
||||||
HBox AddRemoveButtons = new HBox ();
|
HBox AddRemoveButtons = new HBox ();
|
||||||
Button AddButton = new Button ("Add...");
|
Button AddButton = new Button ("Add...");
|
||||||
|
@ -530,8 +532,8 @@ public class SparklePonyWindow : Window {
|
||||||
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
|
|
||||||
Process.StartInfo.WorkingDirectory = Environment.GetEnvironmentVariable("HOME") + "/Collaboration/Deal";
|
Process.StartInfo.WorkingDirectory = Environment.GetEnvironmentVariable("HOME") + "/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();
|
||||||
|
@ -565,7 +567,7 @@ public class SparklePonyWindow : Window {
|
||||||
ScrolledWindow.BorderWidth = 12;
|
ScrolledWindow.BorderWidth = 12;
|
||||||
|
|
||||||
VBox LayoutVerticalLeft = new VBox (false, 0);
|
VBox LayoutVerticalLeft = new VBox (false, 0);
|
||||||
LayoutVerticalLeft.PackStart (FoldersView, true, true, 0);
|
LayoutVerticalLeft.PackStart (ReposView, true, true, 0);
|
||||||
LayoutVerticalLeft.PackStart (AddRemoveButtons, false, false, 0);
|
LayoutVerticalLeft.PackStart (AddRemoveButtons, false, false, 0);
|
||||||
|
|
||||||
LayoutVerticalLeft.BorderWidth = 12;
|
LayoutVerticalLeft.BorderWidth = 12;
|
||||||
|
@ -614,7 +616,7 @@ public class SparklePonyWindow : Window {
|
||||||
|
|
||||||
Notebook Notebook = new Notebook ();
|
Notebook Notebook = new Notebook ();
|
||||||
Notebook.BorderWidth = 6;
|
Notebook.BorderWidth = 6;
|
||||||
Notebook.AppendPage (LayoutHorizontal, new Label ("Folders"));
|
Notebook.AppendPage (LayoutHorizontal, new Label ("Repos"));
|
||||||
Notebook.AppendPage (ScrolledWindow, new Label ("Events"));
|
Notebook.AppendPage (ScrolledWindow, new Label ("Events"));
|
||||||
|
|
||||||
|
|
||||||
|
@ -661,6 +663,14 @@ public class SparklePonyWindow : Window {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CreatePeopleList () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePeopleList () {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void ToggleVisibility() {
|
public void ToggleVisibility() {
|
||||||
if (Visibility) {
|
if (Visibility) {
|
||||||
if (HasFocus)
|
if (HasFocus)
|
||||||
|
|
Loading…
Reference in a new issue