history: implement back button
This commit is contained in:
parent
3c74466898
commit
73d0f496d2
|
@ -475,6 +475,7 @@ namespace SparkleLib.Git {
|
|||
foreach (string line in lines) {
|
||||
string conflicting_path = line.Substring (3);
|
||||
conflicting_path = EnsureSpecialCharacters (conflicting_path);
|
||||
conflicting_path = conflicting_path.Replace ("\"", "\\\"");
|
||||
|
||||
SparkleLogger.LogInfo ("Git", Name + " | Conflict type: " + line);
|
||||
|
||||
|
@ -553,8 +554,6 @@ namespace SparkleLib.Git {
|
|||
|
||||
if (revision == null)
|
||||
throw new ArgumentNullException ("revision");
|
||||
|
||||
path = path.Replace ("\\", "/");
|
||||
|
||||
SparkleLogger.LogInfo ("Git", Name + " | Restoring \"" + path + "\" (revision " + revision + ")");
|
||||
|
||||
|
@ -582,6 +581,8 @@ namespace SparkleLib.Git {
|
|||
|
||||
// The correct way
|
||||
} else {
|
||||
path = path.Replace ("\"", "\\\"");
|
||||
|
||||
SparkleGit git = new SparkleGit (LocalPath, "show " + revision + ":\"" + path + "\"");
|
||||
git.Start ();
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
small, small a {
|
||||
small, small a, small a:hover {
|
||||
font-size: <!-- $small-font-size -->;
|
||||
color: <!-- $secondary-font-color -->;
|
||||
}
|
||||
|
@ -107,6 +107,14 @@
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.history-header {
|
||||
color: #aaa;
|
||||
padding-top: 22px;
|
||||
font-weight: bold;
|
||||
float: left;
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
.event-entry {
|
||||
padding: 24px 14px 14px 64px;
|
||||
margin: 0 32px 0 32px;
|
||||
|
|
|
@ -80,6 +80,7 @@ namespace SparkleShare {
|
|||
new SizeF (ContentView.Frame.Width, ContentView.Frame.Height - 39))
|
||||
};
|
||||
|
||||
|
||||
this.hidden_close_button = new NSButton () {
|
||||
KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask,
|
||||
KeyEquivalent = "w"
|
||||
|
@ -397,7 +398,7 @@ namespace SparkleShare {
|
|||
|
||||
this.web_view.MainFrame.LoadHtmlString (html, new NSUrl (""));
|
||||
|
||||
web_view.PolicyDelegate = new SparkleWebPolicyDelegate ();
|
||||
this.web_view.PolicyDelegate = new SparkleWebPolicyDelegate ();
|
||||
ContentView.AddSubview (this.web_view);
|
||||
|
||||
(this.web_view.PolicyDelegate as SparkleWebPolicyDelegate).LinkClicked +=
|
||||
|
|
|
@ -86,8 +86,6 @@ namespace SparkleShare {
|
|||
|
||||
public string HTML {
|
||||
get {
|
||||
this.history_view_active = false;
|
||||
|
||||
List<SparkleChangeSet> change_sets = GetLog (this.selected_folder);
|
||||
string html = GetHTMLLog (change_sets);
|
||||
|
||||
|
@ -255,12 +253,12 @@ namespace SparkleShare {
|
|||
|
||||
ShowSaveDialogEvent (file_name, target_folder_path);
|
||||
|
||||
} else {
|
||||
// TODO: remove
|
||||
Program.UI.Bubbles.Controller.ShowBubble ("no match", url, "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else if (url.StartsWith ("back://")) {
|
||||
this.history_view_active = false;
|
||||
SelectedFolder = this.selected_folder; // TODO: Return to the same position on the page
|
||||
|
||||
} else if (url.StartsWith ("history://")) {
|
||||
this.history_view_active = true;
|
||||
|
||||
|
@ -281,19 +279,17 @@ namespace SparkleShare {
|
|||
|
||||
watch.Start ();
|
||||
|
||||
List<SparkleChangeSet> change_sets = repo.GetChangeSets (path, 30);
|
||||
List<SparkleChangeSet> change_sets = repo.GetChangeSets (path, 30);
|
||||
|
||||
if (change_sets.Count > 1) {
|
||||
html += "<div class='day-entry-header'>Revisions for “";
|
||||
html += Path.GetFileName (path) + "”</div>";
|
||||
|
||||
} else {
|
||||
html += "<div class='day-entry-header'>No revisions yet for “";
|
||||
html += Path.GetFileName (path) + "”</div>";
|
||||
}
|
||||
html += "<div class='history-header'><a href='back://'>« Back</a> | ";
|
||||
|
||||
html += "<b>« Back</b>";
|
||||
html += "<table>";
|
||||
if (change_sets.Count > 1)
|
||||
html += "Revisions for “";
|
||||
else
|
||||
html += "No revisions for “";
|
||||
|
||||
html += Path.GetFileName (path) + "”";
|
||||
html += "</div><table>";
|
||||
|
||||
int count = 0;
|
||||
foreach (SparkleChangeSet change_set in change_sets) {
|
||||
|
|
Loading…
Reference in a new issue