feat: rework about
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
0xMRTT 2023-05-25 20:54:59 +02:00
parent fa9c41e131
commit 1b048b229d
No known key found for this signature in database
GPG key ID: 910B287304120902
3 changed files with 80 additions and 49 deletions

View file

@ -32,6 +32,7 @@ gi.require_version('WebKit', '6.0')
from gi.repository import Gtk, Gio, Adw, Gdk, GLib, Gst, WebKit
from .views.main_window import BavarderWindow
from .views.preferences_window import Preferences
from .views.about_window import BavarderAboutWindow
from enum import auto, IntEnum
from .constants import app_id, version, build_type
@ -319,55 +320,8 @@ class BavarderApplication(Adw.Application):
def on_about_action(self, widget, _):
"""Callback for the app.about action."""
about = Adw.AboutWindow(
transient_for=self.props.active_window,
application_name="Bavarder",
application_icon=app_id,
developer_name="0xMRTT",
developers=["0xMRTT https://github.com/0xMRTT"],
designers=["David Lapshin https://github.com/daudix-UFO"],
artists=["David Lapshin https://github.com/daudix-UFO"],
documenters=[],
translator_credits="""0xMRTT <0xmrtt@proton.me>
David Lapshin <ddaudix@gmail.com>
Morgan Antonsson <morgan.antonsson@gmail.com>
thepoladov13 <thepoladov@protonmail.com>
Muznyo <codeberg.vqtek@simplelogin.com>
Deimidis <gmovia@pm.me>
sjdonado <jsrd98@gmail.com>
artnay <jiri.gronroos@iki.fi>
Rene Coty <irenee.thirion@e.email>
galegovski <galegovski@outlook.com>""",
license_type=Gtk.License.GPL_3_0,
version=version,
website="https://bavarder.codeberg.page",
issue_url="https://github.com/Bavarder/Bavarder/issues",
support_url="https://codeberg.org/Bavarder/Bavarder/issues",
copyright="© 2023 0xMRTT",
)
about.add_acknowledgement_section(
"Special thanks to",
[
"Telegraph https://apps.gnome.org/app/io.github.fkinoshita.Telegraph",
"Apostrophe https://apps.gnome.org/app/org.gnome.gitlab.somas.Apostrophe",
],
)
about.set_debug_info(
f"""{app_id} {version}
Environment: {os.environ.get("XDG_CURRENT_DESKTOP", "Unknown")}
Gtk: {Gtk.MAJOR_VERSION}.{Gtk.MINOR_VERSION}.{Gtk.MICRO_VERSION}
Python: {platform.python_version()}
OS: {platform.system()} {platform.release()} {platform.version()}
Providers: {self.enabled_providers}
Use Theme: {self.use_theme}
Use Text View: {self.use_text_view}
Clear After Send: {self.clear_after_send}
Close All Without Dialog: {self.close_all_without_dialog}
Current Provider: {self.provider}
"""
)
about.present()
about = BavarderAboutWindow(self.win)
about.show_about()
def on_preferences_action(self, widget, *args, **kwargs):
"""Callback for the app.preferences action."""

76
src/views/about_window.py Normal file
View file

@ -0,0 +1,76 @@
from gi.repository import Gtk, Adw
from bavarder import constants
import os
import platform
# TRANSLATORS: This is a place to put your credits (formats:
# "Name https://example.com" or "Name <email@example.com>",
# no quotes) and is not meant to be translated literally.
translator_credits = _("translator-credits")
class BavarderAboutWindow:
def __init__(self, parent):
self.parent = parent
self.app = self.parent.get_application()
self.setup()
def setup(self):
self.about_window = Adw.AboutWindow(
application_name="Bavarder",
transient_for=self.app.get_active_window(),
application_icon=constants.app_id,
developer_name=_("0xMRTT"),
website=constants.project_url,
support_url=constants.help_url,
issue_url=constants.bugtracker_url,
developers=[
"0xMRTT https://github.com/0xMRTT",
],
documenters=[
"0xMRTT https://github.com/0xMRTT",
],
designers=[
"David Lapshin https://github.com/daudix-UFO"
],
artists=[
"David Lapshin https://github.com/daudix-UFO"
],
translator_credits=_(translator_credits),
copyright=_("Copyright © 2023 0xMRTT"),
license_type=Gtk.License.GPL_3_0,
version=constants.version,
release_notes_version=constants.rel_ver,
)
self.about_window.add_acknowledgement_section(
"Special thanks to",
[
"Telegraph https://apps.gnome.org/app/io.github.fkinoshita.Telegraph",
"Apostrophe https://apps.gnome.org/app/org.gnome.gitlab.somas.Apostrophe",
],
)
self.about_window.set_debug_info(
f"""{constants.app_id} {constants.version}
Environment: {os.environ.get("XDG_CURRENT_DESKTOP", "Unknown")}
Gtk: {Gtk.MAJOR_VERSION}.{Gtk.MINOR_VERSION}.{Gtk.MICRO_VERSION}
Python: {platform.python_version()}
OS: {platform.system()} {platform.release()} {platform.version()}
Providers: {self.app.enabled_providers}
Use Theme: {self.app.use_theme}
Use Text View: {self.app.use_text_view}
Clear After Send: {self.app.clear_after_send}
Close All Without Dialog: {self.app.close_all_without_dialog}
Current Provider: {self.app.provider}
"""
)
self.about_window.present()
def show_about(self):
self.about_window.present()

View file

@ -3,6 +3,7 @@ views_dir = join_paths(moduledir, 'views')
views_sources = [
'__init__.py',
'about_window.py',
'main_window.py',
'preferences_window.py',
]