Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #8975 from JosJuice/android-new-config
Android: Hook up the new config system
- Loading branch information
Showing
66 changed files
with
2,071 additions
and
923 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...c/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractBooleanSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.dolphinemu.dolphinemu.features.settings.model; | ||
|
|
||
| public interface AbstractBooleanSetting extends AbstractSetting | ||
| { | ||
| boolean getBoolean(Settings settings); | ||
|
|
||
| void setBoolean(Settings settings, boolean newValue); | ||
| } |
8 changes: 8 additions & 0 deletions
8
...src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractFloatSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.dolphinemu.dolphinemu.features.settings.model; | ||
|
|
||
| public interface AbstractFloatSetting extends AbstractSetting | ||
| { | ||
| float getFloat(Settings settings); | ||
|
|
||
| void setFloat(Settings settings, float newValue); | ||
| } |
8 changes: 8 additions & 0 deletions
8
...p/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractIntSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.dolphinemu.dolphinemu.features.settings.model; | ||
|
|
||
| public interface AbstractIntSetting extends AbstractSetting | ||
| { | ||
| int getInt(Settings settings); | ||
|
|
||
| void setInt(Settings settings, int newValue); | ||
| } |
33 changes: 33 additions & 0 deletions
33
...rc/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractLegacySetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package org.dolphinemu.dolphinemu.features.settings.model; | ||
|
|
||
| public class AbstractLegacySetting implements AbstractSetting | ||
| { | ||
| protected final String mFile; | ||
| protected final String mSection; | ||
| protected final String mKey; | ||
|
|
||
| public AbstractLegacySetting(String file, String section, String key) | ||
| { | ||
| mFile = file; | ||
| mSection = section; | ||
| mKey = key; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isOverridden(Settings settings) | ||
| { | ||
| return settings.isGameSpecific() && settings.getSection(mFile, mSection).exists(mKey); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isRuntimeEditable() | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean delete(Settings settings) | ||
| { | ||
| return settings.getSection(mFile, mSection).delete(mKey); | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
.../app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package org.dolphinemu.dolphinemu.features.settings.model; | ||
|
|
||
| public interface AbstractSetting | ||
| { | ||
| boolean isOverridden(Settings settings); | ||
|
|
||
| boolean isRuntimeEditable(); | ||
|
|
||
| boolean delete(Settings settings); | ||
| } |
8 changes: 8 additions & 0 deletions
8
...rc/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractStringSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.dolphinemu.dolphinemu.features.settings.model; | ||
|
|
||
| public interface AbstractStringSetting extends AbstractSetting | ||
| { | ||
| String getString(Settings settings); | ||
|
|
||
| void setString(Settings settings, String newValue); | ||
| } |
52 changes: 52 additions & 0 deletions
52
.../src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package org.dolphinemu.dolphinemu.features.settings.model; | ||
|
|
||
| public class AdHocBooleanSetting implements AbstractBooleanSetting | ||
| { | ||
| private final String mFile; | ||
| private final String mSection; | ||
| private final String mKey; | ||
| private final boolean mDefaultValue; | ||
|
|
||
| public AdHocBooleanSetting(String file, String section, String key, boolean defaultValue) | ||
| { | ||
| mFile = file; | ||
| mSection = section; | ||
| mKey = key; | ||
| mDefaultValue = defaultValue; | ||
|
|
||
| if (!NativeConfig.isSettingSaveable(file, section, key)) | ||
| { | ||
| throw new IllegalArgumentException("File/section/key is unknown or legacy"); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isOverridden(Settings settings) | ||
| { | ||
| return NativeConfig.isOverridden(mFile, mSection, mKey); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isRuntimeEditable() | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean delete(Settings settings) | ||
| { | ||
| return NativeConfig.deleteKey(settings.getActiveLayer(), mFile, mSection, mKey); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getBoolean(Settings settings) | ||
| { | ||
| return NativeConfig.getBoolean(settings.getActiveLayer(), mFile, mSection, mKey, mDefaultValue); | ||
| } | ||
|
|
||
| @Override | ||
| public void setBoolean(Settings settings, boolean newValue) | ||
| { | ||
| NativeConfig.setBoolean(settings.getActiveLayer(), mFile, mSection, mKey, newValue); | ||
| } | ||
| } |
Oops, something went wrong.