Removing ConfigCheckBox (will add it back after a few fixes)

This commit is contained in:
Vishal 2022-11-06 00:49:21 +05:30 committed by GitHub
parent de086a8a3f
commit 967bebf80b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View File

@ -7,7 +7,6 @@ from __future__ import annotations
from typing import TYPE_CHECKING
import ba
from bastd.ui.config import ConfigCheckBox
if TYPE_CHECKING:
pass
@ -101,14 +100,15 @@ class PluginSettingsWindow(ba.Window):
)
self._y_position -= 70
self._enable_new_plugins_check_box = ConfigCheckBox(
self._enable_new_plugins_check_box = ba.checkboxwidget(
parent=self._root_widget,
position=(65, self._y_position),
size=(350, 60),
configkey='Auto Enable New Plugins',
displayname=ba.Lstr(resource='AutoEnableNewPluginsText'),
value=ba.app.config['Auto Enable New Plugins'],
text=ba.Lstr(resource='AutoEnableNewPluginsText'),
scale=1.0,
maxwidth=430
maxwidth=430,
on_value_change_call=self._update_value
)
def _enable_all_plugins(self) -> None:
@ -135,6 +135,11 @@ class PluginSettingsWindow(ba.Window):
color=(1.0, 0.5, 0.0),
)
def _update_value(self, val: bool) -> None:
cfg = ba.app.config
cfg['Auto Enable New Plugins'] = val
cfg.apply_and_commit()
def _do_back(self) -> None:
# pylint: disable=cyclic-import
from bastd.ui.settings.plugins import PluginWindow

View File

@ -221,8 +221,6 @@ void AppConfig::SetupEntries() {
// (default to internal keyboard on iircade; not elsewhere)
bool_entries_[BoolID::kAlwaysUseInternalKeyboard] =
BoolEntry("Always Use Internal Keyboard", g_buildconfig.iircade_build());
bool_entries_[BoolID::kAutoEnableNewPlugins] =
BoolEntry("Auto Enable New Plugins", true);
bool_entries_[BoolID::kShowFPS] = BoolEntry("Show FPS", false);
bool_entries_[BoolID::kTVBorder] =
BoolEntry("TV Border", g_platform->IsRunningOnTV());

View File

@ -60,7 +60,6 @@ class AppConfig {
kFullscreen,
kKickIdlePlayers,
kAlwaysUseInternalKeyboard,
kAutoEnableNewPlugins,
kShowFPS,
kTVBorder,
kKeyboardP2Enabled,