Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into WE-145-squash
Browse files Browse the repository at this point in the history
  • Loading branch information
mrts committed Jun 21, 2024
2 parents 83d06cd + f2374c2 commit 9f1e1f1
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 47 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/cmake-linux-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,25 @@ env:
QT_QPA_PLATFORM: offscreen
DEBIAN_FRONTEND: noninteractive
DEBFULLNAME: GitHub build
DEBEMAIL: github-action@github
DEBEMAIL: github-action@github.com
CMAKE_BUILD_PARALLEL_LEVEL: 3

jobs:
build:
runs-on: ubuntu-latest
container: ${{matrix.container}}
container: ubuntu:${{matrix.container}}
strategy:
matrix:
container: ['ubuntu:20.04', 'ubuntu:22.04']
include:
- container: 'ubuntu:20.04'
name: ubuntu2004
- container: 'ubuntu:22.04'
name: ubuntu2204
container: ['20.04', '22.04', '24.04']

steps:
- name: Install dependencies
if: matrix.container == 'ubuntu:20.04'
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper pkg-config cmake libpcsclite-dev libssl-dev libgtest-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev
if: matrix.container == '20.04'
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper lintian pkg-config cmake libpcsclite-dev libssl-dev libgtest-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev

- name: Install dependencies
if: matrix.container != 'ubuntu:20.04'
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper pkg-config cmake libpcsclite-dev libssl-dev libgtest-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev
if: matrix.container != '20.04'
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper lintian pkg-config cmake libpcsclite-dev libssl-dev libgtest-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev

