-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6e844e
commit f74623f
Showing
12 changed files
with
120 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import os | ||
import pkg_resources | ||
from PySide6.QtWidgets import (QDialog, QVBoxLayout, QDialogButtonBox, QLabel, QHBoxLayout) | ||
from PySide6.QtGui import QPixmap | ||
from PySide6.QtCore import Qt | ||
from GUI.GuiHelpers import GetResourcePath | ||
|
||
from PySubtitleGPT.version import __version__ | ||
|
||
class AboutDialog(QDialog): | ||
""" | ||
Show application information etc. | ||
""" | ||
def __init__(self, parent=None): | ||
super(AboutDialog, self).__init__(parent) | ||
self.setWindowTitle("About GUI-Subtrans") | ||
self.setMinimumWidth(512) | ||
self.setMaximumWidth(768) | ||
|
||
# Main Horizontal Layout | ||
main_layout = QHBoxLayout(self) | ||
|
||
# Image on the left | ||
image_layout = QVBoxLayout() | ||
image_label = QLabel(self) | ||
filepath = GetResourcePath(os.path.join("theme", "subtransmd.png")) | ||
pixmap = QPixmap(filepath) | ||
image_label.setPixmap(pixmap) | ||
|
||
# Label for image attribution | ||
image_attribution_label = QLabel('Logo generated with <a href="https://stability.ai/stablediffusion">Stable Diffusion XL</a>') | ||
image_attribution_label.setOpenExternalLinks(True) # This ensures the link opens in a default web browser | ||
image_attribution_label.setWordWrap(True) | ||
image_attribution_label.setAlignment(Qt.AlignmentFlag.AlignCenter) | ||
|
||
image_layout.addWidget(image_label) | ||
image_layout.addWidget(image_attribution_label) | ||
main_layout.addLayout(image_layout) | ||
|
||
# Right side vertical layout | ||
layout = QVBoxLayout() | ||
|
||
# Title | ||
title_label = QLabel(f"GUI-Subtrans Version {__version__}") | ||
font = title_label.font() | ||
font.setPointSize(24) | ||
title_label.setFont(font) | ||
|
||
# Description | ||
description_label = QLabel("GUI-Subtrans uses OpenAI's GPT AI to translate SRT subtitles into other languages, or to improve the quality of an existing translation.") | ||
description_label.setWordWrap(True) | ||
|
||
# Author Information and GitHub link | ||
author_label = QLabel("Developed by: MachineWrapped<br>" | ||
"Contact: [email protected]<br>" | ||
'<a href="https://github.com/machinewrapped/gpt-subtrans">GitHub Repository</a>') | ||
author_label.setOpenExternalLinks(True) | ||
author_label.setTextInteractionFlags(Qt.TextInteractionFlag.TextBrowserInteraction) | ||
|
||
# License information | ||
license_text = QLabel("GUI-Subtrans is released under the MIT License.\n\n" | ||
"Permission is hereby granted, free of charge, to any person obtaining a copy " | ||
"of this software and associated documentation files, to deal in the software " | ||
"without restriction, including without limitation the rights to use, copy, " | ||
"modify, merge, publish, distribute, sublicense, and/or sell copies of the software.") | ||
license_text.setWordWrap(True) | ||
|
||
# Libraries and their versions | ||
libraries = ["openai", "srt", "pyside6", "regex", "events", "darkdetect", "appdirs", "python-dotenv"] | ||
library_strings = [] | ||
|
||
for lib in libraries: | ||
try: | ||
version = pkg_resources.get_distribution(lib).version | ||
library_strings.append(f"{lib} ({version})") | ||
except pkg_resources.DistributionNotFound: | ||
library_strings.append(lib) | ||
|
||
libraries_list = QLabel("GUI-Subtrans would not work without these libraries:\n" + ", ".join(library_strings)) | ||
libraries_list.setWordWrap(True) | ||
|
||
# OK Button | ||
button_box = QDialogButtonBox(QDialogButtonBox.Ok) | ||
button_box.accepted.connect(self.accept) | ||
|
||
# Add widgets to layout | ||
layout.addWidget(title_label) | ||
layout.addWidget(description_label) | ||
layout.addWidget(author_label) | ||
layout.addWidget(license_text) | ||
layout.addWidget(libraries_list) | ||
layout.addWidget(button_box) | ||
|
||
# Add right side layout to the main layout | ||
main_layout.addLayout(layout) | ||
|
||
# Set the main layout for the dialog | ||
self.setLayout(main_layout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "v0.3.3" | ||
__version__ = "v0.4.0" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
call envsubtrans/scripts/activate | ||
pip install -r requirements.txt | ||
pyinstaller --add-data "theme/*;theme/" --add-data "instructions*;." --add-data "LICENSE;." gui-subtrans.py | ||
pyinstaller --add-data "theme/*;theme/" --add-data "instructions*;." --add-data "LICENSE;." --add-data "gui-subtrans.ico;." gui-subtrans.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.