Skip to content

Commit

Permalink
fix: Spawn window twice, typos
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Jan 12, 2024
1 parent 1e89cb1 commit a0ccf97
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@
- desktop-file-utils
- libgnome-desktop-4-dev
- libgweather-4-dev
- python3-tz
- python3-requests
- gir1.2-vte-3.91
- libnma-dev
- libnma-gtk4-dev
- mutter-common
- x11-xkb-utils

### Build

Expand Down
4 changes: 2 additions & 2 deletions vanilla_installer/defaults/language.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# keyboard.py
# language.py
#
# Copyright 2023 mirkobrombin
#
Expand Down Expand Up @@ -73,7 +73,7 @@ def __init__(self, window, distro_info, key, step, **kwargs):
self.all_languages_group.connect("row-selected", self.__language_verify)
self.all_languages_group.connect("row-activated", self.__language_verify)
self.__window.carousel.connect("page-changed", self.__language_verify)

self.search_controller.connect("key-released", self.__on_search_key_pressed)
self.entry_search_language.add_controller(self.search_controller)

Expand Down
20 changes: 7 additions & 13 deletions vanilla_installer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,14 @@ def do_activate(self):

win = self.props.active_window
if not win:
if Systeminfo.is_uefi():
win = VanillaWindow(application=self)

if Systeminfo.is_ram_enough() or "IGNORE_RAM" in os.environ:
if Systeminfo.is_cpu_enough() or "IGNORE_CPU" in os.environ:
win = VanillaWindow(application=self)
else:
win = VanillaCpuWindow(application=self)
else:
win = VanillaRamWindow(application=self)


if not Systeminfo.is_ram_enough() and "IGNORE_RAM" not in os.environ:
win = VanillaRamWindow(application=self) # Not enough RAM
elif not Systeminfo.is_cpu_enough() and "IGNORE_CPU" not in os.environ:
win = VanillaCpuWindow(application=self) # Not enough CPU
elif not Systeminfo.is_uefi():
win = VanillaUnsupportedWindow(application=self) # Not UEFI
else:
win = VanillaUnsupportedWindow(application=self)
win = VanillaWindow(application=self) # All good
win.present()

def create_action(self, name, callback, shortcuts=None):
Expand Down
2 changes: 1 addition & 1 deletion vanilla_installer/windows/window_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class VanillaCpuWindow(Adw.Window):
def __init__(self, **kwargs):
super().__init__(**kwargs)

self.description_label.set_label(f"Your computer does have enough CPU cores to run {RecipeLoader().raw['distro_name']} (2)")
self.description_label.set_label(_("Your computer does have enough CPU cores to run %s (minimum 2)") % RecipeLoader().raw['distro_name'])
self.btn_continue.connect("clicked", self.__continue)

def __continue(self, btn):
Expand Down
2 changes: 1 addition & 1 deletion vanilla_installer/windows/window_ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class VanillaRamWindow(Adw.Window):
def __init__(self, **kwargs):
super().__init__(**kwargs)

self.description_label.set_label(f"Your computer does have enough RAM to run {RecipeLoader().raw['distro_name']} (4GB)")
self.description_label.set_label(_("Your computer does have enough RAM to run %s (minimum 4GB)") % RecipeLoader().raw['distro_name'])
self.btn_continue.connect("clicked", self.__continue())

def __continue(self, btn):
Expand Down
2 changes: 1 addition & 1 deletion vanilla_installer/windows/window_unsupported.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class VanillaUnsupportedWindow(Adw.Window):
def __init__(self, **kwargs):
super().__init__(**kwargs)

self.description_label.set_label(f"{RecipeLoader().raw['distro_name']} requires UEFI to install")
self.description_label.set_label(_("%s requires UEFI to install") % RecipeLoader().raw['distro_name'])
self.btn_poweroff.connect("clicked", self.__on_poweroff)

def __on_poweroff(self, btn):
Expand Down

0 comments on commit a0ccf97

Please sign in to comment.