feature: cycle monitors on toolbar
This commit is contained in:
59
.github/workflows/generator-windows.yml
vendored
59
.github/workflows/generator-windows.yml
vendored
@@ -352,6 +352,65 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sed -i -e '/if !key.is_empty() && !token.is_empty() {/,/}/d' ./src/client.rs
|
sed -i -e '/if !key.is_empty() && !token.is_empty() {/,/}/d' ./src/client.rs
|
||||||
|
|
||||||
|
- name: add cycle monitors to toolbar
|
||||||
|
continue-on-error: true
|
||||||
|
if: fromJson(inputs.extras).cycleMonitor == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
#add cycle monitor button to ./flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
|
new_code="class _CycleMonitorMenu extends StatelessWidget {
|
||||||
|
final String id;
|
||||||
|
final FFI ffi;
|
||||||
|
|
||||||
|
const _CycleMonitorMenu({
|
||||||
|
Key? key,
|
||||||
|
required this.id,
|
||||||
|
required this.ffi,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final pi = ffi.ffiModel.pi;
|
||||||
|
|
||||||
|
//for (int i = 0; i < pi.displays.length; i++) {
|
||||||
|
return TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
RxInt display = CurrentDisplayState.find(id);
|
||||||
|
display.value = display.value + 1;
|
||||||
|
if (display.value >= pi.displays.length) {
|
||||||
|
display.value = 0;
|
||||||
|
}
|
||||||
|
openMonitorInTheSameTab(display.value, ffi, pi);
|
||||||
|
pi.currentDisplay = display.value;
|
||||||
|
},
|
||||||
|
child: Stack(children: [
|
||||||
|
Container(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: const Icon(
|
||||||
|
Icons.personal_video,
|
||||||
|
color: _ToolbarTheme.blueColor,
|
||||||
|
size: 20.0,
|
||||||
|
))),
|
||||||
|
Container(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment(0.0, -0.4),
|
||||||
|
child: Text(
|
||||||
|
' ${CurrentDisplayState.find(id).value + 1}/${pi.displays.length}',
|
||||||
|
style: const TextStyle(
|
||||||
|
color: _ToolbarTheme.blueColor, fontSize: 8),
|
||||||
|
))),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
echo $new_code >> ./flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
|
sed -i '/_buildDraggable(context),/a\\ \ \ \ \ \ \ \ _CycleMonitorMenu(id: widget.id, ffi: widget.ffi),' ./flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
|
sed -i '/dragging: _dragging,/a\\ \ \ \ \ \ \ \ \ \ \ \ \ \ ffi: widget.ffi,' ./flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
|
sed -i '/final SessionID sessionId;/a\\ \ final FFI ffi;' ./flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
|
sed -i '/required this.sessionId,/a\\ \ \ \ required this.ffi,' ./flutter/lib/desktop/widgets/remote_toolbar.dart
|
||||||
|
|
||||||
|
|
||||||
- name: run as admin
|
- name: run as admin
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
if: ${{ fromJson(inputs.extras).runasadmin == 'true' }}
|
if: ${{ fromJson(inputs.extras).runasadmin == 'true' }}
|
||||||
|
|||||||
@@ -66,3 +66,5 @@ class GenerateForm(forms.Form):
|
|||||||
|
|
||||||
defaultManual = forms.CharField(widget=forms.Textarea, required=False)
|
defaultManual = forms.CharField(widget=forms.Textarea, required=False)
|
||||||
overrideManual = forms.CharField(widget=forms.Textarea, required=False)
|
overrideManual = forms.CharField(widget=forms.Textarea, required=False)
|
||||||
|
|
||||||
|
cycleMonitor = forms.BooleanField(initial=False, required=False)
|
||||||
@@ -214,6 +214,7 @@
|
|||||||
{{ form.defaultManual }}<br><br>
|
{{ form.defaultManual }}<br><br>
|
||||||
<label for="{{ form.overrideManual.id_for_label }}">Override settings</label><br>
|
<label for="{{ form.overrideManual.id_for_label }}">Override settings</label><br>
|
||||||
{{ form.overrideManual }}<br><br>
|
{{ form.overrideManual }}<br><br>
|
||||||
|
<label for="{{ form.cycleMonitor.id_for_label }}">{{ form.cycleMonitor }} Add a button to cycle through available monitors to the minimized toolbar.</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="platform">
|
<div class="platform">
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ def generator_view(request):
|
|||||||
platform = form.cleaned_data['platform']
|
platform = form.cleaned_data['platform']
|
||||||
version = form.cleaned_data['version']
|
version = form.cleaned_data['version']
|
||||||
delayFix = form.cleaned_data['delayFix']
|
delayFix = form.cleaned_data['delayFix']
|
||||||
|
cycleMonitor = form.cleaned_data['cycleMonitor']
|
||||||
server = form.cleaned_data['serverIP']
|
server = form.cleaned_data['serverIP']
|
||||||
key = form.cleaned_data['key']
|
key = form.cleaned_data['key']
|
||||||
apiServer = form.cleaned_data['apiServer']
|
apiServer = form.cleaned_data['apiServer']
|
||||||
@@ -155,6 +156,7 @@ def generator_view(request):
|
|||||||
extras['delayFix'] = 'true' if delayFix else 'false'
|
extras['delayFix'] = 'true' if delayFix else 'false'
|
||||||
extras['version'] = version
|
extras['version'] = version
|
||||||
extras['rdgen'] = 'true'
|
extras['rdgen'] = 'true'
|
||||||
|
extras['cycleMonitor'] = 'true' if cycleMonitor else 'false'
|
||||||
extra_input = json.dumps(extras)
|
extra_input = json.dumps(extras)
|
||||||
|
|
||||||
####from here run the github action, we need user, repo, access token.
|
####from here run the github action, we need user, repo, access token.
|
||||||
|
|||||||
Reference in New Issue
Block a user