[log] update on new commits and open new logs off centre
This commit is contained in:
parent
ef9ea54bbc
commit
62d4b97fff
|
@ -53,8 +53,17 @@ namespace SparkleShare {
|
||||||
string name = System.IO.Path.GetFileName (LocalPath);
|
string name = System.IO.Path.GetFileName (LocalPath);
|
||||||
SetDefaultSize (480, 640);
|
SetDefaultSize (480, 640);
|
||||||
|
|
||||||
SetPosition (WindowPosition.Center);
|
|
||||||
BorderWidth = 0;
|
BorderWidth = 0;
|
||||||
|
SetPosition (WindowPosition.Center);
|
||||||
|
|
||||||
|
// Open slightly off center for each consecutive window
|
||||||
|
if (SparkleUI.OpenLogs.Count > 0) {
|
||||||
|
|
||||||
|
int x, y;
|
||||||
|
GetPosition (out x, out y);
|
||||||
|
Move (x + SparkleUI.OpenLogs.Count * 20, y + SparkleUI.OpenLogs.Count * 20);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// TRANSLATORS: {0} is a folder name, and {1} is a server address
|
// TRANSLATORS: {0} is a folder name, and {1} is a server address
|
||||||
Title = String.Format(_("Events in ‘{0}’"), name);
|
Title = String.Format(_("Events in ‘{0}’"), name);
|
||||||
|
@ -64,18 +73,14 @@ namespace SparkleShare {
|
||||||
Close ();
|
Close ();
|
||||||
};
|
};
|
||||||
|
|
||||||
CreateEventLog ();
|
|
||||||
UpdateEventLog ();
|
|
||||||
|
|
||||||
LayoutVertical = new VBox (false, 0);
|
LayoutVertical = new VBox (false, 0);
|
||||||
|
|
||||||
ScrolledWindow = new ScrolledWindow ();
|
CreateEventLog ();
|
||||||
|
|
||||||
ScrolledWindow.AddWithViewport (WebView);
|
|
||||||
(ScrolledWindow.Child as Viewport).ShadowType = ShadowType.None;
|
|
||||||
|
|
||||||
LayoutVertical.PackStart (ScrolledWindow, true, true, 0);
|
LayoutVertical.PackStart (ScrolledWindow, true, true, 0);
|
||||||
|
|
||||||
|
UpdateEventLog ();
|
||||||
|
|
||||||
HButtonBox dialog_buttons = new HButtonBox {
|
HButtonBox dialog_buttons = new HButtonBox {
|
||||||
Layout = ButtonBoxStyle.Edge,
|
Layout = ButtonBoxStyle.Edge,
|
||||||
BorderWidth = 12
|
BorderWidth = 12
|
||||||
|
@ -103,17 +108,12 @@ namespace SparkleShare {
|
||||||
dialog_buttons.Add (open_folder_button);
|
dialog_buttons.Add (open_folder_button);
|
||||||
dialog_buttons.Add (close_button);
|
dialog_buttons.Add (close_button);
|
||||||
|
|
||||||
LayoutVertical.PackStart (new HSeparator (), false, false, 0);
|
|
||||||
|
|
||||||
// We have to hide the menubar somewhere...
|
// We have to hide the menubar somewhere...
|
||||||
LayoutVertical.PackStart (CreateShortcutsBar (), false, false, 0);
|
LayoutVertical.PackStart (CreateShortcutsBar (), false, false, 0);
|
||||||
LayoutVertical.PackStart (dialog_buttons, false, false, 0);
|
LayoutVertical.PackStart (dialog_buttons, false, false, 0);
|
||||||
|
|
||||||
Add (LayoutVertical);
|
Add (LayoutVertical);
|
||||||
|
|
||||||
CreateEventLog ();
|
|
||||||
UpdateEventLog ();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,6 +142,9 @@ namespace SparkleShare {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ScrolledWindow = new ScrolledWindow ();
|
||||||
|
ScrolledWindow.AddWithViewport (WebView);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,7 +164,18 @@ namespace SparkleShare {
|
||||||
SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons",
|
SparkleHelpers.CombineMore (Defines.PREFIX, "share", "sparkleshare", "icons",
|
||||||
"hicolor", "32x32", "status", "avatar-default.png"));
|
"hicolor", "32x32", "status", "avatar-default.png"));
|
||||||
|
|
||||||
WebView.LoadHtmlString (html, "file://");
|
WebView.LoadString (html, null, null, "file://");
|
||||||
|
|
||||||
|
LayoutVertical.Remove (ScrolledWindow);
|
||||||
|
ScrolledWindow = new ScrolledWindow ();
|
||||||
|
Viewport viewport = new Viewport ();
|
||||||
|
WebView.Reparent (viewport);
|
||||||
|
ScrolledWindow.Add (viewport);
|
||||||
|
(ScrolledWindow.Child as Viewport).ShadowType = ShadowType.None;
|
||||||
|
LayoutVertical.PackStart (ScrolledWindow, true, true, 0);
|
||||||
|
LayoutVertical.ReorderChild (ScrolledWindow, 0);
|
||||||
|
|
||||||
|
ShowAll ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,9 +80,14 @@ namespace SparkleShare {
|
||||||
// Show a bubble when there are new changes
|
// Show a bubble when there are new changes
|
||||||
SparkleShare.Controller.NotificationRaised += delegate (SparkleCommit commit, string repository_path) {
|
SparkleShare.Controller.NotificationRaised += delegate (SparkleCommit commit, string repository_path) {
|
||||||
|
|
||||||
foreach (SparkleLog log in OpenLogs)
|
foreach (SparkleLog log in OpenLogs) {
|
||||||
if (log.LocalPath.Equals (repository_path))
|
if (log.LocalPath.Equals (repository_path)) {
|
||||||
log.UpdateEventLog ();
|
Application.Invoke (delegate {
|
||||||
|
log.UpdateEventLog ();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!SparkleShare.Controller.NotificationsEnabled)
|
if (!SparkleShare.Controller.NotificationsEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue