rename get_session -> session_get
This commit is contained in:
parent
1b5075168e
commit
53b69b59a8
@ -482,7 +482,7 @@ RadioListTile<T> getRadio<T>(
|
|||||||
CheckboxListTile getToggle(
|
CheckboxListTile getToggle(
|
||||||
String id, void Function(void Function()) setState, option, name,
|
String id, void Function(void Function()) setState, option, name,
|
||||||
{FFI? ffi}) {
|
{FFI? ffi}) {
|
||||||
final opt = bind.getSessionToggleOptionSync(id: id, arg: option);
|
final opt = bind.sessionGetToggleOptionSync(id: id, arg: option);
|
||||||
return CheckboxListTile(
|
return CheckboxListTile(
|
||||||
value: opt,
|
value: opt,
|
||||||
onChanged: (v) {
|
onChanged: (v) {
|
||||||
|
@ -490,7 +490,7 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
}),
|
}),
|
||||||
))
|
))
|
||||||
];
|
];
|
||||||
final cursor = bind.getSessionToggleOptionSync(
|
final cursor = bind.sessionGetToggleOptionSync(
|
||||||
id: widget.id, arg: 'show-remote-cursor');
|
id: widget.id, arg: 'show-remote-cursor');
|
||||||
if (keyboard || cursor) {
|
if (keyboard || cursor) {
|
||||||
paints.add(CursorPaint(
|
paints.add(CursorPaint(
|
||||||
@ -565,7 +565,7 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
more.add(PopupMenuItem<String>(
|
more.add(PopupMenuItem<String>(
|
||||||
child: Text(translate('Insert Lock')), value: 'lock'));
|
child: Text(translate('Insert Lock')), value: 'lock'));
|
||||||
if (pi.platform == 'Windows' &&
|
if (pi.platform == 'Windows' &&
|
||||||
await bind.getSessionToggleOption(id: id, arg: 'privacy-mode') !=
|
await bind.sessionGetToggleOption(id: id, arg: 'privacy-mode') !=
|
||||||
true) {
|
true) {
|
||||||
more.add(PopupMenuItem<String>(
|
more.add(PopupMenuItem<String>(
|
||||||
child: Text(translate(
|
child: Text(translate(
|
||||||
@ -610,7 +610,7 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
// TODO icon diff
|
// TODO icon diff
|
||||||
// null means no session of id
|
// null means no session of id
|
||||||
// empty string means no password
|
// empty string means no password
|
||||||
var password = await bind.getSessionOption(id: id, arg: "os-password");
|
var password = await bind.sessionGetOption(id: id, arg: "os-password");
|
||||||
if (password != null) {
|
if (password != null) {
|
||||||
bind.sessionInputOsPassword(id: widget.id, value: password);
|
bind.sessionInputOsPassword(id: widget.id, value: password);
|
||||||
} else {
|
} else {
|
||||||
@ -837,12 +837,12 @@ class QualityMonitor extends StatelessWidget {
|
|||||||
|
|
||||||
void showOptions(String id) async {
|
void showOptions(String id) async {
|
||||||
final _ffi = ffi(id);
|
final _ffi = ffi(id);
|
||||||
String quality = await bind.getSessionImageQuality(id: id) ?? 'balanced';
|
String quality = await bind.sessionGetImageQuality(id: id) ?? 'balanced';
|
||||||
if (quality == '') quality = 'balanced';
|
if (quality == '') quality = 'balanced';
|
||||||
String viewStyle =
|
String viewStyle =
|
||||||
await bind.getSessionOption(id: id, arg: 'view-style') ?? '';
|
await bind.sessionGetOption(id: id, arg: 'view-style') ?? '';
|
||||||
String scrollStyle =
|
String scrollStyle =
|
||||||
await bind.getSessionOption(id: id, arg: 'scroll-style') ?? '';
|
await bind.sessionGetOption(id: id, arg: 'scroll-style') ?? '';
|
||||||
var displays = <Widget>[];
|
var displays = <Widget>[];
|
||||||
final pi = _ffi.ffiModel.pi;
|
final pi = _ffi.ffiModel.pi;
|
||||||
final image = _ffi.ffiModel.getConnectionImage();
|
final image = _ffi.ffiModel.getConnectionImage();
|
||||||
@ -957,8 +957,8 @@ void showOptions(String id) async {
|
|||||||
void showSetOSPassword(
|
void showSetOSPassword(
|
||||||
String id, bool login, OverlayDialogManager dialogManager) async {
|
String id, bool login, OverlayDialogManager dialogManager) async {
|
||||||
final controller = TextEditingController();
|
final controller = TextEditingController();
|
||||||
var password = await bind.getSessionOption(id: id, arg: "os-password") ?? "";
|
var password = await bind.sessionGetOption(id: id, arg: "os-password") ?? "";
|
||||||
var autoLogin = await bind.getSessionOption(id: id, arg: "auto-login") != "";
|
var autoLogin = await bind.sessionGetOption(id: id, arg: "auto-login") != "";
|
||||||
controller.text = password;
|
controller.text = password;
|
||||||
dialogManager.show((setState, close) {
|
dialogManager.show((setState, close) {
|
||||||
return CustomAlertDialog(
|
return CustomAlertDialog(
|
||||||
|
@ -623,7 +623,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
|
|
||||||
Widget getBodyForDesktopWithListener(bool keyboard) {
|
Widget getBodyForDesktopWithListener(bool keyboard) {
|
||||||
var paints = <Widget>[ImagePaint()];
|
var paints = <Widget>[ImagePaint()];
|
||||||
final cursor = bind.getSessionToggleOptionSync(
|
final cursor = bind.sessionGetToggleOptionSync(
|
||||||
id: widget.id, arg: 'show-remote-cursor');
|
id: widget.id, arg: 'show-remote-cursor');
|
||||||
if (keyboard || cursor) {
|
if (keyboard || cursor) {
|
||||||
paints.add(CursorPaint());
|
paints.add(CursorPaint());
|
||||||
@ -694,7 +694,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
more.add(PopupMenuItem<String>(
|
more.add(PopupMenuItem<String>(
|
||||||
child: Text(translate('Insert Lock')), value: 'lock'));
|
child: Text(translate('Insert Lock')), value: 'lock'));
|
||||||
if (pi.platform == 'Windows' &&
|
if (pi.platform == 'Windows' &&
|
||||||
await bind.getSessionToggleOption(id: id, arg: 'privacy-mode') !=
|
await bind.sessionGetToggleOption(id: id, arg: 'privacy-mode') !=
|
||||||
true) {
|
true) {
|
||||||
more.add(PopupMenuItem<String>(
|
more.add(PopupMenuItem<String>(
|
||||||
child: Text(translate((gFFI.ffiModel.inputBlocked ? 'Unb' : 'B') +
|
child: Text(translate((gFFI.ffiModel.inputBlocked ? 'Unb' : 'B') +
|
||||||
@ -738,7 +738,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
// FIXME:
|
// FIXME:
|
||||||
// null means no session of id
|
// null means no session of id
|
||||||
// empty string means no password
|
// empty string means no password
|
||||||
var password = await bind.getSessionOption(id: id, arg: "os-password");
|
var password = await bind.sessionGetOption(id: id, arg: "os-password");
|
||||||
if (password != null) {
|
if (password != null) {
|
||||||
bind.sessionInputOsPassword(id: widget.id, value: password);
|
bind.sessionInputOsPassword(id: widget.id, value: password);
|
||||||
} else {
|
} else {
|
||||||
@ -1012,10 +1012,10 @@ class QualityMonitor extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showOptions(String id, OverlayDialogManager dialogManager) async {
|
void showOptions(String id, OverlayDialogManager dialogManager) async {
|
||||||
String quality = await bind.getSessionImageQuality(id: id) ?? 'balanced';
|
String quality = await bind.sessionGetImageQuality(id: id) ?? 'balanced';
|
||||||
if (quality == '') quality = 'balanced';
|
if (quality == '') quality = 'balanced';
|
||||||
String viewStyle =
|
String viewStyle =
|
||||||
await bind.getSessionOption(id: id, arg: 'view-style') ?? '';
|
await bind.sessionGetOption(id: id, arg: 'view-style') ?? '';
|
||||||
var displays = <Widget>[];
|
var displays = <Widget>[];
|
||||||
final pi = gFFI.ffiModel.pi;
|
final pi = gFFI.ffiModel.pi;
|
||||||
final image = gFFI.ffiModel.getConnectionImage();
|
final image = gFFI.ffiModel.getConnectionImage();
|
||||||
@ -1113,8 +1113,8 @@ void showOptions(String id, OverlayDialogManager dialogManager) async {
|
|||||||
void showSetOSPassword(
|
void showSetOSPassword(
|
||||||
String id, bool login, OverlayDialogManager dialogManager) async {
|
String id, bool login, OverlayDialogManager dialogManager) async {
|
||||||
final controller = TextEditingController();
|
final controller = TextEditingController();
|
||||||
var password = await bind.getSessionOption(id: id, arg: "os-password") ?? "";
|
var password = await bind.sessionGetOption(id: id, arg: "os-password") ?? "";
|
||||||
var autoLogin = await bind.getSessionOption(id: id, arg: "auto-login") != "";
|
var autoLogin = await bind.sessionGetOption(id: id, arg: "auto-login") != "";
|
||||||
controller.text = password;
|
controller.text = password;
|
||||||
dialogManager.show((setState, close) {
|
dialogManager.show((setState, close) {
|
||||||
return CustomAlertDialog(
|
return CustomAlertDialog(
|
||||||
|
@ -157,7 +157,7 @@ void setTemporaryPasswordLengthDialog(
|
|||||||
|
|
||||||
void enterPasswordDialog(String id, OverlayDialogManager dialogManager) async {
|
void enterPasswordDialog(String id, OverlayDialogManager dialogManager) async {
|
||||||
final controller = TextEditingController();
|
final controller = TextEditingController();
|
||||||
var remember = await bind.getSessionRemember(id: id) ?? false;
|
var remember = await bind.sessionGetRemember(id: id) ?? false;
|
||||||
dialogManager.dismissAll();
|
dialogManager.dismissAll();
|
||||||
dialogManager.show((setState, close) {
|
dialogManager.show((setState, close) {
|
||||||
return CustomAlertDialog(
|
return CustomAlertDialog(
|
||||||
|
@ -312,7 +312,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_touchMode =
|
_touchMode =
|
||||||
await bind.getSessionOption(id: peerId, arg: "touch-mode") != '';
|
await bind.sessionGetOption(id: peerId, arg: "touch-mode") != '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evt['is_file_transfer'] == "true") {
|
if (evt['is_file_transfer'] == "true") {
|
||||||
@ -471,7 +471,7 @@ class CanvasModel with ChangeNotifier {
|
|||||||
double get tabBarHeight => _tabBarHeight;
|
double get tabBarHeight => _tabBarHeight;
|
||||||
|
|
||||||
void updateViewStyle() async {
|
void updateViewStyle() async {
|
||||||
final style = await bind.getSessionOption(id: id, arg: 'view-style');
|
final style = await bind.sessionGetOption(id: id, arg: 'view-style');
|
||||||
if (style == null) {
|
if (style == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -517,7 +517,7 @@ class CanvasModel with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateScrollStyle() async {
|
updateScrollStyle() async {
|
||||||
final style = await bind.getSessionOption(id: id, arg: 'scroll-style');
|
final style = await bind.sessionGetOption(id: id, arg: 'scroll-style');
|
||||||
if (style == 'scrollbar') {
|
if (style == 'scrollbar') {
|
||||||
_scrollStyle = ScrollStyle.scrollbar;
|
_scrollStyle = ScrollStyle.scrollbar;
|
||||||
_scrollX = 0.0;
|
_scrollX = 0.0;
|
||||||
@ -863,7 +863,7 @@ class QualityMonitorModel with ChangeNotifier {
|
|||||||
QualityMonitorData get data => _data;
|
QualityMonitorData get data => _data;
|
||||||
|
|
||||||
checkShowQualityMonitor(String id) async {
|
checkShowQualityMonitor(String id) async {
|
||||||
final show = await bind.getSessionToggleOption(
|
final show = await bind.sessionGetToggleOption(
|
||||||
id: id, arg: 'show-quality-monitor') ==
|
id: id, arg: 'show-quality-monitor') ==
|
||||||
true;
|
true;
|
||||||
if (_show != show) {
|
if (_show != show) {
|
||||||
|
@ -116,7 +116,7 @@ pub fn session_connect(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_session_remember(id: String) -> Option<bool> {
|
pub fn session_get_remember(id: String) -> Option<bool> {
|
||||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||||
Some(session.get_remember())
|
Some(session.get_remember())
|
||||||
} else {
|
} else {
|
||||||
@ -124,7 +124,7 @@ pub fn get_session_remember(id: String) -> Option<bool> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_session_toggle_option(id: String, arg: String) -> Option<bool> {
|
pub fn session_get_toggle_option(id: String, arg: String) -> Option<bool> {
|
||||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||||
Some(session.get_toggle_option(&arg))
|
Some(session.get_toggle_option(&arg))
|
||||||
} else {
|
} else {
|
||||||
@ -132,12 +132,12 @@ pub fn get_session_toggle_option(id: String, arg: String) -> Option<bool> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_session_toggle_option_sync(id: String, arg: String) -> SyncReturn<bool> {
|
pub fn session_get_toggle_option_sync(id: String, arg: String) -> SyncReturn<bool> {
|
||||||
let res = get_session_toggle_option(id, arg) == Some(true);
|
let res = session_get_toggle_option(id, arg) == Some(true);
|
||||||
SyncReturn(res)
|
SyncReturn(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_session_image_quality(id: String) -> Option<String> {
|
pub fn session_get_image_quality(id: String) -> Option<String> {
|
||||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||||
Some(session.get_image_quality())
|
Some(session.get_image_quality())
|
||||||
} else {
|
} else {
|
||||||
@ -145,7 +145,7 @@ pub fn get_session_image_quality(id: String) -> Option<String> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_session_option(id: String, arg: String) -> Option<String> {
|
pub fn session_get_option(id: String, arg: String) -> Option<String> {
|
||||||
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
if let Some(session) = SESSIONS.read().unwrap().get(&id) {
|
||||||
Some(session.get_option(&arg))
|
Some(session.get_option(&arg))
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user