X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=plugins%2FSession.cs;h=8a4a1982378ceb038ec95ccaf9765dbe02b9034c;hb=2744fefc32dbe9b59a570f6515d51121b8fcfbe3;hp=bec316ffa0d0f4ea56881a423c6f209911197676;hpb=ac127998500aa775484054cffa889098b3fd6a7b;p=WebThing.git diff --git a/plugins/Session.cs b/plugins/Session.cs index bec316f..8a4a198 100644 --- a/plugins/Session.cs +++ b/plugins/Session.cs @@ -12,7 +12,6 @@ public class Session : WebThingPlugin { if (Config.Arguments.Length == 0) { if (Config.Options.ContainsKey("Session")) { RestoreSession(Config.Options["Session"]); - CurrentSession = Config.Options["Session"]; } else if (Options.ContainsKey("Default")) { RestoreSession("Default"); } @@ -34,8 +33,9 @@ public class Session : WebThingPlugin { } string[] pages = Regex.Split(Options[SessionName], @"\s+"); foreach (string page in pages) { - wt.OpenUriTab(page); + wt.OpenTab(page); } + CurrentSession = SessionName; } else { Console.WriteLine("Could not restore session {0} because it does not exist.", SessionName); } @@ -49,4 +49,9 @@ public class Session : WebThingPlugin { Options[SessionName] = String.Join(" ", Uris.ToArray()); SaveConfig(); } + + public void DeleteSession(string SessionName) { + Options.Remove(SessionName); + SaveConfig(); + } }