mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Android: Remove unused onSettingsFileNotFound and friends
Old cruft from when the Android code was loading INI files manually. We don't have any handling for failing to load settings anymore. This change also updates related comments to reflect how things actually work nowadays.
This commit is contained in:
@ -10,6 +10,11 @@ import org.dolphinemu.dolphinemu.R
|
|||||||
import org.dolphinemu.dolphinemu.features.input.model.MappingCommon
|
import org.dolphinemu.dolphinemu.features.input.model.MappingCommon
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a set of settings stored in the native part of Dolphin.
|
||||||
|
*
|
||||||
|
* A set of settings can be either the global settings, or game settings for a particular game.
|
||||||
|
*/
|
||||||
class Settings : Closeable {
|
class Settings : Closeable {
|
||||||
private var gameId: String = ""
|
private var gameId: String = ""
|
||||||
private var revision = 0
|
private var revision = 0
|
||||||
|
@ -230,11 +230,6 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView {
|
|||||||
fragment?.onSettingsFileLoaded(settings)
|
fragment?.onSettingsFileLoaded(settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSettingsFileNotFound() {
|
|
||||||
val fragment: SettingsFragmentView? = fragment
|
|
||||||
fragment?.loadDefaultSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun showToastMessage(message: String) {
|
override fun showToastMessage(message: String) {
|
||||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
@ -31,26 +31,17 @@ interface SettingsActivityView {
|
|||||||
fun showDialogFragment(fragment: DialogFragment)
|
fun showDialogFragment(fragment: DialogFragment)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by a contained Fragment to get access to the Setting HashMap
|
* Identifies which set of settings is to be read from and written to.
|
||||||
* loaded from disk, so that each Fragment doesn't need to perform its own
|
|
||||||
* read operation.
|
|
||||||
*
|
|
||||||
* @return A possibly null HashMap of Settings.
|
|
||||||
*/
|
*/
|
||||||
val settings: Settings
|
val settings: Settings
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an asynchronous load operation completes.
|
* Called when a Settings object becomes available.
|
||||||
*
|
*
|
||||||
* @param settings The (possibly null) result of the ini load operation.
|
* @param settings The settings that this Activity should access.
|
||||||
*/
|
*/
|
||||||
fun onSettingsFileLoaded(settings: Settings)
|
fun onSettingsFileLoaded(settings: Settings)
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when an asynchronous load operation fails.
|
|
||||||
*/
|
|
||||||
fun onSettingsFileNotFound()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a popup text message on screen.
|
* Display a popup text message on screen.
|
||||||
*
|
*
|
||||||
|
@ -116,10 +116,6 @@ class SettingsFragment : Fragment(), SettingsFragmentView {
|
|||||||
adapter!!.setSettings(settingsList)
|
adapter!!.setSettings(settingsList)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun loadDefaultSettings() {
|
|
||||||
presenter.loadDefaultSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun loadSubMenu(menuKey: MenuTag) {
|
override fun loadSubMenu(menuKey: MenuTag) {
|
||||||
if (menuKey == MenuTag.GPU_DRIVERS) {
|
if (menuKey == MenuTag.GPU_DRIVERS) {
|
||||||
showGpuDriverDialog()
|
showGpuDriverDialog()
|
||||||
|
@ -100,10 +100,6 @@ class SettingsFragmentPresenter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadDefaultSettings() {
|
|
||||||
loadSettingsList()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun loadSettingsList() {
|
private fun loadSettingsList() {
|
||||||
val sl = ArrayList<SettingsItem>()
|
val sl = ArrayList<SettingsItem>()
|
||||||
when (menuTag) {
|
when (menuTag) {
|
||||||
|
@ -14,10 +14,9 @@ import org.dolphinemu.dolphinemu.utils.GpuDriverInstallResult
|
|||||||
*/
|
*/
|
||||||
interface SettingsFragmentView {
|
interface SettingsFragmentView {
|
||||||
/**
|
/**
|
||||||
* Called by the containing Activity to notify the Fragment that an
|
* Called when a Settings object becomes available.
|
||||||
* asynchronous load operation completed.
|
|
||||||
*
|
*
|
||||||
* @param settings The (possibly null) result of the ini load operation.
|
* @param settings The settings that this Fragment should access.
|
||||||
*/
|
*/
|
||||||
fun onSettingsFileLoaded(settings: Settings)
|
fun onSettingsFileLoaded(settings: Settings)
|
||||||
|
|
||||||
@ -28,12 +27,6 @@ interface SettingsFragmentView {
|
|||||||
*/
|
*/
|
||||||
fun showSettingsList(settingsList: ArrayList<SettingsItem>)
|
fun showSettingsList(settingsList: ArrayList<SettingsItem>)
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by the containing Activity when an asynchronous load operation fails.
|
|
||||||
* Instructs the Fragment to load the settings screen with defaults selected.
|
|
||||||
*/
|
|
||||||
fun loadDefaultSettings()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The Fragment's containing activity.
|
* @return The Fragment's containing activity.
|
||||||
*/
|
*/
|
||||||
@ -95,12 +88,9 @@ interface SettingsFragmentView {
|
|||||||
* @param value The current value of the Setting.
|
* @param value The current value of the Setting.
|
||||||
*/
|
*/
|
||||||
fun hasMenuTagActionForValue(menuTag: MenuTag, value: Int): Boolean
|
fun hasMenuTagActionForValue(menuTag: MenuTag, value: Int): Boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the input mapping dialog should detect inputs from all devices,
|
* Controls whether the input mapping dialog should detect inputs from all devices,
|
||||||
* not just the device configured for the controller.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Sets whether the input mapping dialog should detect inputs from all devices,
|
|
||||||
* not just the device configured for the controller.
|
* not just the device configured for the controller.
|
||||||
*/
|
*/
|
||||||
var isMappingAllDevices: Boolean
|
var isMappingAllDevices: Boolean
|
||||||
|
Reference in New Issue
Block a user