Skip to content

Commit

Permalink
Merge pull request #317 from loathingKernel/main
Browse files Browse the repository at this point in the history
Update links and the About form to the new organization
  • Loading branch information
loathingKernel authored Nov 28, 2023
2 parents 18d12e2 + 07cbcf5 commit 6017dcf
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 43 deletions.
3 changes: 1 addition & 2 deletions rare/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
__version__ = "1.10.3"

code_name = "Garlic Crab"
__codename__ = "Garlic Crab"
38 changes: 25 additions & 13 deletions rare/components/tabs/settings/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
from logging import getLogger

from PyQt5.QtCore import pyqtSignal
from PyQt5.QtGui import QShowEvent
from PyQt5.QtWidgets import QWidget

from rare import __version__, code_name
from rare import __version__, __codename__
from rare.ui.components.tabs.settings.about import Ui_About
from rare.utils.qt_requests import QtRequestManager

Expand All @@ -14,7 +15,7 @@
def versiontuple(v):
try:
return tuple(map(int, (v.split("."))))
except:
except Exception:
return tuple((9, 9, 9)) # It is a beta version and newer


Expand All @@ -25,24 +26,34 @@ def __init__(self, parent=None):
super(About, self).__init__(parent=parent)
self.setupUi(self)

self.version.setText(f"{__version__} {code_name}")
self.version.setText(f"{__version__} {__codename__}")

self.update_label.setVisible(False)
self.update_lbl.setVisible(False)
self.update_label.setEnabled(False)
self.update_lbl.setEnabled(False)
self.open_browser.setVisible(False)
self.open_browser.setEnabled(False)

self.manager = QtRequestManager("json")
self.manager.get(
"https://api.github.com/repos/Dummerle/Rare/releases/latest",
"https://api.github.com/repos/RareDevs/Rare/releases/latest",
self.update_available_finished,
)

self.open_browser.clicked.connect(
lambda: webbrowser.open("https://github.com/Dummerle/Rare/releases/latest")
lambda: webbrowser.open("https://github.com/RareDevs/Rare/releases/latest")
)

self.update_available = False

def showEvent(self, a0: QShowEvent) -> None:
if a0.spontaneous():
return super().showEvent(a0)
self.manager.get(
"https://api.github.com/repos/RareDevs/Rare/releases/latest",
self.update_available_finished,
)
super().showEvent(a0)

def update_available_finished(self, data: dict):
if latest_tag := data.get("tag_name"):
self.update_available = versiontuple(latest_tag) > versiontuple(__version__)
Expand All @@ -51,10 +62,11 @@ def update_available_finished(self, data: dict):

