keep logs in memory on linux

This commit is contained in:
Hylke Bons 2011-03-14 02:07:14 +00:00
parent d1268bb343
commit 8ab088b623
3 changed files with 29 additions and 37 deletions

View file

@ -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"
// 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
private void ShowSyncingPage (string name)
{
Reset ();
ProgressBar = new ProgressBar () {
Fraction = 0
};
// ProgressBar = new ProgressBar () {
// Fraction = 0
// };
VBox layout_vertical = new VBox (false, 0);
@ -662,7 +662,7 @@ namespace SparkleShare {
table.Attach (spinner, 0, 1, 0, 1);
table.Attach (header, 1, 2, 0, 1);
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);
@ -712,9 +712,7 @@ namespace SparkleShare {
Button finish_button = new Button (_("Finish"));
finish_button.Clicked += delegate (object o, EventArgs args) {
Destroy ();
};
AddButton (finish_button);

View file

@ -69,9 +69,7 @@ namespace SparkleShare {
Title = String.Format(_("Events in {0}"), name);
IconName = "folder-sparkleshare";
DeleteEvent += delegate {
Close ();
};
DeleteEvent += Close;
LayoutVertical = new VBox (false, 0);
@ -102,7 +100,7 @@ namespace SparkleShare {
Button close_button = new Button (Stock.Close);
close_button.Clicked += delegate {
Close ();
HideAll ();
};
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.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,
AccelFlags.Visible));
close_1.Activated += delegate { Close (); };
close_1.Activated += delegate { HideAll (); };
// Close on Ctrl+W
close_2.AddAccelerator ("activate", accel_group, new AccelKey (Gdk.Key.Escape, Gdk.ModifierType.None,
AccelFlags.Visible));
close_2.Activated += delegate { Close (); };
close_2.Activated += delegate { HideAll (); };
file_menu.Append (close_1);
file_menu.Append (close_2);

View file

@ -153,7 +153,7 @@ namespace SparkleShare {
// A menu item that provides a link to the SparkleShare folder
Gtk.Action folder_action = new Gtk.Action ("", "SparkleShare") {
IconName = "folder-sparkleshare",
IsImportant = true
IsImportant = true // FIXME: doesn't shot the icon on Fedora
};
folder_action.Activated += delegate {
@ -177,8 +177,7 @@ namespace SparkleShare {
// if (repo.HasUnsyncedChanges)
// folder_action.IconName = "dialog-error";
// TODO Open each window with a little position offset
// so they stack nicely
folder_action.Activated += OpenEventLogDelegate (path);
MenuItem menu_item = (MenuItem) folder_action.CreateMenuItem ();
@ -254,9 +253,7 @@ namespace SparkleShare {
Menu.Add (quit_item);
Menu.ShowAll ();
}
@ -268,28 +265,25 @@ namespace SparkleShare {
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
//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) {
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.Destroy ();
};
SparkleUI.OpenLogs.Add (log);
log.ShowAll ();
log.Present ();
}
log.ShowAll ();
log.Present ();
};
}