From 387bb4ee4a82c5153a2843e0cd8aa5a11f78b95d Mon Sep 17 00:00:00 2001 From: Kai Ratzeburg Date: Thu, 21 Sep 2023 13:26:13 +0200 Subject: [PATCH 1/4] Ignore venv files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 35bbfa0..7d1135c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ eggs/ .eggs/ lib/ lib64/ +lib64 parts/ sdist/ var/ @@ -86,3 +87,6 @@ vcredist_x64.exe # vim tags file tags +# venv files +bin/ +pyvenv.cfg From 5b613163165bb57b44aefab1a9178b1a6f858102 Mon Sep 17 00:00:00 2001 From: Kai Ratzeburg Date: Thu, 21 Sep 2023 13:27:05 +0200 Subject: [PATCH 2/4] Fix crashes: float given, int expected --- oPB/controller/main.py | 4 ++-- oPB/gui/helpviewer.py | 6 +++--- oPB/gui/splash.py | 8 ++++---- oPB/gui/startup.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/oPB/controller/main.py b/oPB/controller/main.py index 8b6a0cd..1288bb4 100644 --- a/oPB/controller/main.py +++ b/oPB/controller/main.py @@ -116,8 +116,8 @@ def __init__(self, cmd_line): self.logger.debug("Show main window") if ConfigHandler.cfg.posX == 0 and ConfigHandler.cfg.posY == 0: screen = QDesktopWidget().screenGeometry(self.ui) - hpos = (screen.width() - ConfigHandler.cfg.width) / 2 - vpos = (screen.height() - ConfigHandler.cfg.height) / 2 + hpos = int((screen.width() - ConfigHandler.cfg.width) / 2) + vpos = int((screen.height() - ConfigHandler.cfg.height) / 2) self.ui.move(hpos, vpos) else: self.ui.setGeometry(ConfigHandler.cfg.posX, ConfigHandler.cfg.posY, ConfigHandler.cfg.width, ConfigHandler.cfg.height) diff --git a/oPB/gui/helpviewer.py b/oPB/gui/helpviewer.py index 27d5330..0170e2e 100644 --- a/oPB/gui/helpviewer.py +++ b/oPB/gui/helpviewer.py @@ -348,11 +348,11 @@ def __init__(self, qthelp_file, parent = None): # set splitter width w = self._splitterUpper.geometry().width() - self._splitterUpper.setSizes([w*(1/4), w*(3/4)]) + self._splitterUpper.setSizes([int(w*(1/4)), int(w*(3/4))]) w = self._splitterLower.geometry().width() - self._splitterLower.setSizes([w*(1/5), w*(4/5)]) + self._splitterLower.setSizes([int(w*(1/5)), int(w*(4/5))]) h = self._splitterMain.geometry().height() - self._splitterMain.setSizes([h*(1/9), h*(7/9), h*(1/9)]) + self._splitterMain.setSizes([int(h*(1/9)), int(h*(7/9)), int(h*(1/9))]) self._helpContent.linkActivated.connect(self._wv.setUrl) self._helpIndex.linkActivated.connect(self._wv.setUrl) diff --git a/oPB/gui/splash.py b/oPB/gui/splash.py index 43e1d8f..eab744b 100644 --- a/oPB/gui/splash.py +++ b/oPB/gui/splash.py @@ -68,8 +68,8 @@ def add_progressbar(self): """Add separate progress bar to splash screen""" self._progressBar = QProgressBar(self._splash) - self._progressBar.setGeometry(self._splash.width() / 10, 8 * self._splash.height() / 10, - 8 * self._splash.width() / 10, self._splash.height() / 10) + self._progressBar.setGeometry(int(self._splash.width() / 10), int(8 * self._splash.height() / 10), + int(8 * self._splash.width() / 10), int(self._splash.height() / 10)) self._progressBar.hide() def setProgress(self, val): @@ -161,8 +161,8 @@ def show_(self, msg = ""): mysize = self._splash.geometry() - hpos = parentUi.x() + ((parentUi.width() - mysize.width()) / 2) - vpos = parentUi.y() + ((parentUi.height() - mysize.height()) / 2) + hpos = int(parentUi.x() + ((parentUi.width() - mysize.width()) / 2)) + vpos = int(parentUi.y() + ((parentUi.height() - mysize.height()) / 2)) self._splash.move(hpos, vpos) self._splash.show() diff --git a/oPB/gui/startup.py b/oPB/gui/startup.py index db412be..2253df2 100644 --- a/oPB/gui/startup.py +++ b/oPB/gui/startup.py @@ -187,6 +187,6 @@ def show_me(self): def set_position(self): parentUi = self._parentUi.geometry() mysize = self.geometry() - hpos = parentUi.x() + ((parentUi.width() - mysize.width()) / 2) - vpos = parentUi.y() + ((parentUi.height() - mysize.height()) / 2) + hpos = int(parentUi.x() + ((parentUi.width() - mysize.width()) / 2)) + vpos = int(parentUi.y() + ((parentUi.height() - mysize.height()) / 2)) self.move(hpos, vpos) From 5cccebcc052987051566465208b740b732072175 Mon Sep 17 00:00:00 2001 From: Kai Ratzeburg Date: Thu, 21 Sep 2023 13:30:45 +0200 Subject: [PATCH 3/4] Fix settings save if dev_dir or local_share_base is empty --- oPB/core/confighandler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oPB/core/confighandler.py b/oPB/core/confighandler.py index 78157ec..da0801d 100644 --- a/oPB/core/confighandler.py +++ b/oPB/core/confighandler.py @@ -449,7 +449,7 @@ def dev_dir(self): @dev_dir.setter def dev_dir(self, value): - if value[-2] != ":": + if value != "" and value[-2] != ":": if value[-1:] == "/" or value[-1:] == '\\': value = value[:-1] self.set("package", "dev_dir", value) @@ -460,7 +460,7 @@ def local_share_base(self): @local_share_base.setter def local_share_base(self, value): - if value[-2] != ":": + if value != "" and value[-2] != ":": if value[-1:] == "/" or value[-1:] == '\\': value = value[:-1] self.set("package", "local_share_base", value) From ac08e562089b21f4fc9d53e0a14370e23beb4e65 Mon Sep 17 00:00:00 2001 From: Kai Ratzeburg Date: Thu, 21 Sep 2023 13:36:22 +0200 Subject: [PATCH 4/4] Add missing PyQtWebEngine --- requirements.txt | 1 + setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 71119cd..bbbcc68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ pycryptodome>=3.4.6 PyQt5>=5.9.0 +PyQtWebEngine>=5.15.3 pyqt5-tools>=5.8.2.1.0 spur>=0.3.20 diff --git a/setup.py b/setup.py index 81a83d6..9770e5a 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,8 @@ def read(*paths): data_files=data, install_requires=["pyqt5>=5.6", "spur", - "pycryptodome" + "pycryptodome", + "PyQtWebEngine" ], entry_points={ 'gui_scripts': [