Skip to content

Commit

Permalink
Merge pull request #187 from Nitrokey/qt6-full
Browse files Browse the repository at this point in the history
Complete Qt6/PySide6 migration
  • Loading branch information
daringer authored Dec 19, 2023
2 parents dad85bc + cca0fb7 commit f0efa28
Show file tree
Hide file tree
Showing 56 changed files with 756 additions and 7,359 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/cd-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,30 @@ jobs:
- name: Install required packages
run: |
apt update
apt install -y binutils gcc libglib2.0-dev libpcsclite-dev libusb-1.0-0 make python3-poetry swig
apt install -y binutils \
libglib2.0-dev \
libgl-dev \
libegl-dev \
libxkbcommon-x11-dev \
libxcb-cursor-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-render-util0-dev \
libxcb-shape0-dev \
libxcb-xkb-dev \
libdbus-1-dev \
libwayland-dev \
libgtk-3-dev \
libatk1.0-dev \
libpangocairo-1.0-0 \
libpango1.0-dev \
make \
python3-poetry
- name: Create virtual environment
run: poetry install
run: |
poetry env use python3.9
poetry install
- name: Build
run: make build-pyinstaller-onefile
- name: Upload artifacts
Expand Down
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ clean: semi-clean
rm -rf .mypy_cache

# build
build-ui: $(UI_FILES)
$(VENV_BIN)/pyrcc5 $(UI_FILES_PATH)/resources.qrc -o $(UI_FILES_PATH)/resources_rc.py
$(foreach var,$(UI_FILES),$(VENV_BIN)/pyuic5 --from-imports $(var) -o $(subst .ui,.py,$(var));)

build: build-ui
build:
poetry build

build-pyinstaller-onefile: build-ui
build-pyinstaller-onefile:
$(VENV_BIN)/pyinstaller ci-scripts/linux/pyinstaller/nitrokey-app-onefile.spec

# code checks
Expand All @@ -52,7 +48,7 @@ check-import-sorting:
check-style:
$(VENV_PYTHON) -m flake8 $(PACKAGE_NAME)/

check-typing: build-ui
check-typing:
$(VENV_PYTHON) -m mypy $(PACKAGE_NAME)/

check: check-format check-import-sorting check-style check-typing
Expand Down
2 changes: 1 addition & 1 deletion nitrokeyapp/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from types import TracebackType
from typing import Any, Callable, Generator, Optional, Type

from PyQt5 import QtWidgets
from PySide6 import QtWidgets
from qt_material import apply_stylesheet

from nitrokeyapp import get_theme_path
Expand Down
26 changes: 0 additions & 26 deletions nitrokeyapp/about_dialog.py

This file was deleted.

17 changes: 9 additions & 8 deletions nitrokeyapp/add_secret_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from base64 import b32decode
from typing import Optional

from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QWidget
from PySide6.QtCore import Slot
from PySide6.QtWidgets import QDialog, QDialogButtonBox, QWidget

from nitrokeyapp.qt_utils_mix_in import QtUtilsMixIn
from nitrokeyapp.secrets_tab.data import Credential, OtpKind
from nitrokeyapp.ui.add_secret_dialog import Ui_AddSecretDialog

# TODO:
# - max length
Expand All @@ -16,12 +16,13 @@
DEFAULT_OTP_KIND = OtpKind.TOTP


class AddSecretDialog(QDialog):
class AddSecretDialog(QtUtilsMixIn, QDialog):
def __init__(self, parent: Optional[QWidget] = None) -> None:
super().__init__(parent)
QDialog.__init__(self, parent)
QtUtilsMixIn.__init__(self)

self.ui = Ui_AddSecretDialog()
self.ui.setupUi(self)
# self.ui === self -> this tricks mypy due to monkey-patching self
self.ui = self.load_ui("add_secret_dialog.ui", self)

for kind in OtpKind:
self.ui.comboBoxOtpType.addItem(str(kind))
Expand All @@ -32,7 +33,7 @@ def __init__(self, parent: Optional[QWidget] = None) -> None:

self.refresh()

@pyqtSlot()
@Slot()
def refresh(self) -> None:
errors = []

Expand Down
35 changes: 0 additions & 35 deletions nitrokeyapp/bak/change_pin_dialog.py

This file was deleted.

62 changes: 0 additions & 62 deletions nitrokeyapp/bak/clock_progressbar.py

This file was deleted.

51 changes: 0 additions & 51 deletions nitrokeyapp/bak/edit_button_widget.py

This file was deleted.

79 changes: 0 additions & 79 deletions nitrokeyapp/bak/key_generation.py

This file was deleted.

Loading

0 comments on commit f0efa28

Please sign in to comment.