Skip to content

Commit

Permalink
Use PySide6 v6.5 from PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Apr 8, 2023
1 parent 7682adc commit 20bcb0c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
10 changes: 4 additions & 6 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# Usage: ./scripts/install.ps1
#
# If you're having issues with the libraries, you might want to first run:
# pip uninstall -y -r ./scripts/requirements-dev.txt
# pip uninstall -y -r ./scripts/requirements-dev.txt PySide6 shiboken6
#
# Creating an AutoSplit executable with PyInstaller: ./scripts/build.ps1
#
# PySide6 dev wheels: https://download.qt.io/snapshots/ci/pyside/dev/?C=M;O=D
#
# Dependencies:
certifi
ImageHash>=4.3.1 # Contains type information + setup as package not module
Expand All @@ -19,11 +21,7 @@ packaging
Pillow>=9.2 # gnome-screeshot checks
psutil
PyAutoGUI
# PySide6-Essentials>6.4.2 # Python 3.11 support,
# Dev PySide6 past March 7th fixes https://bugreports.qt.io/browse/PYSIDE-2189 and https://bugreports.qt.io/browse/PYSIDE-1603
# https://download.qt.io/snapshots/ci/pyside/dev/?C=M;O=D
https://download.qt.io/snapshots/ci/pyside/dev/0142b21d429a7cf0ef78a5bf9a0d972c2a7223b2/split_wheels/PySide6_Essentials-6.5.0a1.dev1678202304-cp37-abi3-win_amd64.whl
https://download.qt.io/snapshots/ci/pyside/dev/0142b21d429a7cf0ef78a5bf9a0d972c2a7223b2/split_wheels/shiboken6-6.5.0a1.dev1678202304-cp37-abi3-win_amd64.whl
PySide6-Essentials>=6.5 # fixes https://bugreports.qt.io/browse/PYSIDE-2189 and https://bugreports.qt.io/browse/PYSIDE-1603
requests<=2.28.1 # 2.28.2 has issues with PyInstaller https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/534
toml
#
Expand Down
2 changes: 1 addition & 1 deletion src/AutoSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from psutil import process_iter
from PySide6 import QtCore, QtGui
from PySide6.QtTest import QTest
from PySide6.QtWidgets import QApplication, QFileDialog, QLabel, QMainWindow, QMessageBox, QWidget
from PySide6.QtWidgets import QApplication, QFileDialog, QLabel, QMainWindow, QMessageBox

import error_messages
import user_profile
Expand Down
17 changes: 10 additions & 7 deletions src/region_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import ctypes.wintypes
import os
from math import ceil
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, cast

import cv2
import numpy as np
Expand Down Expand Up @@ -165,12 +165,15 @@ def align_region(autosplit: AutoSplit):
error_messages.region()
return
# This is the image used for aligning the capture region to the best fit for the user.
template_filename = QtWidgets.QFileDialog.getOpenFileName(
autosplit,
"Select Reference Image",
"",
IMREAD_EXT_FILTER,
)[0]
template_filename = cast(
str, # https://bugreports.qt.io/browse/PYSIDE-2285
QtWidgets.QFileDialog.getOpenFileName(
autosplit,
"Select Reference Image",
"",
IMREAD_EXT_FILTER,
)[0],
)

# Return if the user presses cancel
if not template_filename:
Expand Down
32 changes: 19 additions & 13 deletions src/user_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ def save_settings_as(autosplit: AutoSplit):
@return: The save settings filepath selected. Empty if cancelled
"""
# User picks save destination
save_settings_file_path = QtWidgets.QFileDialog.getSaveFileName(
autosplit,
"Save Settings As",
autosplit.last_successfully_loaded_settings_file_path
or os.path.join(auto_split_directory, "settings.toml"),
"TOML (*.toml)",
)[0]
save_settings_file_path = cast(
str, # https://bugreports.qt.io/browse/PYSIDE-2285
QtWidgets.QFileDialog.getSaveFileName(
autosplit,
"Save Settings As",
autosplit.last_successfully_loaded_settings_file_path
or os.path.join(auto_split_directory, "settings.toml"),
"TOML (*.toml)",
)[0],
)

# If user cancels save destination window, don't save settings
if not save_settings_file_path:
Expand Down Expand Up @@ -156,12 +159,15 @@ def __load_settings_from_file(autosplit: AutoSplit, load_settings_file_path: str


def load_settings(autosplit: AutoSplit, from_path: str = ""):
load_settings_file_path = from_path or QtWidgets.QFileDialog.getOpenFileName(
autosplit,
"Load Profile",
os.path.join(auto_split_directory, "settings.toml"),
"TOML (*.toml)",
)[0]
load_settings_file_path = from_path or cast(
str, # https://bugreports.qt.io/browse/PYSIDE-2285
QtWidgets.QFileDialog.getOpenFileName(
autosplit,
"Load Profile",
os.path.join(auto_split_directory, "settings.toml"),
"TOML (*.toml)",
)[0],
)
if not (load_settings_file_path and __load_settings_from_file(autosplit, load_settings_file_path)):
return

Expand Down

0 comments on commit 20bcb0c

Please sign in to comment.