Fix: Resolve SEGV in manjaro-hello by importing required modules

This commit is contained in:
phoepsilonix
2025-01-19 05:42:16 +00:00
committed by Frede H
parent f182934cab
commit f376fdc0c9
2 changed files with 15 additions and 6 deletions
+12 -3
View File
@@ -66,7 +66,7 @@ class EmbedLayouts(Embed):
try:
self.box = LayoutBox(window, usehello=True)
grid = Gtk.Grid()
grid.set_margin_left(15)
grid.set_margin_start(15)
image = Gtk.Image(stock=Gtk.STOCK_GO_BACK)
backBtn=Gtk.Button(label=None, image=image)
backBtn.set_name("home")
@@ -86,13 +86,18 @@ class EmbedBrowser(Embed):
"""Application-utility"""
def load(self, window: Gtk.Window) -> bool:
try:
from application_utility import application_utility
from application_utility.translation import i18n
from application_utility.browser.application_browser import ApplicationBrowser
from application_utility.browser.exceptions import NoAppInIsoError
from application_utility.browser import alpm
from application_utility.browser import data
from application_utility.config.hello_config import HelloConfig
try:
conf = HelloConfig(application="manjaro-hello")
grid = Gtk.Grid()
grid.set_margin_left(5)
grid.set_margin_start(5)
grid.set_margin_end(5)
grid.set_margin_top(5)
grid.set_margin_bottom(5)
image = Gtk.Image(stock=Gtk.STOCK_GO_BACK)
@@ -236,7 +241,9 @@ class Hello(Gtk.Window):
elif self.save["locale"] == self.preferences["default_locale"]:
return self.preferences["default_locale"]
else:
sys_locale = locale.getdefaultlocale()[0]
locale.setlocale(locale.LC_ALL, '')
sys_locale = locale.getlocale()[0]
# If user's locale is supported
if os.path.isfile(path.format(sys_locale)):
if "_" in sys_locale:
@@ -460,5 +467,7 @@ def get_lsb_infos():
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
hello = Hello()
hello.connect('delete-event', Gtk.main_quit)
hello.connect("destroy", Gtk.main_quit)
Gtk.main()
+2 -2
View File
@@ -26,8 +26,8 @@
<object class="GtkGrid" id="homepage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">10</property>
<property name="margin-right">10</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="row-spacing">20</property>