diff --git a/flutter_hbb/lib/model.dart b/flutter_hbb/lib/model.dart index 592f0c131..549582211 100644 --- a/flutter_hbb/lib/model.dart +++ b/flutter_hbb/lib/model.dart @@ -168,6 +168,7 @@ class FfiModel with ChangeNotifier { void handlePeerInfo(Map evt, BuildContext context) { dismissLoading(); + _pi.version = evt['version']; _pi.username = evt['username']; _pi.hostname = evt['hostname']; _pi.platform = evt['platform']; @@ -620,6 +621,7 @@ class Display { } class PeerInfo { + String version; String username; String hostname; String platform; diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index 8a09caf48..c6fc57e2d 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -721,10 +721,16 @@ void showActions(BuildContext context) { context: context, position: RelativeRect.fromLTRB(x, y, x, y), items: [ - PopupMenuItem( - child: Text('Insert Ctrl + Alt + Del'), value: 'cad'), - PopupMenuItem(child: Text('Insert Lock'), value: 'lock'), - ], + PopupMenuItem( + child: Text('Insert Ctrl + Alt + Del'), value: 'cad'), + PopupMenuItem( + child: Text('Insert Lock'), value: 'lock'), + ] + + FFI.ffiModel.pi.version.isEmpty + ? [] + : [ + PopupMenuItem(child: Text('Refresh'), value: 'refresh'), + ], elevation: 8, ); if (value == 'cad') { @@ -733,5 +739,8 @@ void showActions(BuildContext context) { if (value == 'lock') { FFI.setByName('lock_screen'); } + if (value == 'refresh') { + FFI.setByName('refresh'); + } }(); }