}
/**
+ * Returns whether the “Sone rescue mode” is currently activated.
+ *
+ * @return {@code true} if the “Sone rescue mode” is currently activated,
+ * {@code false} if it is not
+ */
+ public boolean isSoneRescueMode() {
+ return options.getBooleanOption("SoneRescueMode").get();
+ }
+
+ /**
* Returns the identity manager used by the core.
*
* @return The identity manager
}
}));
+ options.addBooleanOption("SoneRescueMode", new DefaultOption<Boolean>(false));
options.addBooleanOption("ClearOnNextRestart", new DefaultOption<Boolean>(false));
options.addBooleanOption("ReallyClearOnNextRestart", new DefaultOption<Boolean>(false));
}
options.getIntegerOption("InsertionDelay").set(configuration.getIntValue("Option/InsertionDelay").getValue(null));
+ options.getBooleanOption("SoneRescueMode").set(configuration.getBooleanValue("Option/SoneRescueMode").getValue(null));
/* load known Sones. */
int soneCounter = 0;
/* store the options first. */
try {
configuration.getIntValue("Option/InsertionDelay").setValue(options.getIntegerOption("InsertionDelay").getReal());
+ configuration.getBooleanValue("Option/SoneRescueMode").setValue(options.getBooleanOption("SoneRescueMode").getReal());
configuration.getBooleanValue("Option/ClearOnNextRestart").setValue(options.getBooleanOption("ClearOnNextRestart").getReal());
configuration.getBooleanValue("Option/ReallyClearOnNextRestart").setValue(options.getBooleanOption("ReallyClearOnNextRestart").getReal());
if (request.getMethod() == Method.POST) {
Integer insertionDelay = Numbers.safeParseInteger(request.getHttpRequest().getPartAsStringFailsafe("insertion-delay", 16));
options.getIntegerOption("InsertionDelay").set(insertionDelay);
+ boolean soneRescueMode = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("sone-rescue-mode", 5));
+ options.getBooleanOption("SoneRescueMode").set(soneRescueMode);
boolean clearOnNextRestart = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("clear-on-next-restart", 5));
options.getBooleanOption("ClearOnNextRestart").set(clearOnNextRestart);
boolean reallyClearOnNextRestart = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("really-clear-on-next-restart", 5));
throw new RedirectException(getPath());
}
template.set("insertion-delay", options.getIntegerOption("InsertionDelay").get());
+ template.set("sone-rescue-mode", options.getBooleanOption("SoneRescueMode").get());
template.set("clear-on-next-restart", options.getBooleanOption("ClearOnNextRestart").get());
template.set("really-clear-on-next-restart", options.getBooleanOption("ReallyClearOnNextRestart").get());
}
Page.Options.Page.Description=These options influence the runtime behaviour of the Sone plugin.
Page.Options.Section.RuntimeOptions.Title=Runtime Behaviour
Page.Options.Option.InsertionDelay.Description=The number of seconds the Sone inserter waits after a modification of a Sone before it is being inserted.
+Page.Options.Section.RescueOptions.Title=Rescue Settings
+Page.Options.Option.SoneRescueMode.Description=Try to rescue your Sones at the next start of the Sone plugin. This will read your all your old Sones from Freenet and ignore any disappearing postings and replies. You have to manually disable the rescue mode once you are satisfied with what has been restored!
Page.Options.Section.Cleaning.Title=Clean Up
Page.Options.Option.ClearOnNextRestart.Description=Resets the configuration of the Sone plugin at the next restart. Warning! {strong}This will destroy all of your Sones{/strong} so make sure you have backed up everyhing you still need! Also, you need to set the next option to true to actually do it.
Page.Options.Option.ReallyClearOnNextRestart.Description=This option needs to be set to “yes” if you really, {strong}really{/strong} want to clear the plugin configuration on the next restart.
<p><%= Page.Options.Option.InsertionDelay.Description|l10n|html></p>
<p><input type="text" name="insertion-delay" value="<% insertion-delay|html>" /></p>
+ <h2><%= Page.Options.Section.RescueOptions.Title|l10n|html></h2>
+
+ <p><%= Page.Options.Option.SoneRescueMode.Description|l10n|html></p>
+ <p><select name="sone-rescue-mode"><option disabled="disabled"><%= WebInterface.SelectBox.Choose|l10n|html></option><option value="true"<%if sone-rescue-mode> selected="selected"<%/if>><%= WebInterface.SelectBox.Yes|l10n|html></option><option value="false"<%if !sone-rescue-mode> selected="selected"<%/if>><%= WebInterface.SelectBox.No|l10n|html></option></select>
+
<h2><%= Page.Options.Section.Cleaning.Title|l10n|html></h2>
<p><%= Page.Options.Option.ClearOnNextRestart.Description|l10n|html|replace needle="{strong}" replacement="<strong>"|replace needle="{/strong}" replacement="</strong>"></p>