remove some outdated todos

This commit is contained in:
Helium314 2025-02-23 19:16:39 +01:00
parent 9ff5fda8ed
commit adc5c8cf1c
5 changed files with 7 additions and 14 deletions

View file

@ -75,9 +75,6 @@ object SettingsWithoutKey {
const val HIDDEN_FEATURES = "hidden_features"
const val GITHUB = "github"
const val SAVE_LOG = "save_log"
const val CUSTOM_KEY_CODES = "customize_key_codes"
// const val CUSTOM_SYMBOLS_NUMBER_LAYOUTS = "custom_symbols_number_layouts"
// const val CUSTOM_FUNCTIONAL_LAYOUTS = "custom_functional_key_layouts"
const val BACKUP_RESTORE = "backup_restore"
const val DEBUG_SETTINGS = "screen_debug"
const val LOAD_GESTURE_LIB = "load_gesture_library"

View file

@ -44,7 +44,6 @@ import helium314.keyboard.latin.utils.Log
import helium314.keyboard.latin.utils.SubtypeSettings
import helium314.keyboard.latin.utils.getActivity
import helium314.keyboard.latin.utils.getStringResourceOrName
import helium314.keyboard.latin.utils.mainLayoutName
import helium314.keyboard.latin.utils.prefs
import helium314.keyboard.settings.Setting
import helium314.keyboard.settings.SettingsActivity
@ -52,9 +51,6 @@ import helium314.keyboard.settings.keyboardNeedsReload
import helium314.keyboard.settings.layoutFilePicker
import helium314.keyboard.settings.layoutIntent
// modified copy of ColorPickerDialog, later check whether stuff can be re-used
// todo:
// call SubtypeSettings.onRenameLayout on rename!
@Composable
fun LayoutPickerDialog(
onDismissRequest: () -> Unit,

View file

@ -38,6 +38,7 @@ import helium314.keyboard.settings.screens.GetIcon
@Composable
fun ToolbarKeysCustomizer(
key: String,
onDismissRequest: () -> Unit
) {
val ctx = LocalContext.current
@ -79,7 +80,7 @@ fun ToolbarKeysCustomizer(
onConfirmed = {
showDeletePrefConfirmDialog = false
onDismissRequest()
prefs.edit().remove(Settings.PREF_TOOLBAR_CUSTOM_KEY_CODES).apply()
prefs.edit().remove(key).apply()
},
text = { Text(stringResource(R.string.customize_toolbar_key_code_reset_message)) }
)
@ -149,7 +150,7 @@ fun PreviewToolbarKeyCustomizer() {
fun PreviewToolbarKeysCustomizer() {
Settings.init(LocalContext.current)
KeyboardIconsSet.instance.loadIcons(LocalContext.current)
ToolbarKeysCustomizer { }
ToolbarKeysCustomizer("") { }
}
private fun checkCode(code: TextFieldValue) = runCatching {

View file

@ -108,11 +108,10 @@ fun LanguageScreen(
SubtypeDialog(
onDismissRequest = {
selectedSubtype = null
sortedSubtypes = getSortedSubtypes(ctx) // todo: not good, only necessary when a main layout is deleted
sortedSubtypes = getSortedSubtypes(ctx)
},
onConfirmed = {
SubtypeUtilsAdditional.changeAdditionalSubtype(oldSubtype.toSettingsSubtype(), it, ctx)
sortedSubtypes = getSortedSubtypes(ctx)
},
subtype = oldSubtype
)

View file

@ -47,7 +47,7 @@ fun ToolbarScreen(
Settings.PREF_TOOLBAR_KEYS,
Settings.PREF_PINNED_TOOLBAR_KEYS,
Settings.PREF_CLIPBOARD_TOOLBAR_KEYS,
SettingsWithoutKey.CUSTOM_KEY_CODES,
Settings.PREF_TOOLBAR_CUSTOM_KEY_CODES,
Settings.PREF_QUICK_PIN_TOOLBAR_KEYS,
Settings.PREF_AUTO_SHOW_TOOLBAR,
Settings.PREF_AUTO_HIDE_TOOLBAR,
@ -70,15 +70,15 @@ fun createToolbarSettings(context: Context) = listOf(
Setting(context, Settings.PREF_CLIPBOARD_TOOLBAR_KEYS, R.string.clipboard_toolbar_keys) {
ReorderSwitchPreference(it, Defaults.PREF_CLIPBOARD_TOOLBAR_KEYS)
},
Setting(context, SettingsWithoutKey.CUSTOM_KEY_CODES, R.string.customize_toolbar_key_codes) {
Setting(context, Settings.PREF_TOOLBAR_CUSTOM_KEY_CODES, R.string.customize_toolbar_key_codes) {
var showDialog by rememberSaveable { mutableStateOf(false) }
Preference(
name = it.title,
onClick = { showDialog = true },
)
if (showDialog)
// todo (later): CUSTOM_KEY_CODES vs the 2 actual prefs that are changed...
ToolbarKeysCustomizer(
key = it.key,
onDismissRequest = { showDialog = false }
)
},