Ver código fonte

home: disable features not implemented for remote yet

osy 1 ano atrás
pai
commit
4c910d8d94

+ 2 - 0
Platform/Shared/VMCommands.swift

@@ -21,6 +21,7 @@ struct VMCommands: Commands {
     
     @CommandsBuilder
     var body: some Commands {
+        #if !WITH_REMOTE // FIXME: implement remote feature
         CommandGroup(replacing: .newItem) {
             Button(action: { NotificationCenter.default.post(name: NSNotification.NewVirtualMachine, object: nil) }, label: {
                 Text("New…")
@@ -29,6 +30,7 @@ struct VMCommands: Commands {
                 Text("Open…")
             }).keyboardShortcut(KeyEquivalent("o"))
         }
+        #endif
         SidebarCommands()
         ToolbarCommands()
         CommandGroup(replacing: .help) {

+ 4 - 0
Platform/Shared/VMContextMenuModifier.swift

@@ -61,6 +61,7 @@ struct VMContextMenuModifier: ViewModifier {
             }.help("Reveal where the VM is stored.")
             Divider()
             #endif
+            #if !WITH_REMOTE // FIXME: implement remote feature
             Button {
                 data.close(vm: vm) // close window
                 data.edit(vm: vm)
@@ -68,6 +69,7 @@ struct VMContextMenuModifier: ViewModifier {
                 Label("Edit", systemImage: "slider.horizontal.3")
             }.disabled(vm.hasSuspendState || !vm.isModifyAllowed)
             .help("Modify settings for this VM.")
+            #endif
             if vm.hasSuspendState || !vm.isStopped {
                 Button {
                     confirmAction = .confirmStopVM
@@ -120,6 +122,7 @@ struct VMContextMenuModifier: ViewModifier {
                 
                 Divider()
             }
+            #if !WITH_REMOTE // FIXME: implement remote feature
             Button {
                 shareItem = .utmCopy(vm)
                 showSharePopup.toggle()
@@ -164,6 +167,7 @@ struct VMContextMenuModifier: ViewModifier {
                 }.disabled(!vm.isModifyAllowed)
                 .help("Delete this VM and all its data.")
             }
+            #endif
         }
         .modifier(VMShareItemModifier(isPresented: $showSharePopup, shareItem: shareItem))
         .modifier(VMConfirmActionModifier(vm: vm, confirmAction: $confirmAction) {

+ 5 - 1
Platform/Shared/VMNavigationListView.swift

@@ -66,8 +66,10 @@ struct VMNavigationListView: View {
                 }
             }
         }.onMove(perform: move)
+        #if !WITH_REMOTE // FIXME: implement remote feature
         .onDelete(perform: delete)
-        
+        #endif
+
         if data.pendingVMs.count > 0 {
             Section(header: Text("Pending")) {
                 ForEach(data.pendingVMs, id: \.name) { vm in
@@ -119,9 +121,11 @@ private struct VMListModifier: ViewModifier {
                 newButton
             }
             #else
+            #if !WITH_REMOTE // FIXME: implement remote feature
             ToolbarItem(placement: .navigationBarLeading) {
                 newButton
             }
+            #endif
             #if !os(visionOS) && !WITH_REMOTE
             ToolbarItem(placement: .navigationBarTrailing) {
                 Button("Settings") {

+ 4 - 0
Platform/Shared/VMRemovableDrivesView.swift

@@ -78,6 +78,7 @@ struct VMRemovableDrivesView: View {
             }
             ForEach(config.drives.filter { $0.isExternal }) { drive in
                 HStack {
+                    #if !WITH_REMOTE // FIXME: implement remote feature
                     // Drive menu
                     Menu {
                         // Browse button
@@ -118,6 +119,9 @@ struct VMRemovableDrivesView: View {
                     } label: {
                         DriveLabel(drive: drive, isInserted: qemuVM.externalImageURL(for: drive) != nil)
                     }.disabled(vm.hasSuspendState)
+                    #else
+                    DriveLabel(drive: drive, isInserted: qemuVM.externalImageURL(for: drive) != nil)
+                    #endif
                     Spacer()
                     // Disk image path, or (empty)
                     Text(pathFor(drive))

+ 4 - 0
Platform/Shared/VMToolbarModifier.swift

@@ -51,6 +51,7 @@ struct VMToolbarModifier: ViewModifier {
             UTMPreferenceButtonToolbarContent()
             #endif
             ToolbarItemGroup(placement: buttonPlacement) {
+                #if !WITH_REMOTE // FIXME: implement remote feature
                 if vm.isShortcut {
                     DestructiveButton {
                         confirmAction = .confirmDeleteShortcut
@@ -112,6 +113,7 @@ struct VMToolbarModifier: ViewModifier {
                     Spacer()
                 }
                 #endif
+                #endif
                 if vm.hasSuspendState || !vm.isStopped {
                     Button {
                         confirmAction = .confirmStopVM
@@ -129,6 +131,7 @@ struct VMToolbarModifier: ViewModifier {
                     }.help("Run selected VM")
                     .padding(.leading, padding)
                 }
+                #if !WITH_REMOTE // FIXME: implement remote feature
                 #if !os(macOS)
                 if bottom {
                     Spacer()
@@ -143,6 +146,7 @@ struct VMToolbarModifier: ViewModifier {
                 }.help("Edit selected VM")
                 .disabled(vm.hasSuspendState || !vm.isModifyAllowed)
                 .padding(.leading, padding)
+                #endif
             }
         }
         .modifier(VMShareItemModifier(isPresented: $showSharePopup, shareItem: shareItem))