feat: kill VMs using quickemu --kill when running quickemu >= 4.9.6
This commit is contained in:
parent
dcadfb69f5
commit
44a4114aec
|
|
@ -9,6 +9,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:gettext_i18n/gettext_i18n.dart';
|
import 'package:gettext_i18n/gettext_i18n.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
import 'package:process_run/shell.dart';
|
import 'package:process_run/shell.dart';
|
||||||
|
import 'package:version/version.dart';
|
||||||
|
|
||||||
import '../globals.dart';
|
import '../globals.dart';
|
||||||
import '../mixins/preferences_mixin.dart';
|
import '../mixins/preferences_mixin.dart';
|
||||||
|
|
@ -337,11 +338,18 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
).then((result) {
|
).then((result) async {
|
||||||
result = result ?? false;
|
result = result ?? false;
|
||||||
if (result) {
|
if (result) {
|
||||||
var shell = Shell();
|
var shell = Shell();
|
||||||
shell.run(['killall', currentVm].join(' '));
|
// If Quickemu is newer than 4.9.6, use the new --kill option
|
||||||
|
// which is macOS compatible.
|
||||||
|
var quickemuVersion = Version.parse(await fetchQuickemuVersion());
|
||||||
|
if (quickemuVersion >= Version(4, 9, 6)) {
|
||||||
|
shell.run(['quickemu', '--vm', '$currentVm.conf', '--kill'].join(' '));
|
||||||
|
} else {
|
||||||
|
shell.run(['killall', currentVm].join(' '));
|
||||||
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_activeVms.remove(currentVm);
|
_activeVms.remove(currentVm);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -882,6 +882,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.4"
|
||||||
|
version:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: version
|
||||||
|
sha256: "3d4140128e6ea10d83da32fef2fa4003fccbf6852217bb854845802f04191f94"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.2"
|
||||||
vm_service:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -1100,6 +1100,16 @@
|
||||||
"source": "hosted",
|
"source": "hosted",
|
||||||
"version": "2.1.4"
|
"version": "2.1.4"
|
||||||
},
|
},
|
||||||
|
"version": {
|
||||||
|
"dependency": "direct main",
|
||||||
|
"description": {
|
||||||
|
"name": "version",
|
||||||
|
"sha256": "3d4140128e6ea10d83da32fef2fa4003fccbf6852217bb854845802f04191f94",
|
||||||
|
"url": "https://pub.dev"
|
||||||
|
},
|
||||||
|
"source": "hosted",
|
||||||
|
"version": "3.0.2"
|
||||||
|
},
|
||||||
"vm_service": {
|
"vm_service": {
|
||||||
"dependency": "transitive",
|
"dependency": "transitive",
|
||||||
"description": {
|
"description": {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ dependencies:
|
||||||
url_launcher: ^6.3.0
|
url_launcher: ^6.3.0
|
||||||
shared_preferences: ^2.2.3
|
shared_preferences: ^2.2.3
|
||||||
tuple: ^2.0.2
|
tuple: ^2.0.2
|
||||||
|
version: ^3.0.2
|
||||||
window_size:
|
window_size:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/google/flutter-desktop-embedding.git
|
url: https://github.com/google/flutter-desktop-embedding.git
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue