remove hide_cm

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-08-30 11:48:42 +08:00
parent 0ee2b02700
commit 76a18f5ed3
5 changed files with 28 additions and 12 deletions

View File

@@ -31,7 +31,7 @@ class ServerModel with ChangeNotifier {
bool _audioOk = false;
bool _fileOk = false;
bool _showElevation = false;
bool _hideCm = false;
bool hideCm = false;
int _connectStatus = 0; // Rendezvous Server status
String _verificationMethod = "";
String _temporaryPasswordLength = "";
@@ -61,8 +61,6 @@ class ServerModel with ChangeNotifier {
bool get showElevation => _showElevation;
bool get hideCm => _hideCm;
int get connectStatus => _connectStatus;
String get verificationMethod {
@@ -121,6 +119,7 @@ class ServerModel with ChangeNotifier {
_emptyIdShow = translate("Generating ...");
_serverId = IDTextEditingController(text: _emptyIdShow);
/*
// initital _hideCm at startup
final verificationMethod =
bind.mainGetOptionSync(key: "verification-method");
@@ -131,6 +130,7 @@ class ServerModel with ChangeNotifier {
verificationMethod == kUsePermanentPassword)) {
_hideCm = false;
}
*/
timerCallback() async {
final connectionStatus =
@@ -155,7 +155,7 @@ class ServerModel with ChangeNotifier {
}
} else {
_zeroClientLengthCounter = 0;
if (!_hideCm) showCmWindow();
if (!hideCm) showCmWindow();
}
}
}
@@ -210,12 +210,14 @@ class ServerModel with ChangeNotifier {
final temporaryPasswordLength =
await bind.mainGetOption(key: "temporary-password-length");
final approveMode = await bind.mainGetOption(key: 'approve-mode');
/*
var hideCm = option2bool(
'allow-hide-cm', await bind.mainGetOption(key: 'allow-hide-cm'));
if (!(approveMode == 'password' &&
verificationMethod == kUsePermanentPassword)) {
hideCm = false;
}
*/
if (_approveMode != approveMode) {
_approveMode = approveMode;
update = true;
@@ -247,6 +249,7 @@ class ServerModel with ChangeNotifier {
_temporaryPasswordLength = temporaryPasswordLength;
update = true;
}
/*
if (_hideCm != hideCm) {
_hideCm = hideCm;
if (desktopType == DesktopType.cm) {
@@ -258,6 +261,7 @@ class ServerModel with ChangeNotifier {
}
update = true;
}
*/
if (update) {
notifyListeners();
}
@@ -461,7 +465,7 @@ class ServerModel with ChangeNotifier {
if (desktopType == DesktopType.cm) {
if (_clients.isEmpty) {
hideCmWindow();
} else if (!_hideCm) {
} else if (!hideCm) {
showCmWindow();
}
}
@@ -495,7 +499,7 @@ class ServerModel with ChangeNotifier {
_clients.removeAt(index_disconnected);
tabController.remove(index_disconnected);
}
if (desktopType == DesktopType.cm && !_hideCm) {
if (desktopType == DesktopType.cm && !hideCm) {
showCmWindow();
}
scrollToBottom();