Skip to content
Open
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
29 changes: 13 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
with:
version: 6.10.1
arch: clang_64
cache: true
- name: Build
run: |
cmake "-GNinja" -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
Expand All @@ -70,7 +71,7 @@ jobs:
container: ubuntu:${{ matrix.container }}
strategy:
matrix:
container: ['22.04', '24.04', '25.04', '25.10']
container: ['22.04', '24.04', '25.10']
arch: ['amd64', 'arm64']
env:
DEBIAN_FRONTEND: noninteractive
Expand Down Expand Up @@ -140,10 +141,11 @@ jobs:
path: build/qdigidoc4*.rpm
windows:
name: Build on Windows
runs-on: windows-2025
runs-on: ${{ matrix.platform == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
strategy:
matrix:
vcver: [143]
platform: [x64, arm64]
env:
VER_SUFFIX: .VS${{ matrix.vcver }}
steps:
Expand All @@ -153,7 +155,7 @@ jobs:
with:
workflow: build.yml
branch: master
name: msi_${{ matrix.vcver }}_x64
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
path: ./
repo: open-eid/libdigidocpp
- name: Install artifact
Expand All @@ -164,39 +166,34 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{ matrix.vcver }}-${{ hashFiles('vcpkg.json') }}
- name: Prepare vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: ./vcpkg.json
runVcpkgInstall: true
env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed
key: vcpkg-${{ matrix.vcver }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.1
arch: win64_msvc2022_64
arch: ${{ matrix.platform == 'arm64' && 'win64_msvc2022_arm64' || 'win64_msvc2022_64' }}
cache: true
- name: Setup dev env
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
arch: ${{ matrix.platform }}
- name: Install WiX
run: |
dotnet tool install -g wix --version 6.0.2
wix extension -g add WixToolset.UI.wixext/6.0.2
- name: Build
env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
run: |
cmake "-GNinja" -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --target msi
cmake --build build --target msishellext
cmake --build build --target appx
- name: Archive artifacts
uses: actions/upload-artifact@v5
with:
name: msi_${{ matrix.vcver }}_x64
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
path: |
build/*.msi
build/*.appx
Expand Down
4 changes: 1 addition & 3 deletions client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class Application::Private
std::unique_ptr<MacMenuBar> bar;
QSigner *signer {};

QTranslator appTranslator, commonTranslator, qtTranslator;
QTranslator appTranslator, qtTranslator;
QString lang;
QTimer lastWindowTimer;
volatile bool ready = false;
Expand Down Expand Up @@ -411,7 +411,6 @@ Application::Application( int &argc, char **argv )
});

installTranslator( &d->appTranslator );
installTranslator( &d->commonTranslator );
installTranslator( &d->qtTranslator );
loadTranslation(Settings::LANGUAGE);

Expand Down Expand Up @@ -665,7 +664,6 @@ void Application::loadTranslation( const QString &lang )
else QLocale::setDefault(QLocale(QLocale::Estonian, QLocale::Estonia));

void(d->appTranslator.load(QLatin1String(":/translations/%1.qm").arg(lang)));
void(d->commonTranslator.load(QLatin1String(":/translations/common_%1.qm").arg(lang)));
void(d->qtTranslator.load(QLatin1String(":/translations/qtbase_%1.qm").arg(lang)));
if( d->closeAction ) d->closeAction->setText( tr("Close Window") );
if( d->newClientAction ) d->newClientAction->setText( tr("New Window") );
Expand Down
24 changes: 9 additions & 15 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
get_target_property(qtCore_install_prefix Qt6::qmake IMPORTED_LOCATION)
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
get_filename_component(TSL_FILENAME ${TSL_URL} NAME_WLE)
set(TSL_LIST ${TSL_FILENAME} ${TSL_INCLUDE})
list(TRANSFORM TSL_LIST APPEND .xml)
Expand All @@ -9,14 +7,11 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TSL_FILENAME}.xml)
else()
set(TSL_DIR ${CMAKE_CURRENT_BINARY_DIR})
list(TRANSFORM TSL_LIST PREPEND ${TSL_DIR}/)
add_executable(TSLDownload TSLDownload.cpp)
target_link_libraries(TSLDownload Qt6::Network)
set_target_properties(TSLDownload PROPERTIES AUTOMOC OFF)
find_package(Python REQUIRED)
add_custom_command(
OUTPUT ${TSL_LIST}
DEPENDS TSLDownload
COMMAND $<TARGET_FILE:TSLDownload> ${CMAKE_CURRENT_BINARY_DIR} ${TSL_URL} ${TSL_INCLUDE}
WORKING_DIRECTORY ${qtCore_install_prefix}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/download_tsl.py
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/download_tsl.py ${CMAKE_CURRENT_BINARY_DIR} ${TSL_URL} ${TSL_INCLUDE}
)
endif()

Expand Down Expand Up @@ -96,12 +91,10 @@ qt_add_translations(${PROJECT_NAME} TS_FILES
translations/en.ts
translations/et.ts
translations/ru.ts
../common/translations/common_en.ts
../common/translations/common_et.ts
../common/translations/common_ru.ts
../common/translations/qtbase_et.ts
../common/translations/qtbase_ru.ts
RESOURCE_PREFIX /translations
LUPDATE_OPTIONS -locations none
)
qt_add_resources(${PROJECT_NAME} tsl BASE ${TSL_DIR} PREFIX /TSL FILES ${TSL_LIST})

Expand Down Expand Up @@ -241,10 +234,11 @@ elseif(WIN32)
${CMAKE_SOURCE_DIR}/common/WelcomeDlg.wxs
${CMAKE_SOURCE_DIR}/common/WixUI_Minimal.wxs
)
get_filename_component(QT_BASE_DIR "${Qt6_DIR}/../../.." ABSOLUTE)
add_custom_target(msi DEPENDS ${PROJECT_NAME}
COMMAND ${WIX_CMD} -o "${MSI_FILE}.msi"
#Build MSI with QT
COMMAND ${WIX_CMD} -d qt_path=${qtCore_install_prefix} -o "${MSI_FILE}.qt.msi"
COMMAND ${WIX_CMD} -d qt_path=${QT_BASE_DIR}/bin -o "${MSI_FILE}.qt.msi"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
if(SIGNCERT)
Expand All @@ -261,10 +255,10 @@ elseif(WIN32)
endif()
set(PLATFORM $ENV{PLATFORM})
configure_file(${CMAKE_SOURCE_DIR}/AppxManifest.xml.cmake ${CMAKE_BINARY_DIR}/AppxManifest.xml)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(OPENSSL_SUFFIX "-x64")
else()
if(PLATFORM STREQUAL "x86")
set(OPENSSL_SUFFIX "")
else()
set(OPENSSL_SUFFIX "-${PLATFORM}")
endif()
add_custom_target(appx DEPENDS ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E remove ${MSI_FILE}.appx
Expand Down
79 changes: 0 additions & 79 deletions client/TSLDownload.cpp

This file was deleted.

63 changes: 63 additions & 0 deletions client/download_tsl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import sys
import shutil
import os
import xml.etree.ElementTree as ET
import urllib.request
import urllib.error
import urllib.parse

def download_tsl_file(url, output_path, filename):
output_file = os.path.join(output_path, filename)
print(f"Downloading TSL list from: {url}")
try:
with urllib.request.urlopen(url) as response, open(output_file, 'wb') as f:
shutil.copyfileobj(response, f)
print(f"Saved to: {output_file}")
return output_file
except (urllib.error.HTTPError, urllib.error.URLError) as e:
print(f"Error downloading TSL list: {e}")
sys.exit(1)
except IOError as e:
print(f"Error saving TSL list {output_file}: {e}")
sys.exit(1)

def download_tsl_files(output_path, list_url, territories):
master_list_filename = os.path.basename(urllib.parse.urlparse(list_url).path)
if not master_list_filename:
master_list_filename = "eu-lotl.xml" # Fallback filename
file = download_tsl_file(list_url, output_path, master_list_filename)
try:
root = ET.parse(file)
ns = {'tsl': "http://uri.etsi.org/02231/v2#"}
for pointer in root.findall('.//tsl:OtherTSLPointer', ns):
territory = pointer.find('.//tsl:SchemeTerritory', ns)
if territory is None or territory.text not in territories:
continue

mime = pointer.find('.//tslx:MimeType', {'tslx': 'http://uri.etsi.org/02231/v2/additionaltypes#'})
if mime is None or mime.text != 'application/vnd.etsi.tsl+xml':
continue

location = pointer.find('.//tsl:TSLLocation', ns)
if location is not None:
download_tsl_file(location.text, output_path, f"{territory.text}.xml")

except ET.ParseError as e:
print(f"Error parsing XML: {e}")
sys.exit(1)

if __name__ == "__main__":
if len(sys.argv) < 4:
print("Usage: python download_tsl.py <output_path> <url> <territory1> [territory2] ...")
sys.exit(1)

output_path = sys.argv[1]
url = sys.argv[2]
territories_to_download = sys.argv[3:]

if not os.path.isdir(output_path):
print(f"Error: Output path '{output_path}' is not a directory.")
sys.exit(1)

download_tsl_files(output_path, url, territories_to_download)
print("TSL download process finished.")
11 changes: 11 additions & 0 deletions client/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,17 @@
<translation>Cannot connect to certificate status service!</translation>
</message>
</context>
<context>
<name>Configuration</name>
<message>
<source>The configuration file located on the server cannot be validated.</source>
<translation>The configuration file located on the server cannot be validated.</translation>
</message>
<message>
<source>Your computer&apos;s configuration file is later than the server has.</source>
<translation>Your computer&apos;s configuration file is later than the server has.</translation>
</message>
</context>
<context>
<name>ContainerPage</name>
<message>
Expand Down
11 changes: 11 additions & 0 deletions client/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,17 @@
<translation>Kehtivuskinnitusteenus ei ole kättesaadav!</translation>
</message>
</context>
<context>
<name>Configuration</name>
<message>
<source>The configuration file located on the server cannot be validated.</source>
<translation>Serveris olev konfiguratsioonifail ei valideeru.</translation>
</message>
<message>
<source>Your computer&apos;s configuration file is later than the server has.</source>
<translation>Sinu arvutis on uuem konfiguratsioonifail kui serveris.</translation>
</message>
</context>
<context>
<name>ContainerPage</name>
<message>
Expand Down
11 changes: 11 additions & 0 deletions client/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,17 @@
<translation>Услуга подтверждения действительности не доступна!</translation>
</message>
</context>
<context>
<name>Configuration</name>
<message>
<source>The configuration file located on the server cannot be validated.</source>
<translation>Находящийся на сервере конфигурационный файл не валидируется.</translation>
</message>
<message>
<source>Your computer&apos;s configuration file is later than the server has.</source>
<translation>Находящийся на Вашем компьютере конфигурационный файл новее файла на сервере.</translation>
</message>
</context>
<context>
<name>ContainerPage</name>
<message>
Expand Down
Loading
Loading