mirror of
https://github.com/Snigdha-OS/snigdhaos-kernel-switcher.git
synced 2025-09-21 05:04:55 +02:00
🐛 fix(_minor): typos and minir improvements
This commit is contained in:
@@ -2,17 +2,14 @@
|
|||||||
import os
|
import os
|
||||||
import gi
|
import gi
|
||||||
import libs.functions as fn
|
import libs.functions as fn
|
||||||
|
|
||||||
gi.require_version("Gtk", "4.0")
|
gi.require_version("Gtk", "4.0")
|
||||||
from gi.repository import Gtk, Gio, Gdk
|
from gi.repository import Gtk, Gio, Gdk
|
||||||
|
|
||||||
base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||||
|
|
||||||
|
|
||||||
class AboutDialog(Gtk.AboutDialog):
|
class AboutDialog(Gtk.AboutDialog):
|
||||||
def __init__(self, manager_gui, **kwargs):
|
def __init__(self, manager_gui, **kwargs):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
website = "http://snigdhaos.org/"
|
website = "http://snigdhaos.org/"
|
||||||
authors = ["Eshan Roy", "Abhiraj Roy"]
|
authors = ["Eshan Roy", "Abhiraj Roy"]
|
||||||
program_name = "SnigdhaOS Kernel Switcher"
|
program_name = "SnigdhaOS Kernel Switcher"
|
||||||
@@ -22,7 +19,6 @@ class AboutDialog(Gtk.AboutDialog):
|
|||||||
f"Community based Linux kernels are also supported\n"
|
f"Community based Linux kernels are also supported\n"
|
||||||
f"Developed in Python with GTK 4\n"
|
f"Developed in Python with GTK 4\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
icon_name = "sks-tux"
|
icon_name = "sks-tux"
|
||||||
|
|
||||||
self.set_transient_for(manager_gui)
|
self.set_transient_for(manager_gui)
|
||||||
@@ -31,37 +27,18 @@ class AboutDialog(Gtk.AboutDialog):
|
|||||||
self.set_program_name(program_name)
|
self.set_program_name(program_name)
|
||||||
self.set_comments(comments)
|
self.set_comments(comments)
|
||||||
self.set_website(website)
|
self.set_website(website)
|
||||||
|
|
||||||
self.set_logo_icon_name(icon_name)
|
self.set_logo_icon_name(icon_name)
|
||||||
self.set_version("Version %s" % manager_gui.app_version)
|
self.set_version("Version %s" % manager_gui.app_version)
|
||||||
|
|
||||||
self.connect("activate-link", self.on_activate_link)
|
self.connect("activate-link", self.on_activate_link)
|
||||||
|
tux_icon = Gdk.Texture.new_from_file(file=Gio.File.new_for_path(os.path.join(base_dir, "images/96x96/sks-tux.png")))
|
||||||
tux_icon = Gdk.Texture.new_from_file(
|
|
||||||
file=Gio.File.new_for_path(
|
|
||||||
os.path.join(base_dir, "images/96x96/akm-tux.png")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
self.set_logo(tux_icon)
|
self.set_logo(tux_icon)
|
||||||
|
|
||||||
def on_activate_link(self, about_dialog, uri):
|
def on_activate_link(self, about_dialog, uri):
|
||||||
try:
|
try:
|
||||||
cmd = ["sudo", "-u", fn.sudo_username, "xdg-open", uri]
|
cmd = ["sudo", "-u", fn.sudo_username, "xdg-open", uri]
|
||||||
|
proc = fn.subprocess.Popen(cmd, shell=False,stdout=fn.subprocess.PIPE,stderr=fn.subprocess.STDOUT,universal_newlines=True)
|
||||||
proc = fn.subprocess.Popen(
|
|
||||||
cmd,
|
|
||||||
shell=False,
|
|
||||||
stdout=fn.subprocess.PIPE,
|
|
||||||
stderr=fn.subprocess.STDOUT,
|
|
||||||
universal_newlines=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
out, err = proc.communicate(timeout=50)
|
out, err = proc.communicate(timeout=50)
|
||||||
|
|
||||||
fn.logger.warning(out)
|
fn.logger.warning(out)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
fn.logger.error("Exception in activate_link(): %s" % e)
|
fn.logger.error("Found error in activate_link(): %s" % e)
|
||||||
|
return True
|
||||||
return True
|
|
Reference in New Issue
Block a user