1
0
Fork 0
mirror of synced 2024-05-18 19:42:54 +12:00

Merge pull request #386 from loathingKernel/next

Steam: Fix crash if Steam is not installed
This commit is contained in:
Stelios Tsampas 2024-02-22 21:23:32 +02:00 committed by GitHub
commit 7dff47c5ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 29 additions and 9 deletions

View file

@ -85,10 +85,10 @@ class GameLaunchSettings(LaunchSettingsBase):
if self.igame: if self.igame:
self.offline_combo.setEnabled(self.igame.can_run_offline) self.offline_combo.setEnabled(self.igame.can_run_offline)
self.override_exe_edit.set_root(self.igame.install_path) self.override_exe_edit.setRootPath(self.igame.install_path)
else: else:
self.offline_combo.setEnabled(False) self.offline_combo.setEnabled(False)
self.override_exe_edit.set_root("") self.override_exe_edit.setRootPath(os.path.expanduser("~/"))
launch_params = config.get_option(self.app_name, "start_params", "") launch_params = config.get_option(self.app_name, "start_params", "")
self.launch_params_edit.setText(launch_params) self.launch_params_edit.setText(launch_params)

View file

@ -271,6 +271,12 @@ QTableView {
alternate-background-color: #BCBEBF; alternate-background-color: #BCBEBF;
} }
QListView QLineEdit,
QTreeView QLineEdit,
QTableView QLineEdit {
padding: 0px;
}
QListView::item, QListView::item,
QTreeView::item { QTreeView::item {
margin-right: 1px; margin-right: 1px;

View file

@ -105,7 +105,8 @@ QSpinBox,
QDoubleSpinBox, QDoubleSpinBox,
QProgressBar, QProgressBar,
QPushButton { QPushButton {
min-height: 1.30em; /* min-height: 1.30em; */
min-height: 18px;
} }
QLineEdit, QLineEdit,
QTextEdit QTextEdit
@ -115,10 +116,12 @@ QDateTimeEdit,
QSpinBox, QSpinBox,
QDoubleSpinBox, QDoubleSpinBox,
QProgressBar { QProgressBar {
max-height: 1.30em; /* max-height: 1.30em; */
max-height: 18px;
} }
QToolButton { QToolButton {
min-height: 1.10em; /* min-height: 1.10em; */
min-height: 15px;
} }
QFrame[frameShape="0"] { QFrame[frameShape="0"] {
@ -271,6 +274,12 @@ QTableView {
alternate-background-color: rgb( 40, 42, 46); alternate-background-color: rgb( 40, 42, 46);
} }
QListView QLineEdit,
QTreeView QLineEdit,
QTableView QLineEdit {
padding: 0px;
}
QListView::item, QListView::item,
QTreeView::item { QTreeView::item {
margin-right: 1px; margin-right: 1px;

View file

@ -16,11 +16,12 @@ logger = getLogger("Proton")
steam_compat_client_install_paths = [os.path.expanduser("~/.local/share/Steam")] steam_compat_client_install_paths = [os.path.expanduser("~/.local/share/Steam")]
def find_steam() -> str: def find_steam() -> Optional[str]:
# return the first valid path # return the first valid path
for path in steam_compat_client_install_paths: for path in steam_compat_client_install_paths:
if os.path.isdir(path) and os.path.isfile(os.path.join(path, "steam.sh")): if os.path.isdir(path) and os.path.isfile(os.path.join(path, "steam.sh")):
return path return path
return None
def find_libraries(steam_path: str) -> Set[str]: def find_libraries(steam_path: str) -> Set[str]:
@ -306,7 +307,11 @@ def get_steam_environment(
def find_tools() -> List[Union[ProtonTool, CompatibilityTool]]: def find_tools() -> List[Union[ProtonTool, CompatibilityTool]]:
steam_path = find_steam() steam_path = find_steam()
logger.debug("Using Steam install in %s", steam_path) if steam_path is None:
logger.info("Steam could not be found")
return []
logger.info("Found Steam in %s", steam_path)
steam_libraries = find_libraries(steam_path) steam_libraries = find_libraries(steam_path)
logger.debug("Searching for tools in libraries:") logger.debug("Searching for tools in libraries:")
logger.debug("%s", steam_libraries) logger.debug("%s", steam_libraries)

View file

@ -317,13 +317,13 @@ class PathEdit(IndicatorLineEdit):
self.path_select.clicked.connect(self.__set_path) self.path_select.clicked.connect(self.__set_path)
def set_root(self, path: str): def setRootPath(self, path: str):
self.__root_path = path self.__root_path = path
self.__completer_model.setRootPath(path) self.__completer_model.setRootPath(path)
def __set_path(self): def __set_path(self):
dlg_path = self.line_edit.text() dlg_path = self.line_edit.text()
if not dlg_path: if not dlg_path or not os.path.isabs(dlg_path):
dlg_path = self.__root_path dlg_path = self.__root_path
dlg = QFileDialog(self, self.tr("Choose path"), dlg_path) dlg = QFileDialog(self, self.tr("Choose path"), dlg_path)
dlg.setOption(QFileDialog.DontUseCustomDirectoryIcons) dlg.setOption(QFileDialog.DontUseCustomDirectoryIcons)