Rename CustomSettingsScreen to ModuleSettings

This commit is contained in:
Bartosz Sosnowski
2019-10-08 13:00:01 +02:00
committed by Bartosz Sosnowski
parent f77945111b
commit 892fed6011
3 changed files with 6 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ Defines the main App component, containing the UI layout, navigation menu, dialo
#### [src/components/GeneralSettings.tsx](./src/components/GeneralSettings.tsx) #### [src/components/GeneralSettings.tsx](./src/components/GeneralSettings.tsx)
Defines the PowerToys General Settings component, including logic to construct the object sent to PowerToys to change the General settings. Defines the PowerToys General Settings component, including logic to construct the object sent to PowerToys to change the General settings.
#### [src/components/CustomSettingsScreen.tsx](./src/components/CustomSettingsScreen.tsx) #### [src/components/ModuleSettings.tsx](./src/components/ModuleSettings.tsx)
Defines the component that generates the settings screen for a PowerToy depending on its settings definition. Defines the component that generates the settings screen for a PowerToy depending on its settings definition.
#### [src/components/BaseSettingsControl.tsx](./src/components/BaseSettingsControl.tsx) #### [src/components/BaseSettingsControl.tsx](./src/components/BaseSettingsControl.tsx)
@@ -154,14 +154,14 @@ Each settings property has a `editor_type` field that's used to differentiate be
``` ```
A new Settings control component can be added to [`src/components/`](./src/components/). A new Settings control component can be added to [`src/components/`](./src/components/).
To render the new Settings control, its `editor_type` and component instance need to be added to the [`CustomSettingsScreen` component render()](./src/components/CustomSettingsScreen.tsx): To render the new Settings control, its `editor_type` and component instance need to be added to the [`ModuleSettings` component render()](./src/components/ModuleSettings.tsx):
```tsx ```tsx
import React from 'react'; import React from 'react';
import {StringTextSettingsControl} from './StringTextSettingsControl'; import {StringTextSettingsControl} from './StringTextSettingsControl';
... ...
export class CustomSettingsScreen extends React.Component <any, any> { export class ModuleSettings extends React.Component <any, any> {
references: any; references: any;
parent_on_change: Function; parent_on_change: Function;
... ...

View File

@@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import {Stack, Text, Nav, DefaultButton, PrimaryButton, ScrollablePane, INavLink, Spinner, SpinnerSize, Dialog, DialogType, DialogFooter} from 'office-ui-fabric-react'; import {Stack, Text, Nav, DefaultButton, PrimaryButton, ScrollablePane, INavLink, Spinner, SpinnerSize, Dialog, DialogType, DialogFooter} from 'office-ui-fabric-react';
import {GeneralSettings} from './GeneralSettings'; import {GeneralSettings} from './GeneralSettings';
import {CustomSettingsScreen} from './CustomSettingsScreen'; import {ModuleSettings} from './ModuleSettings';
import '../css/layout.css'; import '../css/layout.css';
import {setup_powertoys_icons} from '../setup_icons'; import {setup_powertoys_icons} from '../setup_icons';
@@ -233,7 +233,7 @@ export class App extends React.Component <any, any> {
ref={(input:any) => {this.settings_screen_ref = input;}} ref={(input:any) => {this.settings_screen_ref = input;}}
/> />
} else if( this.state.settings.hasOwnProperty('powertoys') && this.state.selected_menu in this.state.settings.powertoys) { } else if( this.state.settings.hasOwnProperty('powertoys') && this.state.selected_menu in this.state.settings.powertoys) {
return <CustomSettingsScreen return <ModuleSettings
key={this.state.selected_menu} key={this.state.selected_menu}
settings_key={this.state.selected_menu} settings_key={this.state.selected_menu}
powertoy={this.state.settings.powertoys[this.state.selected_menu]} powertoy={this.state.settings.powertoys[this.state.selected_menu]}

View File

@@ -9,7 +9,7 @@ import {HotkeySettingsControl} from './HotkeySettingsControl';
import {ChoiceGroupSettingsControl} from './ChoiceGroupSettingsControl'; import {ChoiceGroupSettingsControl} from './ChoiceGroupSettingsControl';
import {DropdownSettingsControl} from './DropdownSettingsControl'; import {DropdownSettingsControl} from './DropdownSettingsControl';
export class CustomSettingsScreen extends React.Component <any, any> { export class ModuleSettings extends React.Component <any, any> {
references: any; references: any;
parent_on_change: Function; parent_on_change: Function;