add custom client option to allow remote cm modification (#8660)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
6f74080a2d
commit
0bb4d43e9e
@ -135,6 +135,7 @@ const String kOptionAllowLinuxHeadless = "allow-linux-headless";
|
|||||||
const String kOptionAllowRemoveWallpaper = "allow-remove-wallpaper";
|
const String kOptionAllowRemoveWallpaper = "allow-remove-wallpaper";
|
||||||
const String kOptionStopService = "stop-service";
|
const String kOptionStopService = "stop-service";
|
||||||
const String kOptionDirectxCapture = "enable-directx-capture";
|
const String kOptionDirectxCapture = "enable-directx-capture";
|
||||||
|
const String kOptionAllowRemoteCmModification = "allow-remote-cm-modification";
|
||||||
|
|
||||||
const String kOptionToggleViewOnly = "view-only";
|
const String kOptionToggleViewOnly = "view-only";
|
||||||
|
|
||||||
|
@ -112,9 +112,11 @@ class ConnectionManagerState extends State<ConnectionManager>
|
|||||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
super.didChangeAppLifecycleState(state);
|
super.didChangeAppLifecycleState(state);
|
||||||
if (state == AppLifecycleState.resumed) {
|
if (state == AppLifecycleState.resumed) {
|
||||||
|
if (!allowRemoteCMModification()) {
|
||||||
shouldBeBlocked(_block, null);
|
shouldBeBlocked(_block, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -183,7 +185,7 @@ class ConnectionManagerState extends State<ConnectionManager>
|
|||||||
selectedBorderColor: MyTheme.accent,
|
selectedBorderColor: MyTheme.accent,
|
||||||
maxLabelWidth: 100,
|
maxLabelWidth: 100,
|
||||||
tail: null, //buildScrollJumper(),
|
tail: null, //buildScrollJumper(),
|
||||||
blockTab: _block,
|
blockTab: allowRemoteCMModification() ? null : _block,
|
||||||
selectedTabBackgroundColor:
|
selectedTabBackgroundColor:
|
||||||
Theme.of(context).hintColor.withOpacity(0),
|
Theme.of(context).hintColor.withOpacity(0),
|
||||||
tabBuilder: (key, icon, label, themeConf) {
|
tabBuilder: (key, icon, label, themeConf) {
|
||||||
@ -226,7 +228,9 @@ class ConnectionManagerState extends State<ConnectionManager>
|
|||||||
Consumer<ChatModel>(
|
Consumer<ChatModel>(
|
||||||
builder: (_, model, child) => SizedBox(
|
builder: (_, model, child) => SizedBox(
|
||||||
width: realChatPageWidth,
|
width: realChatPageWidth,
|
||||||
child: buildRemoteBlock(
|
child: allowRemoteCMModification()
|
||||||
|
? buildSidePage()
|
||||||
|
: buildRemoteBlock(
|
||||||
child: buildSidePage(),
|
child: buildSidePage(),
|
||||||
block: _block,
|
block: _block,
|
||||||
mask: true),
|
mask: true),
|
||||||
@ -1057,6 +1061,10 @@ class _CmControlPanel extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void checkClickTime(int id, Function() callback) async {
|
void checkClickTime(int id, Function() callback) async {
|
||||||
|
if (allowRemoteCMModification()) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var clickCallbackTime = DateTime.now().millisecondsSinceEpoch;
|
var clickCallbackTime = DateTime.now().millisecondsSinceEpoch;
|
||||||
await bind.cmCheckClickTime(connId: id);
|
await bind.cmCheckClickTime(connId: id);
|
||||||
Timer(const Duration(milliseconds: 120), () async {
|
Timer(const Duration(milliseconds: 120), () async {
|
||||||
@ -1065,6 +1073,11 @@ void checkClickTime(int id, Function() callback) async {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool allowRemoteCMModification() {
|
||||||
|
return option2bool(kOptionAllowRemoteCmModification,
|
||||||
|
bind.mainGetLocalOption(key: kOptionAllowRemoteCmModification));
|
||||||
|
}
|
||||||
|
|
||||||
class _FileTransferLogPage extends StatefulWidget {
|
class _FileTransferLogPage extends StatefulWidget {
|
||||||
_FileTransferLogPage({Key? key}) : super(key: key);
|
_FileTransferLogPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -2109,6 +2109,7 @@ pub mod keys {
|
|||||||
pub const OPTION_FLUTTER_PEER_TAB_VISIBLE: &str = "peer-tab-visible";
|
pub const OPTION_FLUTTER_PEER_TAB_VISIBLE: &str = "peer-tab-visible";
|
||||||
pub const OPTION_FLUTTER_PEER_CARD_UI_TYLE: &str = "peer-card-ui-type";
|
pub const OPTION_FLUTTER_PEER_CARD_UI_TYLE: &str = "peer-card-ui-type";
|
||||||
pub const OPTION_FLUTTER_CURRENT_AB_NAME: &str = "current-ab-name";
|
pub const OPTION_FLUTTER_CURRENT_AB_NAME: &str = "current-ab-name";
|
||||||
|
pub const OPTION_ALLOW_REMOTE_CM_MODIFICATION: &str = "allow-remote-cm-modification";
|
||||||
|
|
||||||
// android floating window options
|
// android floating window options
|
||||||
pub const OPTION_DISABLE_FLOATING_WINDOW: &str = "disable-floating-window";
|
pub const OPTION_DISABLE_FLOATING_WINDOW: &str = "disable-floating-window";
|
||||||
@ -2195,6 +2196,7 @@ pub mod keys {
|
|||||||
"hide-server-settings",
|
"hide-server-settings",
|
||||||
"hide-proxy-settings",
|
"hide-proxy-settings",
|
||||||
"hide-username-on-card",
|
"hide-username-on-card",
|
||||||
|
OPTION_ALLOW_REMOTE_CM_MODIFICATION,
|
||||||
];
|
];
|
||||||
// DEFAULT_SETTINGS, OVERWRITE_SETTINGS
|
// DEFAULT_SETTINGS, OVERWRITE_SETTINGS
|
||||||
pub const KEYS_SETTINGS: &[&str] = &[
|
pub const KEYS_SETTINGS: &[&str] = &[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user