feat: allow 8.4.3 firmware features (#845)

* feat: allow 8.4.3 firmware features

* feat: remove "layer-double-tap" command line argument
This commit is contained in:
Róbert Kiss
2018-11-05 19:51:39 +01:00
committed by László Monda
parent 84b6c33c54
commit 10cd06c70b
19 changed files with 57 additions and 34 deletions

View File

@@ -14,7 +14,7 @@ import 'rxjs/add/operator/combineLatest';
import { saveAs } from 'file-saver';
import { allowLayerDoubleTap, AppState, getKeyboardLayout } from '../../../store';
import { layerDoubleTapSupported, AppState, getKeyboardLayout } from '../../../store';
import { getKeymap, getKeymaps, getUserConfiguration } from '../../../store/reducers/user-configuration';
import { KeyboardLayout } from '../../../keyboard/keyboard-layout.enum';
import { KeymapActions } from '../../../store/actions';
@@ -51,7 +51,7 @@ export class KeymapEditComponent {
.map((keymaps: Keymap[]) => keymaps.length > 1);
this.keyboardLayout$ = store.select(getKeyboardLayout);
this.allowLayerDoubleTap$ = store.select(allowLayerDoubleTap);
this.allowLayerDoubleTap$ = store.select(layerDoubleTapSupported);
}
downloadKeymap() {

View File

@@ -5,6 +5,7 @@
></macro-header>
<macro-list
[macro]="macro"
[macroPlaybackSupported]="macroPlaybackSupported$ | async"
(add)="addAction($event.macroId, $event.action)"
(edit)="editAction($event.macroId, $event.index, $event.action)"
(delete)="deleteAction($event.macroId, $event.index, $event.action)"

View File

@@ -3,11 +3,12 @@ import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
import { Macro, MacroAction } from 'uhk-common';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/pluck';
import { MacroActions } from '../../../store/actions';
import { AppState } from '../../../store';
import { AppState, macroPlaybackSupported } from '../../../store';
import { getMacro } from '../../../store/reducers/user-configuration';
@Component({
@@ -22,6 +23,7 @@ export class MacroEditComponent implements OnDestroy {
macro: Macro;
isNew: boolean;
macroId: number;
macroPlaybackSupported$: Observable<boolean>;
private subscription: Subscription;
constructor(private store: Store<AppState>, public route: ActivatedRoute) {
@@ -37,6 +39,7 @@ export class MacroEditComponent implements OnDestroy {
});
this.isNew = this.route.snapshot.params['empty'] === 'new';
this.macroPlaybackSupported$ = this.store.select(macroPlaybackSupported);
}
ngOnDestroy() {

View File

@@ -1,6 +1,6 @@
<div class="row list-container">
<div class="col-xs-10 col-xs-offset-1 list-group">
<p><i>Please note that macro playback is not implemented yet. You can create macros, but they won't have any effect until firmware support is implemented. We're working on this.</i></p>
<p *ngIf="!macroPlaybackSupported"><i>Please note that macro playback is not implemented yet. You can create macros, but they won't have any effect until firmware support is implemented. We're working on this.</i></p>
<div class="macro-actions-container" [dragula]="'macroActions'" [dragulaModel]="macro.macroActions">
<macro-item *ngFor="let macroAction of macro.macroActions; let macroActionIndex = index"
[macroAction]="macroAction"

View File

@@ -35,6 +35,7 @@ import { MacroItemComponent } from '../item';
})
export class MacroListComponent {
@Input() macro: Macro;
@Input() macroPlaybackSupported: boolean;
@ViewChildren(forwardRef(() => MacroItemComponent)) macroItems: QueryList<MacroItemComponent>;
@Output() add = new EventEmitter();

View File

@@ -42,6 +42,7 @@
></mouse-tab>
<macro-tab #tab *ngSwitchCase="tabName.Macro" class="popover-content"
[defaultKeyAction]="defaultKeyAction"
[macroPlaybackSupported]="macroPlaybackSupported$ | async"
(validAction)="setKeyActionValidState($event)"
></macro-tab>
<keymap-tab #tab *ngSwitchCase="tabName.Keymap" class="popover-content"

View File

@@ -32,7 +32,7 @@ import {
import { Tab } from './tab';
import { AppState } from '../../store';
import { AppState, macroPlaybackSupported } from '../../store';
import { getKeymaps } from '../../store/reducers/user-configuration';
import { KeyActionRemap } from '../../models/key-action-remap';
import { RemapInfo } from '../../models/remap-info';
@@ -147,6 +147,7 @@ export class PopoverComponent implements OnChanges {
text: 'None'
}
];
macroPlaybackSupported$: Observable<boolean>;
private readonly currentKeymap$ = new BehaviorSubject<Keymap>(undefined);
@@ -158,6 +159,7 @@ export class PopoverComponent implements OnChanges {
.map(([keymaps, currentKeymap]: [Keymap[], Keymap]) =>
keymaps.filter((keymap: Keymap) => currentKeymap.abbreviation !== keymap.abbreviation)
);
this.macroPlaybackSupported$ = store.select(macroPlaybackSupported);
}
ngOnChanges(change: SimpleChanges) {

View File

@@ -2,7 +2,7 @@
<span> No macros are available to choose from. Create a macro first! </span>
</ng-template>
<ng-template [ngIf]="macroOptions.length > 0">
<p><i>Please note that macro playback is not implemented yet. You can bind macros, but they won't have any effect until firmware support is implemented. We're working on this.</i></p>
<p *ngIf="!macroPlaybackSupported"><i>Please note that macro playback is not implemented yet. You can bind macros, but they won't have any effect until firmware support is implemented. We're working on this.</i></p>
<div class="macro-selector">
<b> Play macro: </b>
<ngx-select [items]="macroOptions"

View File

@@ -17,6 +17,7 @@ import { SelectOptionData } from '../../../../models/select-option-data';
})
export class MacroTabComponent extends Tab implements OnInit, OnChanges, OnDestroy {
@Input() defaultKeyAction: KeyAction;
@Input() macroPlaybackSupported: boolean;
macros: Macro[];
macroOptions: Array<SelectOptionData>;