add option to disable update checker
This commit is contained in:
parent
647ec64802
commit
f27ae94d1a
6 changed files with 30 additions and 3 deletions
|
|
@ -35,6 +35,8 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
|||
PICTURE_IN_PICTURE("picture_in_picture"),
|
||||
USE_CUSTOM_RTC("custom_rtc_enabled"),
|
||||
BLACK_BACKGROUNDS("black_backgrounds"),
|
||||
|
||||
ENABLE_UPDATE_CHECKS("enable_update_checks"),
|
||||
JOYSTICK_REL_CENTER("joystick_rel_center"),
|
||||
DPAD_SLIDE("dpad_slide"),
|
||||
HAPTIC_FEEDBACK("haptic_feedback"),
|
||||
|
|
|
|||
|
|
@ -750,6 +750,12 @@ abstract class SettingsItem(
|
|||
valuesId = R.array.rendererApiValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.ENABLE_UPDATE_CHECKS,
|
||||
titleId = R.string.enable_update_checks,
|
||||
)
|
||||
)
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RENDERER_DEBUG,
|
||||
|
|
|
|||
|
|
@ -1030,6 +1030,14 @@ class SettingsFragmentPresenter(
|
|||
override fun reset() = IntSetting.THEME.setInt(defaultValue)
|
||||
}
|
||||
|
||||
if (NativeLibrary.isUpdateCheckerEnabled()) {
|
||||
add(HeaderSetting(R.string.app_settings))
|
||||
add(BooleanSetting.ENABLE_UPDATE_CHECKS.key)
|
||||
}
|
||||
|
||||
add(HeaderSetting(R.string.theme_and_color))
|
||||
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
add(
|
||||
SingleChoiceSetting(
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ import androidx.core.content.edit
|
|||
import org.yuzu.yuzu_emu.activities.EmulationActivity
|
||||
import kotlin.text.compareTo
|
||||
import androidx.core.net.toUri
|
||||
import org.yuzu.yuzu_emu.features.settings.model.BooleanSetting
|
||||
|
||||
class MainActivity : AppCompatActivity(), ThemeProvider {
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
|
|
@ -157,7 +158,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
|||
val firstTimeSetup = PreferenceManager.getDefaultSharedPreferences(applicationContext)
|
||||
.getBoolean(Settings.PREF_FIRST_APP_LAUNCH, true)
|
||||
|
||||
if (!firstTimeSetup && NativeLibrary.isUpdateCheckerEnabled()) {
|
||||
if (!firstTimeSetup && NativeLibrary.isUpdateCheckerEnabled() && BooleanSetting.ENABLE_UPDATE_CHECKS.getBoolean()) {
|
||||
checkForUpdates()
|
||||
}
|
||||
setInsets()
|
||||
|
|
@ -183,7 +184,14 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
|||
val intent = Intent(Intent.ACTION_VIEW, url.toUri())
|
||||
startActivity(intent)
|
||||
}
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setNeutralButton(R.string.cancel) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
.setNegativeButton(R.string.dont_show_again) { dialog, _ ->
|
||||
BooleanSetting.ENABLE_UPDATE_CHECKS.setBoolean(false)
|
||||
NativeConfig.saveGlobalConfig()
|
||||
dialog.dismiss()
|
||||
}
|
||||
.show()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ namespace AndroidSettings {
|
|||
Settings::Setting<s32> theme_mode{linkage, -1, "theme_mode", Settings::Category::Android};
|
||||
Settings::Setting<bool> black_backgrounds{linkage, false, "black_backgrounds",
|
||||
Settings::Category::Android};
|
||||
Settings::Setting<bool> enable_update_checks{linkage, true, "enable_update_checks",
|
||||
Settings::Category::Android};
|
||||
|
||||
// Input/performance overlay settings
|
||||
std::vector<OverlayControlData> overlay_control_data;
|
||||
|
|
|
|||
|
|
@ -268,7 +268,8 @@
|
|||
<string name="folder">Folder</string>
|
||||
<string name="dont_show_again">Don\'t Show Again</string>
|
||||
<string name="add_directory_success">New game directory added successfully </string>
|
||||
<string name="update_available">Update Available</string>
|
||||
<string name="enable_update_checks">"Check for updates on app startup. "</string>
|
||||
<string name="update_available">Update Available</string>
|
||||
<string name="update_available_description">A new version is available: %1$s\n\nWould you like to download it?</string>
|
||||
<string name="home_search">Search</string>
|
||||
<string name="home_settings">Settings</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue