1
0
Fork 0
mirror of synced 2024-05-15 10:02:57 +12:00

Dxvk settings, reformat

This commit is contained in:
Dummerle 2021-02-26 19:28:54 +01:00
parent 5059c10681
commit 4250891b87
25 changed files with 1179 additions and 1092 deletions

View file

@ -5,26 +5,26 @@ name: Upload Python Package
on:
release:
types: [created]
types: [ created ]
jobs:
deploy:
runs-on: ['ubuntu-latest' ,'windows-latest']
runs-on: [ 'ubuntu-latest' ,'windows-latest' ]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/RareNew.iml" filepath="$PROJECT_DIR$/.idea/RareNew.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/Rare.iml" filepath="$PROJECT_DIR$/.idea/Rare.iml" />
</modules>
</component>
</project>

View file

@ -11,7 +11,8 @@
### Add Stylesheets
For this you can create a .qss file in Rare/Styles/ directory or modify the existing RareStyle.qss file. Here are some exmples:
For this you can create a .qss file in Rare/Styles/ directory or modify the existing RareStyle.qss file. Here are some
exmples:
[Qt Docs](https://doc.qt.io/qt-5/stylesheet-examples.html)
### Add features

View file

@ -1,5 +1,7 @@
# Rare
GUI for legendary. An Epic Games Launcher open source alternative
## This is a new version with better Styles. It has not many features, but i work on it.
## This is a new version with better Styles. It has not many features, but i work on it.
It will take some time, because I want to reimplement some features on a smoother way.

View file

@ -52,7 +52,8 @@ class InstallInfoDialog(QDialog):
def __init__(self, dl_size, install_size):
super(InstallInfoDialog, self).__init__()
self.layout = QVBoxLayout()
self.infos = QLabel(f"Download size: {(dl_size/1024**3):.02f}GB\nInstall size: {(install_size/1024**3):.02f}GB")
self.infos = QLabel(
f"Download size: {(dl_size / 1024 ** 3):.02f}GB\nInstall size: {(install_size / 1024 ** 3):.02f}GB")
self.layout.addWidget(self.infos)
self.btn_layout = QHBoxLayout()

View file

@ -28,7 +28,7 @@ class ImportWidget(QWidget):
else:
self.btn_group = QButtonGroup()
for i,p in enumerate(appdata_paths):
for i, p in enumerate(appdata_paths):
radio_button = QRadioButton(p)
if i == 0:
radio_button.setChecked(True)

View file

@ -1,7 +1,6 @@
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QLabel, QStackedLayout, QWidget, QPushButton
from legendary.core import LegendaryCore
# Login Opportunities: Browser, Import
from Rare.Components.Dialogs.Login.BrowserLogin import BrowserLogin
from Rare.Components.Dialogs.Login.ImportWidget import ImportWidget
@ -83,9 +82,10 @@ class OptionWidget(QWidget):
self.setLayout(self.layout)
class LoginSuccessfulWidget(QWidget):
def __init__(self):
super(LoginSuccessfulWidget, self).__init__()
self.layout = QVBoxLayout()
self.layout.addWidget(QLabel("Login Successful"))
self.setLayout(self.layout)
self.setLayout(self.layout)

View file

@ -3,11 +3,11 @@ import subprocess
import time
from logging import getLogger
from legendary.models.game import Game
from notifypy import Notify
from PyQt5.QtCore import QThread, pyqtSignal
from PyQt5.QtWidgets import QWidget, QMessageBox, QVBoxLayout, QLabel, QGridLayout, QProgressBar
from legendary.core import LegendaryCore
from legendary.models.game import Game
from notifypy import Notify
from Rare.Components.Dialogs.InstallDialog import InstallInfoDialog
@ -93,14 +93,15 @@ class DownloadTab(QWidget):
self.info_layout.addWidget(self.installing_game, 0, 0)
self.info_layout.addWidget(self.dl_speed, 0, 1)
self.info_layout.addWidget(self.cache_used, 1,0)
self.info_layout.addWidget(self.downloaded, 1,1)
self.info_layout.addWidget(self.cache_used, 1, 0)
self.info_layout.addWidget(self.downloaded, 1, 1)
self.layout.addLayout(self.info_layout)
self.prog_bar = QProgressBar()
self.layout.addWidget(self.prog_bar)
self.layout.addWidget(QLabel("WARNING: This feature is not implemented. It is normal, if there is no progress. The progress is in console"))
self.layout.addWidget(QLabel(
"WARNING: This feature is not implemented. It is normal, if there is no progress. The progress is in console"))
self.installing_game_widget = QLabel("No active Download")
self.layout.addWidget(self.installing_game_widget)
@ -124,7 +125,7 @@ class DownloadTab(QWidget):
return
self.installing_game_widget.setText("")
self.installing_game.setText("Installing Game: "+ game.app_title)
self.installing_game.setText("Installing Game: " + game.app_title)
res = self.core.check_installation_conditions(analysis=analysis, install=igame, game=game,
updating=self.core.is_installed(options["app_name"]),
)
@ -150,7 +151,7 @@ class DownloadTab(QWidget):
notification.title = "Installation finished"
notification.message = f"Download of game {self.active_game.app_title}"
notification.send()
#QMessageBox.information(self, "Info", "Download finished")
# QMessageBox.information(self, "Info", "Download finished")
self.finished.emit()
self.installing_game.setText("Installing Game: No running download")
elif text == "error":

View file

@ -20,12 +20,10 @@ class GameInfo(QWidget):
self.game_title = QLabel("Error")
self.layout.addWidget(self.game_title)
self.setLayout(self.layout)
def update_game(self, app_name):
self.game = self.core.get_game(app_name)
self.igame = self.core.get_installed_game(app_name)
self.game_title.setText(self.game.app_title)
self.game_title.setText(self.game.app_title)

View file

@ -64,7 +64,6 @@ class GameWidgetUninstalled(QWidget):
def install(self):
logger.info("Install " + self.game.app_title)
infos = InstallDialog().get_information()
if infos != 0:
path, max_workers = infos

View file

@ -0,0 +1,96 @@
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QWidget, QCheckBox, QVBoxLayout, QWidgetAction, QMenu, QToolButton, QHBoxLayout, QLabel
from legendary.core import LegendaryCore
class DxvkWidget(QWidget):
dxvk_settings = {"fps": (False, "Fps"),
"gpuload": (False, "GPU usage"),
"memory": (False, "Used Memory"),
"devinfo": (False, "Device info"),
"version": (False, "DXVK version"),
"api": (False, "D3D Level of application")
}
def __init__(self, core: LegendaryCore):
super(DxvkWidget, self).__init__()
self.core = core
self.layout = QVBoxLayout()
self.child_layout = QHBoxLayout()
self.title = QLabel("dxvk settings")
self.show_dxvk = QCheckBox("Show Dxvk HUD")
self.more_settings = QToolButton()
dxvk_hud = self.core.lgd.config.get("default.env", "DXVK_HUD", fallback="")
self.more_settings.setDisabled(not dxvk_hud == "")
if dxvk_hud:
for s in dxvk_hud.split(","):
y = list(self.dxvk_settings[s])
y[0] = True
self.dxvk_settings[s] = tuple(y)
self.more_settings.setPopupMode(QToolButton.InstantPopup)
self.more_settings.setMenu(QMenu())
self.more_settings.setText("More DXVK settings")
action = QWidgetAction(self)
self.more_settings_widget = DxvkMoreSettingsWidget(self.dxvk_settings, self.core)
action.setDefaultWidget(self.more_settings_widget)
self.more_settings.menu().addAction(action)
self.show_dxvk.stateChanged.connect(lambda x: self.more_settings.setDisabled(x == 0))
self.show_dxvk.setChecked(not dxvk_hud == "")
self.layout.addWidget(self.title)
self.child_layout.addWidget(self.show_dxvk)
self.child_layout.addWidget(self.more_settings)
self.layout.addLayout(self.child_layout)
self.setLayout(self.layout)
def update_dettings(self):
pass
class DxvkMoreSettingsWidget(QWidget):
def __init__(self, settings: dict, core: LegendaryCore):
super(DxvkMoreSettingsWidget, self).__init__()
self.layout = QVBoxLayout()
self.widgets = []
self.core = core
self.settings = settings
for i in settings:
widget = CheckBox(i, settings[i])
widget.signal.connect(self.change)
self.layout.addWidget(widget)
self.widgets.append(widget)
self.setLayout(self.layout)
def change(self, signal: tuple):
tag, checked = signal
y = list(self.settings[tag])
y[0] = checked
self.settings[tag] = tuple(y)
# print(self.settings)
sett = []
for i in self.settings:
check, _ = self.settings[i]
if check:
sett.append(i)
if sett:
self.core.lgd.config["default.env"]["DXVK_HUD"] = ",".join(sett)
self.core.lgd.save_config()
class CheckBox(QCheckBox):
signal = pyqtSignal(tuple)
def __init__(self, tag, settings):
checked, text = settings
super(CheckBox, self).__init__(text)
self.setChecked(checked)
self.tag = tag
self.clicked.connect(lambda: self.signal.emit((self.tag, self.isChecked())))
def update_settings(self):
pass

View file

@ -24,7 +24,8 @@ class LegendarySettings(QWidget):
self.select_path.text_edit.textChanged.connect(lambda t: self.save_path_button.setDisabled(False))
self.save_path_button = QPushButton("Save")
self.save_path_button.clicked.connect(self.save_path)
self.install_dir_widget = SettingsWidget("Default installation directory", self.select_path, self.save_path_button)
self.install_dir_widget = SettingsWidget("Default installation directory", self.select_path,
self.save_path_button)
self.layout.addWidget(self.install_dir_widget)
# Max Workers

View file

@ -1,8 +1,9 @@
from logging import getLogger
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton, QFileDialog, QCheckBox, QHBoxLayout, QToolButton
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton, QFileDialog
from legendary.core import LegendaryCore
from Rare.Components.Tabs.Settings.DXVK.Dxvk import DxvkWidget
from Rare.Components.Tabs.Settings.SettingsWidget import SettingsWidget
from Rare.utils.QtExtensions import PathEdit
@ -69,33 +70,3 @@ class LinuxSettings(QWidget):
if self.core.lgd.config["default"] == {}:
self.core.lgd.config.remove_section("default")
self.core.lgd.save_config()
class DxvkWidget(QWidget):
def __init__(self, core: LegendaryCore):
super(DxvkWidget, self).__init__()
self.core = core
self.layout = QVBoxLayout()
self.child_layout = QHBoxLayout()
self.title = QLabel("dxvk settings")
self.show_dxvk = QCheckBox("Show Dxvk HUD")
self.more_settings = QPushButton()
self.more_settings.clicked.connect(self.show_more_settings)
active = not self.core.lgd.config.get("default.env", "DXVK_HUD", fallback="") == ""
self.more_settings.setDisabled(active)
self.show_dxvk.stateChanged.connect(lambda x: self.more_settings.setDisabled(x == 0))
self.show_dxvk.setChecked(active)
self.layout.addWidget(self.title)
self.child_layout.addWidget(self.show_dxvk)
self.child_layout.addWidget(self.more_settings)
self.layout.addLayout(self.child_layout)
self.setLayout(self.layout)
def update_dettings(self):
pass
def show_more_settings(self):
pass

View file

@ -1,7 +1,7 @@
import os
from PyQt5.QtCore import QRect, QPoint, QSize
from PyQt5.QtWidgets import QWidget, QTabWidget, QStylePainter, QStyleOptionTab, QTabBar, QStyle, QLabel
from PyQt5.QtWidgets import QTabWidget, QStylePainter, QStyleOptionTab, QTabBar, QStyle
from Rare.Components.Tabs.Settings.About import About
from Rare.Components.Tabs.Settings.Legendary import LegendarySettings
@ -22,13 +22,11 @@ class SettingsTab(QTabWidget):
self.addTab(About(), "About")
class TabBar(QTabBar):
def __init__(self):
super(TabBar, self).__init__()
self.setObjectName("settings_bar")
def tabSizeHint(self, index):
# width = QTabBar.tabSizeHint(self, index).width()
return QSize(200, 30)

View file

@ -2,7 +2,7 @@ from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton
class SettingsWidget(QWidget):
def __init__(self, text: str, widget: QWidget, accept_button: QPushButton=None):
def __init__(self, text: str, widget: QWidget, accept_button: QPushButton = None):
super(SettingsWidget, self).__init__()
self.setObjectName("settings_widget")
self.layout = QVBoxLayout()

View file

@ -2,7 +2,7 @@ import logging
import os
import sys
from PyQt5.QtCore import QTranslator, QSettings, QCoreApplication
from PyQt5.QtCore import QTranslator, QSettings
from PyQt5.QtWidgets import QApplication
from legendary.core import LegendaryCore
@ -21,7 +21,6 @@ core = LegendaryCore()
def main():
app = QApplication(sys.argv)
#app2 = QCoreApplication()
app.setApplicationName("Rare")
app.setOrganizationName("Rare")
settings = QSettings()

View file

@ -2,16 +2,17 @@ QWidget {
background-color: #202225;
color: white;
}
QLabel{
QLabel {
background-color: transparent;
}
QTabBar::tab#main_tab_bar{
QTabBar::tab#main_tab_bar {
border: none;
padding: 5px;
}
QTabBar::tab:hover#main_tab_bar{
QTabBar::tab:hover#main_tab_bar {
background-color: black;
}
@ -52,20 +53,24 @@ QCheckBox::indicator {
border: 1px solid white;
border-radius: 2px;
}
QCheckBox::indicator:checked {
background-color: white;
}
#head_bar{
#head_bar {
border-bottom: 2px solid white;
}
#list_widget{
#list_widget {
border-top: 2px solid white;
}
QPushButton:hover#installed_menu_button{
QPushButton:hover#installed_menu_button {
background-color: green;
}
QTabBar::tab#settings_bar{
QTabBar::tab#settings_bar {
border-radius: 0;

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
import os
__version__ = "0.4.0"
style_path = os.path.join(os.path.dirname(__file__), "Styles/")
lang_path = os.path.join(os.path.dirname(__file__), "languages/")

