Skip to content

Commit

Permalink
[Normal] Update Some Code
Browse files Browse the repository at this point in the history
Signed-off-by: ColdWindScholar <[email protected]>
  • Loading branch information
ColdWindScholar committed Mar 30, 2024
1 parent 4eedafd commit 8e3144f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/setting.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ version = 3.4.2
barlevel = 0.90
oobe = 4
language = Chinese-Simplified
contextpatch = 1

8 changes: 7 additions & 1 deletion tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,13 @@ def setting_tab(self):
self.show_local.set(settings.path)
ai = StringVar()
ai.set(settings.ai_engine)
context = StringVar(value=settings.contextpatch)

def on_value_change():
settings.set_value('ai_engine', ai.get())

ai.trace("w", lambda *x: on_value_change())
context.trace("w", lambda *x: settings.set_value('contextpatch', context.get()))
sf1 = ttk.Frame(self.tab3)
sf2 = ttk.Frame(self.tab3)
sf3 = ttk.Frame(self.tab3)
Expand All @@ -334,6 +336,9 @@ def on_value_change():
ttk.Checkbutton(sf4, text=lang.ai_engine, variable=ai, onvalue='1',
offvalue='0',
style="Toggle.TButton").pack(padx=10, pady=10, fill=X)
ttk.Checkbutton(sf4, text="Context_Patch", variable=context, onvalue='1',
offvalue='0',
style="Toggle.TButton").pack(padx=10, pady=10, fill=X)
lb3.pack(padx=10, pady=10, side='left')
lb3.bind('<<ComboboxSelected>>', lambda *x: settings.set_language())
sf1.pack(padx=10, pady=10, fill='both')
Expand Down Expand Up @@ -2073,7 +2078,8 @@ def packrom(edbgs, dbgs, dbfs, scale, parts, spatch, *others) -> any:
print(e)
fspatch.main(work + dname, os.path.join(work + "config", dname + "_fs_config"))
utils.qc(work + "config" + os.sep + dname + "_fs_config")
contextpatch.main(work + dname, work + "config" + os.sep + dname + "_file_contexts")
if settings.contextpatch == "1":
contextpatch.main(work + dname, work + "config" + os.sep + dname + "_file_contexts")
utils.qc(work + "config" + os.sep + dname + "_file_contexts")
if erofsext4:
if parts_dict[dname] == 'erofs':
Expand Down

0 comments on commit 8e3144f

Please sign in to comment.