mirror of
https://github.com/TrianguloY/UrlChecker.git
synced 2024-09-19 20:02:16 +02:00
enabled_by_default setting per module
This commit is contained in:
parent
a63208f7e2
commit
fcec4fabf8
@ -15,6 +15,13 @@ public abstract class AModuleData {
|
||||
*/
|
||||
public abstract String getName();
|
||||
|
||||
/**
|
||||
* @return whether this module should be enabled by default
|
||||
*/
|
||||
public boolean isEnabledByDefault() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the dialog fragment of this module
|
||||
*
|
||||
|
@ -32,13 +32,9 @@ public class ModuleManager {
|
||||
// ------------------- class -------------------
|
||||
|
||||
private static final String PREF_SUFFIX = "_en";
|
||||
/**
|
||||
* Status of modules by default (true=enabled, false=disabled)
|
||||
*/
|
||||
private static final boolean ENABLED_DEFAULT = true;
|
||||
|
||||
public static GenericPref.Bool getEnabledPrefOfModule(AModuleData module, Context cntx) {
|
||||
final GenericPref.Bool enabledPref = new GenericPref.Bool(module.getId() + PREF_SUFFIX, ENABLED_DEFAULT);
|
||||
final GenericPref.Bool enabledPref = new GenericPref.Bool(module.getId() + PREF_SUFFIX, module.isEnabledByDefault());
|
||||
enabledPref.init(cntx);
|
||||
return enabledPref;
|
||||
}
|
||||
|
@ -38,6 +38,11 @@ public class VirusTotalModule extends AModuleData {
|
||||
return "VirusTotal";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledByDefault() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AModuleDialog getDialog(MainDialog cntx) {
|
||||
return new VirusTotalDialog(cntx);
|
||||
|
Loading…
Reference in New Issue
Block a user