if self.update_available:
logger.info(f"Update available: {__version__} -> {latest_tag}")
self.update_lbl.setText(
self.tr("Update available: {} -> {}").format(__version__, latest_tag)
)
self.update_label.setVisible(True)
self.update_lbl.setVisible(True)
self.open_browser.setVisible(True)
self.update_lbl.setText("{} -> {}").format(__version__, latest_tag)
self.update_available_ready.emit()
else:
self.update_lbl.setText(self.tr("You have the latest version"))
self.update_label.setEnabled(self.update_available)
self.update_lbl.setEnabled(self.update_available)
self.open_browser.setVisible(self.update_available)
self.open_browser.setEnabled(self.update_available)
40 changes: 30 additions & 10 deletions rare/ui/components/tabs/settings/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'rare/ui/components/tabs/settings/about.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
Expand All @@ -14,7 +14,7 @@
class Ui_About(object):
def setupUi(self, About):
About.setObjectName("About")
About.resize(340, 142)
About.resize(507, 210)
self.about_layout = QtWidgets.QFormLayout(About)
self.about_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.about_layout.setObjectName("about_layout")
Expand Down Expand Up @@ -56,7 +56,9 @@ def setupUi(self, About):
self.dev_label.setObjectName("dev_label")
self.about_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.dev_label)
self.dev = QtWidgets.QLabel(About)
self.dev.setText("<a href=\'https://github.com/Dummerle\'>Dummerle</a>")
self.dev.setText("<a href=\'https://github.com/Dummerle\' style=\'color: #2980b9; text-decoration:none\'>Dummerle</a>\n"
"<br>\n"
"<a href=\'https://github.com/loathingkernel\' style=\'color: #2980b9; text-decoration:none\'>loathingkernel</a>")
self.dev.setOpenExternalLinks(True)
self.dev.setObjectName("dev")
self.about_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.dev)
Expand All @@ -66,37 +68,55 @@ def setupUi(self, About):
font.setWeight(75)
self.lgd_dev_label.setFont(font)
self.lgd_dev_label.setObjectName("lgd_dev_label")
self.about_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.lgd_dev_label)
self.about_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.lgd_dev_label)
self.lgd_dev = QtWidgets.QLabel(About)
self.lgd_dev.setText("<a href=\'https://github.com/derrod/\'>derrod</a>")
self.lgd_dev.setText("<a href=\'https://github.com/derrod/\' style=\'color: #2980b9; text-decoration:none\'>derrod</a>")
self.lgd_dev.setOpenExternalLinks(True)
self.lgd_dev.setObjectName("lgd_dev")
self.about_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.lgd_dev)
self.about_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.lgd_dev)
self.license_label = QtWidgets.QLabel(About)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.license_label.setFont(font)
self.license_label.setObjectName("license_label")
self.about_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.license_label)
self.about_layout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.license_label)
self.license = QtWidgets.QLabel(About)
self.license.setObjectName("license")
self.about_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.license)
self.about_layout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.license)
self.contrib_label = QtWidgets.QLabel(About)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.contrib_label.setFont(font)
self.contrib_label.setObjectName("contrib_label")
self.about_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.contrib_label)
self.label = QtWidgets.QLabel(About)
self.label.setText("<a href=\'https://github.com/MultisampledNight\' style=\'color: #2980b9; text-decoration:none\'>MultisampledNight</a> <i>artwork, bug hunting, testing</i>\n"
"<br>\n"
"<a href=\'https://github.com/invertedEcho\' style=\'color: #2980b9; text-decoration:none\'>invertedEcho</a> <i>moving games, environment variables</i>\n"
"<br>\n"
"<a href=\'https://github.com/ChemicalXandco\' style=\'color: #2980b9; text-decoration:none\'>ChemicalXandco</a> <i>downloads improvements, windows integration</i>\n"
"<br>\n"
"<a href=\'https://github.com/gnanini\' style=\'color: #2980b9; text-decoration:none\'>gnanini</a> <i>steam grades</i>")
self.label.setObjectName("label")
self.about_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.label)

self.retranslateUi(About)

def retranslateUi(self, About):
_translate = QtCore.QCoreApplication.translate
About.setWindowTitle(_translate("About", "About"))
self.version_label.setText(_translate("About", "Version"))
self.update_label.setText(_translate("About", "Update available"))
self.update_label.setText(_translate("About", "Update"))
self.open_browser.setText(_translate("About", "Download latest release"))
self.dev_label.setText(_translate("About", "Rare Developer"))
self.dev_label.setText(_translate("About", "Rare Developers"))
self.dev.setToolTip(_translate("About", "Github"))
self.lgd_dev_label.setText(_translate("About", "Legendary Developer"))
self.lgd_dev.setToolTip(_translate("About", "Github"))
self.license_label.setText(_translate("About", "License"))
self.license.setText(_translate("About", "GNU General Public License v3.0"))
self.contrib_label.setText(_translate("About", "Rare Contributors"))


