keep logs in memory on linux
This commit is contained in:
parent
62d4b97fff
commit
ae6b262ef5
|
@ -149,12 +149,12 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void PreventClose (object o, DeleteEventArgs e)
|
private void PreventClose (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Cancel closing when the "Close"
|
// Cancel closing when the "Close"
|
||||||
// button of the window is pressed
|
// button of the window is pressed
|
||||||
e.RetVal = true;
|
args.RetVal = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,16 +611,16 @@ namespace SparkleShare {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProgressBar ProgressBar;
|
// private ProgressBar ProgressBar;
|
||||||
// The page shown whilst syncing
|
// The page shown whilst syncing
|
||||||
private void ShowSyncingPage (string name)
|
private void ShowSyncingPage (string name)
|
||||||
{
|
{
|
||||||
|
|
||||||
Reset ();
|
Reset ();
|
||||||
|
|
||||||
ProgressBar = new ProgressBar () {
|
// ProgressBar = new ProgressBar () {
|
||||||
Fraction = 0
|
// Fraction = 0
|
||||||
};
|
// };
|
||||||
|
|
||||||
VBox layout_vertical = new VBox (false, 0);
|
VBox layout_vertical = new VBox (false, 0);
|
||||||
|
|
||||||
|
@ -662,7 +662,7 @@ namespace SparkleShare {
|
||||||
table.Attach (spinner, 0, 1, 0, 1);
|
table.Attach (spinner, 0, 1, 0, 1);
|
||||||
table.Attach (header, 1, 2, 0, 1);
|
table.Attach (header, 1, 2, 0, 1);
|
||||||
table.Attach (information, 1, 2, 1, 2);
|
table.Attach (information, 1, 2, 1, 2);
|
||||||
table.Attach (ProgressBar, 2, 3, 0, 2);
|
//table.Attach (ProgressBar, 2, 3, 0, 2);
|
||||||
|
|
||||||
box.PackStart (table, false, false, 0);
|
box.PackStart (table, false, false, 0);
|
||||||
|
|
||||||
|
@ -712,9 +712,7 @@ namespace SparkleShare {
|
||||||
Button finish_button = new Button (_("Finish"));
|
Button finish_button = new Button (_("Finish"));
|
||||||
|
|
||||||
finish_button.Clicked += delegate (object o, EventArgs args) {
|
finish_button.Clicked += delegate (object o, EventArgs args) {
|
||||||
|
|
||||||
Destroy ();
|
Destroy ();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
AddButton (finish_button);
|
AddButton (finish_button);
|
||||||
|
|
|
@ -69,9 +69,7 @@ namespace SparkleShare {
|
||||||
Title = String.Format(_("Events in ‘{0}’"), name);
|
Title = String.Format(_("Events in ‘{0}’"), name);
|
||||||
IconName = "folder-sparkleshare";
|
IconName = "folder-sparkleshare";
|
||||||
|
|
||||||
DeleteEvent += delegate {
|
DeleteEvent += Close;
|
||||||
Close ();
|
|
||||||
};
|
|
||||||
|
|
||||||
LayoutVertical = new VBox (false, 0);
|
LayoutVertical = new VBox (false, 0);
|
||||||
|
|
||||||
|
@ -102,7 +100,7 @@ namespace SparkleShare {
|
||||||
Button close_button = new Button (Stock.Close);
|
Button close_button = new Button (Stock.Close);
|
||||||
|
|
||||||
close_button.Clicked += delegate {
|
close_button.Clicked += delegate {
|
||||||
Close ();
|
HideAll ();
|
||||||
};
|
};
|
||||||
|
|
||||||
dialog_buttons.Add (open_folder_button);
|
dialog_buttons.Add (open_folder_button);
|
||||||
|
@ -138,7 +136,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Don't close window afterwards
|
// FIXME: webview should stay on the same page
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -175,15 +173,17 @@ namespace SparkleShare {
|
||||||
LayoutVertical.PackStart (ScrolledWindow, true, true, 0);
|
LayoutVertical.PackStart (ScrolledWindow, true, true, 0);
|
||||||
LayoutVertical.ReorderChild (ScrolledWindow, 0);
|
LayoutVertical.ReorderChild (ScrolledWindow, 0);
|
||||||
|
|
||||||
ShowAll ();
|
LayoutVertical.ShowAll ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Close ()
|
public void Close (object o, DeleteEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
Destroy (); // TODO: keep logs in memory like Mac UI
|
HideAll ();
|
||||||
|
args.RetVal = true;
|
||||||
|
// FIXME: window positions aren't saved
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,12 +209,12 @@ namespace SparkleShare {
|
||||||
close_1.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.W, Gdk.ModifierType.ControlMask,
|
close_1.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.W, Gdk.ModifierType.ControlMask,
|
||||||
AccelFlags.Visible));
|
AccelFlags.Visible));
|
||||||
|
|
||||||
close_1.Activated += delegate { Close (); };
|
close_1.Activated += delegate { HideAll (); };
|
||||||
|
|
||||||
// Close on Ctrl+W
|
// Close on Ctrl+W
|
||||||
close_2.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None,
|
close_2.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None,
|
||||||
AccelFlags.Visible));
|
AccelFlags.Visible));
|
||||||
close_2.Activated += delegate { Close (); };
|
close_2.Activated += delegate { HideAll (); };
|
||||||
|
|
||||||
file_menu.Append (close_1);
|
file_menu.Append (close_1);
|
||||||
file_menu.Append (close_2);
|
file_menu.Append (close_2);
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace SparkleShare {
|
||||||
// A menu item that provides a link to the SparkleShare folder
|
// A menu item that provides a link to the SparkleShare folder
|
||||||
Gtk.Action folder_action = new Gtk.Action ("", "SparkleShare") {
|
Gtk.Action folder_action = new Gtk.Action ("", "SparkleShare") {
|
||||||
IconName = "folder-sparkleshare",
|
IconName = "folder-sparkleshare",
|
||||||
IsImportant = true
|
IsImportant = true // FIXME: doesn't shot the icon on Fedora
|
||||||
};
|
};
|
||||||
|
|
||||||
folder_action.Activated += delegate {
|
folder_action.Activated += delegate {
|
||||||
|
@ -177,8 +177,7 @@ namespace SparkleShare {
|
||||||
// if (repo.HasUnsyncedChanges)
|
// if (repo.HasUnsyncedChanges)
|
||||||
// folder_action.IconName = "dialog-error";
|
// folder_action.IconName = "dialog-error";
|
||||||
|
|
||||||
// TODO Open each window with a little position offset
|
|
||||||
// so they stack nicely
|
|
||||||
folder_action.Activated += OpenEventLogDelegate (path);
|
folder_action.Activated += OpenEventLogDelegate (path);
|
||||||
|
|
||||||
MenuItem menu_item = (MenuItem) folder_action.CreateMenuItem ();
|
MenuItem menu_item = (MenuItem) folder_action.CreateMenuItem ();
|
||||||
|
@ -254,10 +253,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
Menu.Add (quit_item);
|
Menu.Add (quit_item);
|
||||||
|
|
||||||
|
|
||||||
Menu.ShowAll ();
|
Menu.ShowAll ();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -268,28 +265,25 @@ namespace SparkleShare {
|
||||||
|
|
||||||
return delegate {
|
return delegate {
|
||||||
|
|
||||||
SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) { return l.LocalPath.Equals (path); });
|
SparkleLog log = SparkleUI.OpenLogs.Find (delegate (SparkleLog l) {
|
||||||
|
return l.LocalPath.Equals (path);
|
||||||
|
});
|
||||||
|
|
||||||
// Check whether the log is already open, create a new one if
|
// Check whether the log is already open, create a new one if
|
||||||
//that's not the case or present it to the user if it is
|
// that's not the case or present it to the user if it is
|
||||||
if (log == null) {
|
if (log == null) {
|
||||||
|
|
||||||
log = new SparkleLog (path);
|
SparkleUI.OpenLogs.Add (new SparkleLog (path));
|
||||||
|
SparkleUI.OpenLogs [SparkleUI.OpenLogs.Count - 1].ShowAll ();
|
||||||
|
SparkleUI.OpenLogs [SparkleUI.OpenLogs.Count - 1].Present ();
|
||||||
|
|
||||||
log.Hidden += delegate {
|
} else {
|
||||||
|
|
||||||
SparkleUI.OpenLogs.Remove (log);
|
log.ShowAll ();
|
||||||
log.Destroy ();
|
log.Present ();
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
SparkleUI.OpenLogs.Add (log);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.ShowAll ();
|
|
||||||
log.Present ();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue