Remove stop gap “supports_privileged_helper()” code

Intended to handle transition better, now that it’s complete the code is no longer required
This commit is contained in:
Mykola Grymalyuk
2024-05-27 17:11:28 -06:00
parent 1e650637eb
commit 8fb2ee4b83
9 changed files with 19 additions and 104 deletions

View File

@@ -1325,21 +1325,15 @@ Hardware Information:
raise Exception("Test Exception")
def on_mount_root_vol(self, event: wx.Event) -> None:
if os.geteuid() != 0 and subprocess_wrapper.supports_privileged_helper() is False:
wx.MessageDialog(self.parent, "Please relaunch as Root to mount the Root Volume", "Error", wx.OK | wx.ICON_ERROR).ShowModal()
#Don't need to pass model as we're bypassing all logic
if sys_patch.PatchSysVolume("",self.constants)._mount_root_vol() == True:
wx.MessageDialog(self.parent, "Root Volume Mounted, remember to fix permissions before saving the Root Volume", "Success", wx.OK | wx.ICON_INFORMATION).ShowModal()
else:
#Don't need to pass model as we're bypassing all logic
if sys_patch.PatchSysVolume("",self.constants)._mount_root_vol() == True:
wx.MessageDialog(self.parent, "Root Volume Mounted, remember to fix permissions before saving the Root Volume", "Success", wx.OK | wx.ICON_INFORMATION).ShowModal()
else:
wx.MessageDialog(self.parent, "Root Volume Mount Failed, check terminal output", "Error", wx.OK | wx.ICON_ERROR).ShowModal()
wx.MessageDialog(self.parent, "Root Volume Mount Failed, check terminal output", "Error", wx.OK | wx.ICON_ERROR).ShowModal()
def on_bless_root_vol(self, event: wx.Event) -> None:
if os.geteuid() != 0 and subprocess_wrapper.supports_privileged_helper() is False:
wx.MessageDialog(self.parent, "Please relaunch as Root to save changes", "Error", wx.OK | wx.ICON_ERROR).ShowModal()
#Don't need to pass model as we're bypassing all logic
if sys_patch.PatchSysVolume("",self.constants)._rebuild_root_volume() == True:
wx.MessageDialog(self.parent, "Root Volume saved, please reboot to apply changes", "Success", wx.OK | wx.ICON_INFORMATION).ShowModal()
else:
#Don't need to pass model as we're bypassing all logic
if sys_patch.PatchSysVolume("",self.constants)._rebuild_root_volume() == True:
wx.MessageDialog(self.parent, "Root Volume saved, please reboot to apply changes", "Success", wx.OK | wx.ICON_INFORMATION).ShowModal()
else:
wx.MessageDialog(self.parent, "Root Volume update Failed, check terminal output", "Error", wx.OK | wx.ICON_ERROR).ShowModal()
wx.MessageDialog(self.parent, "Root Volume update Failed, check terminal output", "Error", wx.OK | wx.ICON_ERROR).ShowModal()

View File

@@ -66,8 +66,6 @@ class GenerateMenubar:
aboutItem = fileMenu.Append(wx.ID_ABOUT, "&About OpenCore Legacy Patcher")
fileMenu.AppendSeparator()
relaunchItem = fileMenu.Append(wx.ID_ANY, "&Relaunch as Root")
fileMenu.AppendSeparator()
revealLogItem = fileMenu.Append(wx.ID_ANY, "&Reveal Log File")
menubar.Append(fileMenu, "&File")
@@ -76,9 +74,6 @@ class GenerateMenubar:
self.frame.Bind(wx.EVT_MENU, lambda event: gui_about.AboutFrame(self.constants), aboutItem)
self.frame.Bind(wx.EVT_MENU, lambda event: subprocess.run(["/usr/bin/open", "--reveal", self.constants.log_filepath]), revealLogItem)
if os.geteuid() == 0 or subprocess_wrapper.supports_privileged_helper() is True:
relaunchItem.Enable(False)
class GaugePulseCallback:
"""