mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-10 18:06:01 +02:00
* feat: take screenshot Signed-off-by: fufesou <linlong1266@gmail.com> * screenshot, vram temp switch capturer Signed-off-by: fufesou <linlong1266@gmail.com> * fix: misspelling Signed-off-by: fufesou <linlong1266@gmail.com> * screenshot, taking Signed-off-by: fufesou <linlong1266@gmail.com> * screenshot, rgba stride Signed-off-by: fufesou <linlong1266@gmail.com> * Bumps 1.4.0 Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
48 lines
1.5 KiB
Dart
48 lines
1.5 KiB
Dart
import 'package:flutter_hbb/common.dart';
|
|
import 'package:flutter_hbb/consts.dart';
|
|
import 'package:flutter_hbb/models/platform_model.dart';
|
|
|
|
class PrinterOptions {
|
|
String action;
|
|
List<String> printerNames;
|
|
String printerName;
|
|
|
|
PrinterOptions(
|
|
{required this.action,
|
|
required this.printerNames,
|
|
required this.printerName});
|
|
|
|
static PrinterOptions load() {
|
|
var action = bind.mainGetLocalOption(key: kKeyPrinterIncomingJobAction);
|
|
if (![
|
|
kValuePrinterIncomingJobDismiss,
|
|
kValuePrinterIncomingJobDefault,
|
|
kValuePrinterIncomingJobSelected
|
|
].contains(action)) {
|
|
action = kValuePrinterIncomingJobDefault;
|
|
}
|
|
|
|
final printerNames = getPrinterNames();
|
|
var selectedPrinterName = bind.mainGetLocalOption(key: kKeyPrinterSelected);
|
|
if (!printerNames.contains(selectedPrinterName)) {
|
|
if (action == kValuePrinterIncomingJobSelected) {
|
|
action = kValuePrinterIncomingJobDefault;
|
|
bind.mainSetLocalOption(
|
|
key: kKeyPrinterIncomingJobAction,
|
|
value: kValuePrinterIncomingJobDefault);
|
|
if (printerNames.isEmpty) {
|
|
selectedPrinterName = '';
|
|
} else {
|
|
selectedPrinterName = printerNames.first;
|
|
}
|
|
bind.mainSetLocalOption(
|
|
key: kKeyPrinterSelected, value: selectedPrinterName);
|
|
}
|
|
}
|
|
|
|
return PrinterOptions(
|
|
action: action,
|
|
printerNames: printerNames,
|
|
printerName: selectedPrinterName);
|
|
}
|
|
}
|