mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +10:00
Changes
This commit is contained in:
@@ -60,9 +60,9 @@ class AutomaticSysPatch:
|
||||
ID_GITHUB = wx.NewId()
|
||||
ID_UPDATE = wx.NewId()
|
||||
|
||||
url = f"https://raw.githubusercontent.com/dortania/OpenCore-Legacy-Patcher/{version}/CHANGELOG.md"
|
||||
response = requests.get(url)
|
||||
changelog = response.text.split(f"## {self.constants.patcher_version}\n")[0]
|
||||
url = "https://api.github.com/repos/dortania/OpenCore-Legacy-Patcher/releases/latest"
|
||||
response = requests.get(url).json()
|
||||
changelog = response["body"].split("## Asset Information")[0]
|
||||
|
||||
html_markdown = markdown2.markdown(changelog)
|
||||
html_css = """
|
||||
@@ -90,8 +90,8 @@ class AutomaticSysPatch:
|
||||
}
|
||||
</style>
|
||||
"""
|
||||
frame = wx.Dialog(None, -1, title="", size=(600, 400))
|
||||
frame.SetMinSize((600, 400))
|
||||
frame = wx.Dialog(None, -1, title="", size=(600, 500))
|
||||
frame.SetMinSize((600, 500))
|
||||
frame.SetWindowStyle(wx.STAY_ON_TOP)
|
||||
panel = wx.Panel(frame)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
@@ -101,7 +101,7 @@ class AutomaticSysPatch:
|
||||
self.title_text.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
|
||||
self.description.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
|
||||
self.web_view = wx.html2.WebView.New(panel, style=wx.BORDER_SUNKEN)
|
||||
html_code = html_css+html_markdown.replace("<a href=", "<a target='_blank' href=").replace("<h1>OpenCore Legacy Patcher changelog</h1>", "")
|
||||
html_code = html_css+html_markdown.replace("<a href=", "<a target='_blank' href=")
|
||||
self.web_view.SetPage(html_code, "")
|
||||
self.web_view.Bind(wx.html2.EVT_WEBVIEW_NEWWINDOW, self._onWebviewNav)
|
||||
self.web_view.EnableContextMenu(False)
|
||||
|
||||
@@ -343,9 +343,9 @@ class MainFrame(wx.Frame):
|
||||
ID_GITHUB = wx.NewId()
|
||||
ID_UPDATE = wx.NewId()
|
||||
|
||||
url = f"https://raw.githubusercontent.com/dortania/OpenCore-Legacy-Patcher/{oclp_version}/CHANGELOG.md"
|
||||
response = requests.get(url)
|
||||
changelog = response.text.split(f"## {self.constants.patcher_version}\n")[0]
|
||||
url = "https://api.github.com/repos/dortania/OpenCore-Legacy-Patcher/releases/latest"
|
||||
response = requests.get(url).json()
|
||||
changelog = response["body"].split("## Asset Information")[0]
|
||||
|
||||
html_markdown = markdown2.markdown(changelog)
|
||||
html_css = """
|
||||
@@ -359,7 +359,6 @@ class MainFrame(wx.Frame):
|
||||
}
|
||||
h2 {
|
||||
line-height: 0.5;
|
||||
padding-left: 10px;
|
||||
}
|
||||
a {
|
||||
color: -apple-system-control-accent;
|
||||
@@ -373,8 +372,8 @@ class MainFrame(wx.Frame):
|
||||
}
|
||||
</style>
|
||||
"""
|
||||
frame = wx.Dialog(None, -1, title="", size=(600, 400))
|
||||
frame.SetMinSize((600, 400))
|
||||
frame = wx.Dialog(None, -1, title="", size=(600, 500))
|
||||
frame.SetMinSize((600, 500))
|
||||
frame.SetWindowStyle(wx.STAY_ON_TOP)
|
||||
panel = wx.Panel(frame)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
@@ -384,11 +383,11 @@ class MainFrame(wx.Frame):
|
||||
self.title_text.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
|
||||
self.description.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
|
||||
self.web_view = wx.html2.WebView.New(panel, style=wx.BORDER_SUNKEN)
|
||||
html_code = html_css+html_markdown.replace("<a href=", "<a target='_blank' href=").replace("<h1>OpenCore Legacy Patcher changelog</h1>", "")
|
||||
html_code = html_css+html_markdown.replace("<a href=", "<a target='_blank' href=")
|
||||
self.web_view.SetPage(html_code, "")
|
||||
self.web_view.Bind(wx.html2.EVT_WEBVIEW_NEWWINDOW, self._onWebviewNav)
|
||||
self.web_view.EnableContextMenu(False)
|
||||
self.close_button = wx.Button(panel, label="Ignore")
|
||||
self.close_button = wx.Button(panel, label="Dismiss")
|
||||
self.close_button.Bind(wx.EVT_BUTTON, lambda event: frame.EndModal(wx.ID_CANCEL))
|
||||
self.view_button = wx.Button(panel, ID_GITHUB, label="View on GitHub")
|
||||
self.view_button.Bind(wx.EVT_BUTTON, lambda event: frame.EndModal(ID_GITHUB))
|
||||
|
||||
Reference in New Issue
Block a user