mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 14:29:26 +08:00
add: migrate one click to stop all running instance
This commit is contained in:
@@ -1557,6 +1557,35 @@ def timedelta_to_text(delta=None):
|
||||
|
||||
|
||||
class AlasGUI(AlasGUI):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
if self.theme == "dark":
|
||||
add_css(filepath_css("dark-alas"))
|
||||
self.icon_rgb = 'rgb(85%,85%,85%)'
|
||||
else:
|
||||
add_css(filepath_css("light-alas"))
|
||||
self.icon_rgb = 'rgb(10%,10%,10%)'
|
||||
|
||||
def stop_all_running_alas(self):
|
||||
running = ProcessManager.running_instances()
|
||||
for i in running:
|
||||
i.stop()
|
||||
|
||||
@use_scope("aside")
|
||||
def set_aside(self) -> None:
|
||||
super().set_aside()
|
||||
put_icon_buttons(
|
||||
Icon.STOP,
|
||||
buttons=[
|
||||
{
|
||||
"label": t("Gui.Button.OneClickStop"),
|
||||
"value": "OneClickStop",
|
||||
"color": "aside",
|
||||
}
|
||||
],
|
||||
onclick=[self.stop_all_running_alas],
|
||||
).style(f'stroke:{self.icon_rgb}')
|
||||
|
||||
@use_scope("content", clear=True)
|
||||
def alas_overview(self) -> None:
|
||||
|
||||
@@ -587,6 +587,10 @@ def time_delta(_timedelta):
|
||||
return _time_dict
|
||||
|
||||
|
||||
class Icon(Icon):
|
||||
STOP = _read(filepath_icon("stop"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def gen(x):
|
||||
|
||||
Reference in New Issue
Block a user