Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to qt6 #387

Merged
merged 5 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ignore=tests,
ui_newfwruledlg.py,
ui_restoredlg.py,
ui_settingsdlg.py,
resources_rc.py
extension-pkg-whitelist=PyQt5
resources.py
extension-pkg-whitelist=PyQt6

[MESSAGES CONTROL]
disable=
Expand Down
3 changes: 3 additions & 0 deletions .qubesbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ vm:
deb:
build:
- debian
vm-jammy:
deb:
build: []
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@ VERSION := $(shell cat version)

PYTHON ?= python3

LRELEASE_QT5 ?= $(if $(wildcard /etc/debian_version),lrelease,lrelease-qt5)
LRELEASE_QT6 ?= $(if $(wildcard /etc/debian_version),/usr/lib/qt6/bin/lrelease,lrelease-qt6)
RCC ?= $(if $(wildcard /etc/debian_version),/usr/lib/qt6/libexec/rcc,/usr/lib64/qt6/libexec/rcc)

SETUPTOOLS_OPTS =
SETUPTOOLS_OPTS += $(if $(wildcard /etc/debian_version),--install-layout=deb,)

export QT_HASH_SEED=0
export PYTHONHASHSEED=0
export QT_SELECT=qt6

qubesmanager/ui_%.py: ui/%.ui
pyuic5 --from-imports -o $@ $<
pyuic6 -o $@ $<
touch --reference=$< $@

ui: $(patsubst ui/%.ui,qubesmanager/ui_%.py,$(wildcard ui/*.ui))

res:
pyrcc5 -o qubesmanager/resources_rc.py resources.qrc
touch --reference=resources.qrc qubesmanager/resources_rc.py
$(RCC) -g python resources.qrc | sed '0,/PySide6/s//PyQt6/' > qubesmanager/resources.py
touch --reference=resources.qrc qubesmanager/resources.py

translations:
$(LRELEASE_QT5) qubesmanager.pro
$(LRELEASE_QT6) qubesmanager.pro

python:
$(PYTHON) ./setup.py build
Expand All @@ -30,7 +32,7 @@ python_install:
$(PYTHON) ./setup.py install -O1 --skip-build --root $(DESTDIR) $(SETUPTOOLS_OPTS)

update_ts: res
pylupdate5 qubesmanager.pro
pylupdate6 qubesmanager.pro

install:
mkdir -p $(DESTDIR)/usr/libexec/qubes-manager/
Expand Down
11 changes: 7 additions & 4 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ Build-Depends:
dh-python,
python3-all,
python3-setuptools,
qtbase5-dev,
qttools5-dev-tools,
pyqt5-dev-tools
qt6-base-dev,
qt6-base-dev-tools,
qt6-tools-dev-tools,
qt6-l10n-tools,
pyqt6-dev,
pyqt6-dev-tools,
Standards-Version: 4.3.0
Homepage: https://www.qubes-os.org/
#Vcs-Git: git://github.com/QubesOS/qubes-manager.git
Expand All @@ -20,7 +23,7 @@ Package: qubes-manager
Architecture: any
Depends:
python3-qubesadmin (>= 4.3.0),
python3-pyqt5,
python3-pyqt6,
python3-pyinotify,
python3-qasync,
qubes-desktop-linux-common,
Expand Down
2 changes: 1 addition & 1 deletion debian/install
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/usr/lib/*/dist-packages/qubesmanager/qvm_template_gui.py
/usr/lib/*/dist-packages/qubesmanager/clone_vm.py

/usr/lib/*/dist-packages/qubesmanager/resources_rc.py
/usr/lib/*/dist-packages/qubesmanager/resources.py

/usr/lib/*/dist-packages/qubesmanager/ui_backupdlg.py
/usr/lib/*/dist-packages/qubesmanager/ui_bootfromdevice.py
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

include /usr/share/dpkg/default.mk
export DESTDIR=$(shell pwd)/debian/tmp
export QT_SELECT=qt5
export QT_SELECT=qt6

%:
dh $@ --with python3 --buildsystem=pybuild
Expand Down
1 change: 1 addition & 0 deletions icons/checkmark-with-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/checkmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions icons/obsolete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions icons/qubes-global-config.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/repo-refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/template-switcher.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion qubesmanager.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOURCES = \
qubesmanager/log_dialog.py \
qubesmanager/multiselectwidget.py \
qubesmanager/qube_manager.py \
qubesmanager/resources_rc.py \
qubesmanager/resources.py \
qubesmanager/restore.py \
qubesmanager/settings.py \
qubesmanager/template_manager.py \
Expand Down
2 changes: 1 addition & 1 deletion qubesmanager/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
qrc_resources.py
resources_rc.py
resources.py
ui_*.py
*.py[co]
10 changes: 7 additions & 3 deletions qubesmanager/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
# with this program; if not, see <http://www.gnu.org/licenses/>.
#
#
from PyQt5.QtWidgets import QDialog # pylint: disable=import-error
from PyQt5.QtGui import QIcon # pylint: disable=import-error
from PyQt6.QtWidgets import QDialog # pylint: disable=import-error
from PyQt6.QtGui import QIcon # pylint: disable=import-error
from qubesmanager.informationnotes import InformationNotesDialog

from . import ui_about # pylint: disable=no-name-in-module

# this is needed for icons to actually work
# pylint: disable=unused-import, no-name-in-module
from . import resources


# pylint: disable=too-few-public-methods
class AboutDialog(ui_about.Ui_AboutDialog, QDialog):
Expand Down Expand Up @@ -58,4 +62,4 @@ def __init__(self, parent=None):

def on_information_notes_clicked(self):
information_notes_dialog = InformationNotesDialog(self)
information_notes_dialog.exec_()
information_notes_dialog.exec()
2 changes: 1 addition & 1 deletion qubesmanager/appmenu_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#

import subprocess
from PyQt5 import QtWidgets, QtCore # pylint: disable=import-error
from PyQt6 import QtWidgets, QtCore # pylint: disable=import-error
from qubesadmin import exc

# TODO description in tooltip
Expand Down
Loading