if __name__ == "__main__":
Expand Down
48 changes: 38 additions & 10 deletions rare/ui/components/tabs/settings/about.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>340</width>
<height>142</height>
<width>507</width>
<height>210</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -46,7 +46,7 @@
</font>
</property>
<property name="text">
<string>Update available</string>
<string>Update</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -79,7 +79,7 @@
</font>
</property>
<property name="text">
<string>Rare Developer</string>
<string>Rare Developers</string>
</property>
</widget>
</item>
Expand All @@ -89,14 +89,16 @@
<string>Github</string>
</property>
<property name="text">
<string notr="true">&lt;a href='https://github.com/Dummerle'&gt;Dummerle&lt;/a&gt;</string>
<string notr="true">&lt;a href='https://github.com/Dummerle' style='color: #2980b9; text-decoration:none'&gt;Dummerle&lt;/a&gt;
&lt;br&gt;
&lt;a href='https://github.com/loathingkernel' style='color: #2980b9; text-decoration:none'&gt;loathingkernel&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="lgd_dev_label">
<property name="font">
<font>
Expand All @@ -109,20 +111,20 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QLabel" name="lgd_dev">
<property name="toolTip">
<string>Github</string>
</property>
<property name="text">
<string notr="true">&lt;a href='https://github.com/derrod/'&gt;derrod&lt;/a&gt;</string>
<string notr="true">&lt;a href='https://github.com/derrod/' style='color: #2980b9; text-decoration:none'&gt;derrod&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="license_label">
<property name="font">
<font>
Expand All @@ -135,13 +137,39 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QLabel" name="license">
<property name="text">
<string>GNU General Public License v3.0</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="contrib_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Rare Contributors</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string notr="true">&lt;a href='https://github.com/MultisampledNight' style='color: #2980b9; text-decoration:none'&gt;MultisampledNight&lt;/a&gt; &lt;i&gt;artwork, bug hunting, testing&lt;/i&gt;
&lt;br&gt;
&lt;a href='https://github.com/invertedEcho' style='color: #2980b9; text-decoration:none'&gt;invertedEcho&lt;/a&gt; &lt;i&gt;moving games, environment variables&lt;/i&gt;
&lt;br&gt;
&lt;a href='https://github.com/ChemicalXandco' style='color: #2980b9; text-decoration:none'&gt;ChemicalXandco&lt;/a&gt; &lt;i&gt;downloads improvements, windows integration&lt;/i&gt;
&lt;br&gt;
&lt;a href='https://github.com/gnanini' style='color: #2980b9; text-decoration:none'&gt;gnanini&lt;/a&gt; &lt;i&gt;steam grades&lt;/i&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
Expand Down
2 changes: 1 addition & 1 deletion rare/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def get_translations():
def get_latest_version():
try:
resp = requests.get(
"https://api.github.com/repos/Dummerle/Rare/releases/latest", timeout=2,
"https://api.github.com/repos/RareDevs/Rare/releases/latest", timeout=2,
)
tag = resp.json()["tag_name"]
return tag
Expand Down
2 changes: 1 addition & 1 deletion rare/utils/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def update_rpc(self, app_name=None):
title = None
if not app_name:
self.RPC.update(
large_image="logo", details="https://github.com/Dummerle/Rare"
large_image="logo", details="https://github.com/RareDevs/Rare"
)
return
if self.settings.value("rpc_name", True, bool):
Expand Down
2 changes: 1 addition & 1 deletion rare/widgets/rare_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, args: Namespace, log_file: str):
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("asyncio").setLevel(logging.WARNING)
self.logger.info(
f"Launching Rare version {rare.__version__} Codename: {rare.code_name}\n"
f"Launching Rare version {rare.__version__} Codename: {rare.__codename__}\n"
f" - Using Legendary {legendary.__version__} Codename: {legendary.__codename__} as backend\n"
f" - Operating System: {platform.system()}, Python version: {platform.python_version()}\n"
f" - Running {sys.executable} {' '.join(sys.argv)}\n"
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
build
wheel
black
black[d]
toml
nuitka
ordered-set
PyQt5-stubs
qstylizer
qstylizer
1 change: 0 additions & 1 deletion requirements-presence.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pypresence

1 change: 0 additions & 1 deletion requirements-webview.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ pywebview[qt]; platform_system == "FreeBSD"
pythonnet>=3.0.0rc4; platform_system == "Windows"
cefpython3; platform_system == "Windows"
pywebview[cef]; platform_system == "Windows"

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ requests
PyQt5
QtAwesome
setuptools
legendary-gl==0.20.32
legendary-gl>=0.20.32
pywin32; platform_system == "Windows"

0 comments on commit 6017dcf

Please sign in to comment.