Merge pull request #1578 from Kingtous/master

opt: binary name, macos frame, address book network catch
This commit is contained in:
RustDesk 2022-09-19 10:25:54 +08:00 committed by GitHub
commit de8596d6ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 138 additions and 117 deletions

View File

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import 'package:flutter_hbb/consts.dart';
@ -35,9 +37,7 @@ class _DesktopTabPageState extends State<DesktopTabPage> {
Widget build(BuildContext context) {
RxBool fullscreen = false.obs;
Get.put(fullscreen, tag: 'fullscreen');
return Obx(() => DragToResizeArea(
resizeEdgeSize: fullscreen.value ? 1.0 : 8.0,
child: Container(
final tabWidget = Container(
decoration: BoxDecoration(
border: Border.all(color: MyTheme.color(context).border!)),
child: Overlay(initialEntries: [
@ -56,7 +56,11 @@ class _DesktopTabPageState extends State<DesktopTabPage> {
));
})
]),
)));
);
return Obx(() => Platform.isMacOS
? tabWidget
: DragToResizeArea(
resizeEdgeSize: fullscreen.value ? 1.0 : 8.0, child: tabWidget));
}
void onAddSetting() {

View File

@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:io';
import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:flutter/material.dart';
@ -66,9 +67,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
@override
Widget build(BuildContext context) {
return SubWindowDragToResizeArea(
windowId: windowId(),
child: Container(
final tabWidget = Container(
decoration: BoxDecoration(
border: Border.all(color: MyTheme.color(context).border!)),
child: Scaffold(
@ -78,7 +77,12 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
onWindowCloseButton: handleWindowCloseButton,
tail: const AddButton().paddingOnly(left: 10),
)),
),
);
return Platform.isMacOS
? tabWidget
: SubWindowDragToResizeArea(
windowId: windowId(),
child: tabWidget,
);
}

View File

@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:io';
import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:flutter/material.dart';
@ -74,9 +75,7 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
@override
Widget build(BuildContext context) {
return SubWindowDragToResizeArea(
windowId: windowId(),
child: Container(
final tabWidget = Container(
decoration: BoxDecoration(
border: Border.all(color: MyTheme.color(context).border!)),
child: Scaffold(
@ -89,7 +88,12 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
},
tail: AddButton().paddingOnly(left: 10),
)),
),
);
return Platform.isMacOS
? tabWidget
: SubWindowDragToResizeArea(
windowId: windowId(),
child: tabWidget,
);
}

View File

@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:io';
import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:flutter/material.dart';
@ -86,10 +87,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
@override
Widget build(BuildContext context) {
final RxBool fullscreen = Get.find(tag: 'fullscreen');
return Obx(() => SubWindowDragToResizeArea(
resizeEdgeSize: fullscreen.value ? 1.0 : 8.0,
windowId: windowId(),
child: Container(
final tabWidget = Container(
decoration: BoxDecoration(
border: Border.all(color: MyTheme.color(context).border!)),
child: Scaffold(
@ -115,12 +113,12 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
],
);
} else {
final msgDirect = translate(connectionType.direct.value ==
ConnectionType.strDirect
final msgDirect = translate(
connectionType.direct.value == ConnectionType.strDirect
? 'Direct Connection'
: 'Relay Connection');
final msgSecure = translate(connectionType.secure.value ==
ConnectionType.strSecure
final msgSecure = translate(
connectionType.secure.value == ConnectionType.strSecure
? 'Secure Connection'
: 'Insecure Connection');
return Row(
@ -141,8 +139,13 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
}
}),
)),
),
));
);
return Obx(() => Platform.isMacOS
? tabWidget
: SubWindowDragToResizeArea(
resizeEdgeSize: fullscreen.value ? 1.0 : 8.0,
windowId: windowId(),
child: tabWidget));
}
void onRemoveId(String id) {

View File

@ -45,8 +45,8 @@ class AbModel with ChangeNotifier {
} catch (err) {
abError = err.toString();
} finally {
notifyListeners();
abLoading = false;
notifyListeners();
}
return null;
}
@ -98,12 +98,18 @@ class AbModel with ChangeNotifier {
final body = jsonEncode({
"data": jsonEncode({"tags": tags, "peers": peers})
});
try {
final resp =
await http.post(Uri.parse(api), headers: authHeaders, body: body);
abLoading = false;
abError = "";
await getAb();
notifyListeners();
debugPrint("resp: ${resp.body}");
} catch (e) {
abError = e.toString();
} finally {
abLoading = false;
}
notifyListeners();
}
bool idContainBy(String id) {

View File

@ -4,7 +4,7 @@ project(runner LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "flutter_hbb")
set(BINARY_NAME "rustdesk")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.carriez.flutter_hbb")

View File

@ -5,7 +5,7 @@
// 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = flutter_hbb
PRODUCT_NAME = rustdesk
// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.carriez.flutterHbb

View File

@ -4,7 +4,7 @@ project(flutter_hbb LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "flutter_hbb")
set(BINARY_NAME "rustdesk")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.