]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/actions/initializer.py
Upver to 1.4.1
[waydroid.git] / tools / actions / initializer.py
index d886fa1fb48cdad6db892c567961395e0677a757..41a0be38320bb2d01ad52b83f906b0a6fb805ade 100644 (file)
@@ -113,8 +113,13 @@ def init(args):
             status = helpers.lxc.status(args)
         if status != "STOPPED":
             logging.info("Stopping container")
-            helpers.lxc.stop(args)
-        helpers.images.umount_rootfs(args)
+            try:
+                container = tools.helpers.ipc.DBusContainerService()
+                args.session = container.GetSession()
+                container.Stop(False)
+            except Exception as e:
+                logging.debug(e)
+                tools.actions.container_manager.stop(args)
         if args.images_path not in tools.config.defaults["preinstalled_images_paths"]:
             helpers.images.get(args)
         else:
@@ -134,8 +139,11 @@ def init(args):
         helpers.lxc.make_base_props(args)
         if status != "STOPPED":
             logging.info("Starting container")
-            helpers.images.mount_rootfs(args, args.images_path)
-            helpers.lxc.start(args)
+            try:
+                container.Start(args.session)
+            except Exception as e:
+                logging.debug(e)
+                logging.error("Failed to restart container. Please do so manually.")
 
         if "running_init_in_service" not in args or not args.running_init_in_service:
             try:
@@ -285,7 +293,7 @@ def remote_init_client(args):
             channels_cfg = tools.config.load_channels()
 
             self.set_default_size(600, 250)
-            self.set_icon_from_file(tools.config.tools_src + "/data/AppIcon.png")
+            self.set_icon_name("waydroid")
 
             grid = Gtk.Grid(row_spacing=6, column_spacing=6, margin=10, column_homogeneous=True)
             grid.set_hexpand(True)