View file

@ -1,46 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
< ? xml version = "1.0"
encoding = "utf-8" ?
>
<!DOCTYPE
TS >
<TS version = "2.1"
language = "de_DE" >
<context>
<name>LaunchDialog</name>
<message>
<location filename="../Components/Launch/LaunchDialog.py" line="52"/>
<source>Launching Rare</source>
<translation>Starte Rare</translation>
</message>
<message>
<location filename="../Components/Launch/LaunchDialog.py" line="54"/>
<source>Logging in</source>
<translation>Einloggen</translation>
</message>
</context>
<context>
<name>LoginDialog</name>
<message>
<location filename="../utils/Dialogs/Login/LoginDialog.py" line="32"/>
<source>Select one option to Login</source>
<translation>Wähle eine Option zum einloggen aus</translation>
</message>
</context>
<context>
<name>PathEdit</name>
<message>
<location filename="../utils/QtExtensions.py" line="128"/>
<source>Select Path</source>
<translation>Wähle Pfad</translation>
</message>
<message>
<location filename="../utils/QtExtensions.py" line="141"/>
<source>Choose Path</source>
<translation>Wähle Pfad</translation>
</message>
</context>
<context>
<name>TabWidget</name>
<message>
<location filename="../Components/TabWidget.py" line="16"/>
<source>Games</source>
<translation>Spiele</translation>
</message>
</context>
</TS>
<name>LaunchDialog < /name>
< message >
<location filename = "../Components/Launch/LaunchDialog.py"
line = "52" / >
<source>Launching
Rare < /source>
< translation > Starte
Rare < /translation>
< /message>
< message >
<location filename = "../Components/Launch/LaunchDialog.py"
line = "54" / >
<source>Logging in </source>
< translation > Einloggen < /translation>
< /message>
< /context>
< context >
<name>LoginDialog < /name>
< message >
<location filename = "../utils/Dialogs/Login/LoginDialog.py"
line = "32" / >
<source>Select
one
option
to
Login < /source>
< translation > Wähle
eine
Option
zum
einloggen
aus < /translation>
< /message>
< /context>
< context >
<name>PathEdit < /name>
< message >
<location filename = "../utils/QtExtensions.py"
line = "128" / >
<source>Select
Path < /source>
< translation > Wähle
Pfad < /translation>
< /message>
< message >
<location filename = "../utils/QtExtensions.py"
line = "141" / >
<source>Choose
Path < /source>
< translation > Wähle
Pfad < /translation>
< /message>
< /context>
< context >
<name>TabWidget < /name>
< message >
<location filename = "../Components/TabWidget.py"
line = "16" / >
<source>Games < /source>
< translation > Spiele < /translation>
< /message>
< /context>
< /TS>

View file

@ -1,9 +1,6 @@
import os
from PyQt5.QtCore import QProcess, QProcessEnvironment
from legendary.core import LegendaryCore
def launch_game(core, app_name: str, offline: bool = False, skip_version_check: bool = False):
@ -38,4 +35,4 @@ def launch_game(core, app_name: str, offline: bool = False, skip_version_check:
environment.insert(e, env[e])
process.setProcessEnvironment(environment)
process.start(params[0], params[1:])
return process
return process

View file

@ -145,4 +145,3 @@ class PathEdit(QWidget):
if dlg.exec_():
names = dlg.selectedFiles()
self.text_edit.setText(names[0])

View file

@ -1,13 +1,14 @@
import configparser
import os
from legendary.lfs.lgndry import LGDLFS
lgd = LGDLFS()
def get_config() -> {}:
return lgd.config
def set_config(new_config: {}):
lgd.config = new_config
with open(os.path.join(lgd.path, 'config.ini'), "w") as cf: