projects
/
WebThing.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix scrolling functionality
[WebThing.git]
/
plugins
/
Session.cs
diff --git
a/plugins/Session.cs
b/plugins/Session.cs
index
37d848c
..
8a4a198
100644
(file)
--- a/
plugins/Session.cs
+++ b/
plugins/Session.cs
@@
-5,6
+5,7
@@
using bytex64.WebThing;
public class Session : WebThingPlugin {
WebThing wt;
public class Session : WebThingPlugin {
WebThing wt;
+ string CurrentSession = "Default";
public override void Init(WebThing wt) {
this.wt = wt;
public override void Init(WebThing wt) {
this.wt = wt;
@@
-19,7
+20,7
@@
public class Session : WebThingPlugin {
public override void Deinit(WebThing wt) {
if (Options.ContainsKey("AutoSave") && Config.ParseBool(Options["AutoSave"])) {
public override void Deinit(WebThing wt) {
if (Options.ContainsKey("AutoSave") && Config.ParseBool(Options["AutoSave"])) {
- SaveSession(
"Default"
);
+ SaveSession(
CurrentSession
);
}
}
}
}
@@
-32,8
+33,9
@@
public class Session : WebThingPlugin {
}
string[] pages = Regex.Split(Options[SessionName], @"\s+");
foreach (string page in pages) {
}
string[] pages = Regex.Split(Options[SessionName], @"\s+");
foreach (string page in pages) {
- wt.Open
Uri
Tab(page);
+ wt.OpenTab(page);
}
}
+ CurrentSession = SessionName;
} else {
Console.WriteLine("Could not restore session {0} because it does not exist.", SessionName);
}
} else {
Console.WriteLine("Could not restore session {0} because it does not exist.", SessionName);
}
@@
-47,4
+49,9
@@
public class Session : WebThingPlugin {
Options[SessionName] = String.Join(" ", Uris.ToArray());
SaveConfig();
}
Options[SessionName] = String.Join(" ", Uris.ToArray());
SaveConfig();
}
+
+ public void DeleteSession(string SessionName) {
+ Options.Remove(SessionName);
+ SaveConfig();
+ }
}
}