- uses: actions/checkout@v4
with:
Expand All @@ -44,9 +39,12 @@ jobs:
run: |
cmake --build build --config $BUILD_TYPE --target installer
# Debian creates artifacts outside of project dir, copy them back to make them available in the build artifacts
cp -r ../web-eid*.* build/src/app
mv ../web-eid*.* build/
- name: Test package
run: lintian build/*.deb

- uses: actions/upload-artifact@v4
with:
name: web-eid-app-ubuntu-build-${{matrix.name}}-${{github.run_number}}
path: build/src/app/*.*deb
name: web-eid-app-ubuntu-build-ubuntu${{matrix.container}}-${{github.run_number}}
path: build/*.*deb
18 changes: 13 additions & 5 deletions .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ on: [push, pull_request]
env:
BUILD_TYPE: RelWithDebInfo
BUILD_NUMBER: ${{github.run_number}}
CMAKE_BUILD_PARALLEL_LEVEL: 3
CMAKE_BUILD_PARALLEL_LEVEL: 4

jobs:
build:
runs-on: windows-2019
runs-on: ${{ matrix.image }}
strategy:
matrix:
vcver: [142, 143]
include:
- vcver: 142
image: windows-2019
- vcver: 143
image: windows-2022

steps:
- name: Checkout code
Expand All @@ -27,7 +35,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.6.3
version: 6.7.1
arch: win64_msvc2019_64

- name: Setup MS Visual C++ dev env
Expand All @@ -45,7 +53,7 @@ jobs:
- name: Configure
run: |
cmake "-GNinja" -S . -B build `
"-DCMAKE_TOOLCHAIN_FILE=${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" `
"-DCMAKE_TOOLCHAIN_FILE=${env:RUNVCPKG_VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" `
"-DCMAKE_BUILD_TYPE=${env:BUILD_TYPE}"
- name: Build
Expand All @@ -60,7 +68,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: web-eid-app-windows-build-${{github.run_number}}
name: web-eid-app-windows-build-VC${{matrix.vcver}}-${{github.run_number}}
path: |
build/src/app/*.msi
build/src/app/*.exe
Expand Down
10 changes: 8 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,35 @@ Description: Web eID application suite (metapackage)

Package: web-eid-native
Architecture: any
Multi-Arch: foreign
Depends: pcscd, ${shlibs:Depends}, ${misc:Depends}
Replaces: token-signing-native
Breaks: token-signing-native
Suggests: web-eid-firefox, web-eid-chrome
Description: Web eID browser extension helper application
Native messaging host for Web eID Chrome and Firefox extensions that performs
cryptographic digital signing and authentication operations with electronic ID
smart cards. Also works standalone without extensions in command-line mode.

Package: web-eid-firefox
Architecture: all
Depends: jq, web-eid-native (= ${binary:Version})
Depends: jq, web-eid-native
Replaces: token-signing-firefox
Breaks: token-signing-firefox
Suggests: firefox
Enhances: firefox
Description: Web eID browser extension for Firefox
The Web eID extension for Firefox communicates with the Web eID native
application using Native messaging to enable usage of electronic ID smart
cards for secure authentication and digital signing of documents on the web.

Package: web-eid-chrome
Architecture: all
Depends: web-eid-native (= ${binary:Version})
Depends: web-eid-native
Replaces: token-signing-chrome
Breaks: token-signing-chrome
Suggests: chromium, chromium-browser, chrome
Enhances: chromium, chromium-browser, chrome
Description: Web eID browser extension for Chrome
The Web eID extension for Chrome communicates with the Web eID native
application using Native messaging to enable usage of electronic ID smart
Expand Down
3 changes: 2 additions & 1 deletion debian/source/options
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tar-ignore = "build/*"
tar-ignore
tar-ignore = build
2 changes: 1 addition & 1 deletion install/web-eid.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
</Directory>
<Directory Id="styles" Name="styles">
<File Source="$(var.qt_path)\..\plugins\styles\qwindowsvistastyle$(var.qt_suffix).dll" />
<File Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />
</Directory>
<Directory Id="imageformats" Name="imageformats">
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
Expand Down
39 changes: 33 additions & 6 deletions src/ui/dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
<height>510</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>550</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Web eID</string>
</property>
Expand Down Expand Up @@ -199,6 +193,9 @@ height: 24px;
<property name="spacing">
<number>30</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<property name="leftMargin">
<number>20</number>
</property>
Expand Down Expand Up @@ -235,6 +232,12 @@ height: 24px;
</property>
<item>
<widget class="QLabel" name="waitingPageTitleLabel">
<property name="minimumSize">
<size>
<width>510</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
Expand Down Expand Up @@ -306,6 +309,12 @@ height: 24px;
</property>
<item>
<widget class="QLabel" name="messagePageTitleLabel">
<property name="minimumSize">
<size>
<width>510</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
Expand Down Expand Up @@ -441,6 +450,12 @@ height: 24px;
</property>
<item>
<widget class="QLabel" name="selectCertificatePageTitleLabel">
<property name="minimumSize">
<size>
<width>510</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
Expand Down Expand Up @@ -523,6 +538,12 @@ height: 24px;
</property>
<item>
<widget class="QLabel" name="pinInputPageTitleLabel">
<property name="minimumSize">
<size>
<width>510</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
Expand Down Expand Up @@ -773,6 +794,12 @@ height: 24px;
</item>
<item>
<widget class="QWidget" name="aboutContent" native="true">
<property name="minimumSize">
<size>
<width>510</width>
<height>0</height>
</size>
</property>
<layout class="QGridLayout" name="aboutContentLayout">
<property name="horizontalSpacing">
<number>10</number>
Expand Down
20 changes: 4 additions & 16 deletions src/ui/webeiddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ WebEidDialog::WebEidDialog(QWidget* parent) : WebEidUI(parent), ui(new Private)
ui->fatalHelp->hide();
ui->selectAnotherCertificate->hide();

connect(ui->pageStack, &QStackedWidget::currentChanged, this, &WebEidDialog::resizeHeight);
connect(ui->pageStack, &QStackedWidget::currentChanged, this, [this]{
ui->pageStack->setFixedHeight(ui->pageStack->currentWidget()->sizeHint().height());
});
connect(ui->selectionGroup, qOverload<QAbstractButton*>(&QButtonGroup::buttonClicked), this,
[this] {
ui->okButton->setEnabled(true);
Expand Down Expand Up @@ -243,16 +245,12 @@ void WebEidDialog::showAboutPage()
if (app->isSafariExtensionContainingApp()) {
d->setupOK([app] { app->showSafariSettings(); }, QT_TR_NOOP("Open Safari settings..."),
true);
connect(app, &Application::safariExtensionEnabled, d, [d](bool value) {
d->ui->aboutAlert->setHidden(value);
d->resizeHeight();
});
connect(app, &Application::safariExtensionEnabled, d->ui->aboutAlert, &QWidget::setHidden);
app->requestSafariExtensionState();
} else {
d->ui->okButton->hide();
}
d->ui->pageStack->setCurrentIndex(int(Page::ABOUT));
d->resizeHeight();
d->open();
connect(d, &WebEidDialog::finished, qApp, &QApplication::quit);
}
Expand All @@ -269,7 +267,6 @@ void WebEidDialog::showFatalErrorPage()
d->ui->cancelButton->show();
d->ui->okButton->hide();
d->ui->pageStack->setCurrentIndex(int(Page::ALERT));
d->resizeHeight();
d->exec();
}

Expand Down Expand Up @@ -457,7 +454,6 @@ void WebEidDialog::onVerifyPinFailed(const VerifyPinFailed::Status status, const
break;
case Status::PIN_BLOCKED:
displayPinBlockedError();
resizeHeight();
return;
case Status::INVALID_PIN_LENGTH:
message = [] { return tr("Invalid PIN length"); };
Expand Down Expand Up @@ -485,7 +481,6 @@ void WebEidDialog::onVerifyPinFailed(const VerifyPinFailed::Status status, const
ui->pinTitleLabel->show();
ui->okButton->setDisabled(true);
ui->cancelButton->setEnabled(true);
resizeHeight();
}
}

Expand All @@ -502,7 +497,6 @@ bool WebEidDialog::event(QEvent* event)
case QEvent::LanguageChange:
ui->retranslateUi(this);
emit languageChange();
resizeHeight();
break;
case QEvent::MouseButtonRelease:
if (auto* w = findChild<QWidget*>(QStringLiteral("langMenu"))) {
Expand Down Expand Up @@ -691,12 +685,6 @@ void WebEidDialog::showPinInputWarning(bool show)
style()->polish(ui->pinInput);
}

void WebEidDialog::resizeHeight()
{
ui->pageStack->setFixedHeight(ui->pageStack->currentWidget()->sizeHint().height());
adjustSize();
}

QPixmap WebEidDialog::pixmap(QLatin1String name)
{
return {QStringLiteral(":/images/%1%2.svg")
Expand Down
1 change: 0 additions & 1 deletion src/ui/webeiddialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class WebEidDialog final : public WebEidUI
void displayPinBlockedError();

void showPinInputWarning(bool show);
void resizeHeight();

static QPixmap pixmap(QLatin1String name);
constexpr static std::tuple<const char*, const char*, QLatin1String>
Expand Down

0 comments on commit 9f1e1f1

Please sign in to comment.