Skip to content

Commit

Permalink
Merge master into rework-base-input
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros committed Apr 19, 2024
2 parents 833f6fa + 53b2f34 commit adf1b8c
Show file tree
Hide file tree
Showing 60 changed files with 713 additions and 517 deletions.
43 changes: 13 additions & 30 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ jobs:
if: ( github.repository == 'MerginMaps/mobile' ) && (!contains(github.event.head_commit.message, 'Translate '))
runs-on: macos-13
env:
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
NDK_VERSION: r25
NDK_VERSION_FULL: r25b
JDK_VERSION: 11
SDK_PLATFORM: android-33
SDK_BUILD_TOOLS: 33.0.1
INPUT_SDK_VERSION_ARM: arm-android-20240405-212
INPUT_SDK_VERSION_ARM64: arm64-android-20240405-212
INPUT_SDK_VERSION_ARM: arm-android-20240415-218
INPUT_SDK_VERSION_ARM64: arm64-android-20240415-218
CCACHE_DIR: /Users/runner/work/ccache
GITHUB_TOKEN: ${{ secrets.INPUTAPP_BOT_GITHUB_TOKEN }}
CACHE_VERSION: 4
CACHE_VERSION: 0
CMAKE_VERSION: '3.29.0'
QT_ANDROID_KEYSTORE_ALIAS: input
QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.INPUTKEYSTORE_STOREPASS }}
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.INPUTKEYSTORE_STOREPASS }}
Expand Down Expand Up @@ -80,32 +81,8 @@ jobs:
- name: Install Build Dependencies
run: |
# FIXME: We should not need to do this, but there are currently some complications with Github CI.
# See https://github.com/actions/runner-images/issues/4020.
# See https://github.com/actions/runner-images/issues/8838.
rm -f '/usr/local/bin/2to3'
rm -f '/usr/local/bin/2to3-3.11'
rm -f '/usr/local/bin/2to3-3.12'
rm -f '/usr/local/bin/idle3'
rm -f '/usr/local/bin/idle3.11'
rm -f '/usr/local/bin/idle3.12'
rm -f '/usr/local/bin/pydoc3'
rm -f '/usr/local/bin/pydoc3.11'
rm -f '/usr/local/bin/pydoc3.12'
rm -f '/usr/local/bin/python3'
rm -f '/usr/local/bin/python3-config'
rm -f '/usr/local/bin/python3.11'
rm -f '/usr/local/bin/python3.12'
rm -f '/usr/local/bin/python3.11-config'
rm -f '/usr/local/bin/python3.12-config'
brew install pipx
pipx install aqtinstall
#pip3 install -U pip
#pip3 install aqtinstall
# end of hotfix
pip3 install -U pip
pip3 install aqtinstall
brew install gnupg
brew install openssl@1.1
Expand All @@ -124,6 +101,12 @@ jobs:
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ env.CMAKE_VERSION }}

- name: Cache Qt
id: cache-qt
uses: pat-s/always-upload-cache@v3.0.11
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- published

env:
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
CACHE_VERSION: 0

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gallery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
runs-on: ${{ matrix.os }}
env:
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
GITHUB_TOKEN: ${{ secrets.INPUTAPP_BOT_GITHUB_TOKEN }}
CACHE_VERSION: 0
XC_VERSION: ${{ '14.2' }} # macos-only
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: ( github.repository == 'MerginMaps/mobile' ) && (!contains(github.event.head_commit.message, 'Translate '))
runs-on: ubuntu-latest
env:
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
steps:

- uses: actions/checkout@v3
Expand Down
43 changes: 12 additions & 31 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ on:
- published

env:
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
XC_VERSION: ${{ '15.2' }}
IOS_CMAKE_TOOLCHAIN_VERSION: "4.4.0"
INPUT_SDK_VERSION: arm64-ios-20240405-173
INPUT_SDK_VERSION: arm64-ios-20240415-178
IOS_PROVISIONING_PROFILE_UUID: 59aaa8d7-516a-4592-8c58-d7d1c1f81610
KEYCHAIN: ${{ 'inputapp.keychain' }}
CCACHE_DIR: /Users/runner/work/ccache
CACHE_VERSION: 3
CMAKE_VERSION: '3.29.0'
CACHE_VERSION: 0

concurrency:
group: ci-${{github.ref}}-ios
Expand Down Expand Up @@ -74,39 +75,19 @@ jobs:
- name: Install brew deps
run: |
# FIXME: We should not need to do this, but there are currently some complications with Github CI.
# See https://github.com/actions/runner-images/issues/4020.
# See https://github.com/actions/runner-images/issues/8838.
rm -f '/usr/local/bin/2to3'
rm -f '/usr/local/bin/2to3-3.11'
rm -f '/usr/local/bin/2to3-3.12'
rm -f '/usr/local/bin/idle3'
rm -f '/usr/local/bin/idle3.11'
rm -f '/usr/local/bin/idle3.12'
rm -f '/usr/local/bin/pydoc3'
rm -f '/usr/local/bin/pydoc3.11'
rm -f '/usr/local/bin/pydoc3.12'
rm -f '/usr/local/bin/python3'
rm -f '/usr/local/bin/python3-config'
rm -f '/usr/local/bin/python3.11'
rm -f '/usr/local/bin/python3.12'
rm -f '/usr/local/bin/python3.11-config'
rm -f '/usr/local/bin/python3.12-config'
brew install pipx
pipx install aqtinstall
#pip3 install -U pip
#pip3 install aqtinstall
# ---- end hot fix
pip3 install -U pip
pip3 install aqtinstall
brew install gnupg
brew install openssl@1.1
brew install ccache
brew install ninja
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ env.CMAKE_VERSION }}

- name: Install ccache
run: |
mkdir -p ${CCACHE_DIR}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ on:

env:
CCACHE_DIR: ~/.ccache
INPUT_SDK_VERSION: x64-linux-20240405-176
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
CACHE_VERSION: 3
INPUT_SDK_VERSION: x64-linux-20240415-181
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
CMAKE_VERSION: '3.29.0'
CACHE_VERSION: 0

concurrency:
group: ci-${{github.ref}}-linux
Expand All @@ -43,8 +44,13 @@ jobs:
gperf autopoint '^libxcb.*-dev' libx11-xcb-dev libegl1-mesa libegl1-mesa-dev \
libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev \
autoconf-archive libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libfuse2 \
bison flex cmake ninja-build ccache lcov
bison flex ccache lcov
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ env.CMAKE_VERSION }}

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ on:
- published

env:
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
INPUT_SDK_VERSION: x64-osx-20240405-195
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
INPUT_SDK_VERSION: x64-osx-20240415-201
CCACHE_DIR: /Users/runner/work/ccache
CACHE_VERSION: 1
CACHE_VERSION: 0
CMAKE_VERSION: '3.29.0'
XC_VERSION: ${{ '15.2' }}

concurrency:
Expand All @@ -45,6 +46,11 @@ jobs:
brew install ccache
brew install ninja
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ env.CMAKE_VERSION }}

- name: Extract Mergin API_KEY
env:
MERGINSECRETS_DECRYPT_KEY: ${{ secrets.MERGINSECRETS_DECRYPT_KEY }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ jobs:
runs-on: windows-2019

env:
QT_VERSION: '6.6.0' # use scripts/update_qt_version.bash to change
INPUT_SDK_VERSION: x64-windows-20240405-223
QT_VERSION: '6.6.3' # use scripts/update_qt_version.bash to change
INPUT_SDK_VERSION: x64-windows-20240415-228
CCACHE_DIR: C:/ccache-cache # https://linux.die.net/man/1/ccache
CACHE_VERSION: 2
CACHE_VERSION: 0
VS_VERSION: "2019"
CMAKE_VERSION: '3.29.0'
QT_ARCH: "win64_msvc2019_64"

steps:
Expand All @@ -45,7 +46,12 @@ jobs:
WORKSPACE_DIR=$(cygpath -m "${{ github.workspace }}")
echo "WORKSPACE_DIR=$WORKSPACE_DIR" >> $GITHUB_OUTPUT
echo "WORKSPACE_DIR: $WORKSPACE_DIR"
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: ${{ env.CMAKE_VERSION }}

- name: Install ccache
shell: cmd
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.22)
set(MM_VERSION_MAJOR "2024")
set(MM_VERSION_MINOR "1")
set(MM_VERSION_PATCH "0")
set(QT_VERSION_DEFAULT "6.6.0")
set(QT_VERSION_DEFAULT "6.6.3")

# Note: we cannot set this for non-android build, since CMake will start looking for
# Qt6AndroidMacros.cmake
Expand Down
10 changes: 5 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Steps to build and run Input:
mkdir build
cd build
cmake -G Ninja \
-DCMAKE_PREFIX_PATH=~/Qt/6.6.0/gcc_64 \
-DCMAKE_PREFIX_PATH=~/Qt/6.6.3/gcc_64 \
-DINPUT_SDK_PATH=~/input-sdk/x64-linux \
-DQGIS_QUICK_DATA_PATH=~/input/app/android/assets/qgis-data \
-DUSE_MM_SERVER_API_KEY=FALSE \
Expand Down Expand Up @@ -296,8 +296,8 @@ Now you can create a build (either on commmand line or by setting these variable
cmake \
-DIOS=TRUE \
-DCMAKE_PREFIX_PATH=/opt/Qt/6.6.0/ios \
-DQT_HOST_PATH=/opt/Qt/6.6.0/macos \
-DCMAKE_PREFIX_PATH=/opt/Qt/6.6.3/ios \
-DQT_HOST_PATH=/opt/Qt/6.6.3/macos \
-DCMAKE_TOOLCHAIN_FILE:PATH="~/input-sdk/ios.toolchain.cmake" \
-DCMAKE_INSTALL_PREFIX:PATH="../install" \
-DUSE_SERVER_API_KEY=FALSE \
Expand Down Expand Up @@ -333,7 +333,7 @@ export BASE_DIR=~/Projects/quick;
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH=/opt/Qt/6.6.0/macos \
-DCMAKE_PREFIX_PATH=/opt/Qt/6.6.3/macos \
-DCMAKE_INSTALL_PREFIX:PATH=$BASE_DIR/install-macos \
-DINPUT_SDK_PATH=$BASE_DIR/sdk/x64-osx \
-GNinja \
Expand Down Expand Up @@ -361,7 +361,7 @@ For version of the tools used, see `.github/workflows/win.yml`
- setup build environment
```
set ROOT_DIR=C:\Users\zilol\Projects
set Qt6_DIR=C:\Qt\6.6.0\msvc2019_64
set Qt6_DIR=C:\Qt\6.6.3\msvc2019_64
set PATH=%QT_ROOT%\bin;C:\Program Files\CMake\bin\;%PATH%
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=x64
```
Expand Down
14 changes: 14 additions & 0 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,20 @@ int main( int argc, char *argv[] )
#endif
engine.rootContext()->setContextProperty( "__use_simulated_position", use_simulated_position );

// show "new look and feel" welcome dialog on start?
QString lastAppVersion = as.appVersion();
bool showWelcomeToNewDesignDialog = false;
if ( !lastAppVersion.isEmpty() ) // this is not a first run?
{
int dotPos = lastAppVersion.indexOf( '.' );
if ( dotPos >= 0 && lastAppVersion.left( dotPos ).toInt() < 2024 )
{
// only show if previously we were on 2.x version, and now we're on 2024.x.y with the new design
showWelcomeToNewDesignDialog = true;
}
}
engine.rootContext()->setContextProperty( "__showWelcomeToNewDesignDialog", showWelcomeToNewDesignDialog );

QQmlComponent component( &engine, QUrl( "qrc:/com.merginmaps/imports/MMInput/main.qml" ) );
QObject *object = component.create();

Expand Down
7 changes: 7 additions & 0 deletions app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,23 @@ class MMStyle: public QObject
Q_PROPERTY( double margin11 READ number11 CONSTANT )
Q_PROPERTY( double margin12 READ number12 CONSTANT )
Q_PROPERTY( double margin13 READ number13 CONSTANT )
Q_PROPERTY( double margin14 READ number14 CONSTANT )
Q_PROPERTY( double margin16 READ number16 CONSTANT )
Q_PROPERTY( double margin20 READ number20 CONSTANT )
Q_PROPERTY( double margin28 READ number28 CONSTANT )
Q_PROPERTY( double margin30 READ number30 CONSTANT )
Q_PROPERTY( double margin32 READ number32 CONSTANT )
Q_PROPERTY( double margin36 READ number36 CONSTANT )
Q_PROPERTY( double margin40 READ number40 CONSTANT )
Q_PROPERTY( double margin48 READ number48 CONSTANT )
Q_PROPERTY( double margin54 READ number54 CONSTANT )

// Page
Q_PROPERTY( double pageMargins READ number20 CONSTANT ) // distance between screen edge and components
Q_PROPERTY( double spacing5 READ number5 CONSTANT )
Q_PROPERTY( double spacing12 READ number12 CONSTANT ) // distance between page header, page content and page footer
Q_PROPERTY( double spacing20 READ number20 CONSTANT )
Q_PROPERTY( double spacing30 READ number30 CONSTANT )
Q_PROPERTY( double spacing40 READ number40 CONSTANT )
Q_PROPERTY( double maxPageWidth READ number720 CONSTANT ) // maximum page width (desktop, tablets, landscape)

Expand All @@ -285,6 +290,7 @@ class MMStyle: public QObject
Q_PROPERTY( double row40 READ number40 CONSTANT )
Q_PROPERTY( double row49 READ number49 CONSTANT )
Q_PROPERTY( double row50 READ number50 CONSTANT )
Q_PROPERTY( double row54 READ number54 CONSTANT )
Q_PROPERTY( double row60 READ number60 CONSTANT )
Q_PROPERTY( double row63 READ number63 CONSTANT )
Q_PROPERTY( double row67 READ number67 CONSTANT )
Expand All @@ -294,6 +300,7 @@ class MMStyle: public QObject
Q_PROPERTY( double row160 READ number160 CONSTANT )
Q_PROPERTY( double radius2 READ number2 CONSTANT )
Q_PROPERTY( double radius6 READ number6 CONSTANT )
Q_PROPERTY( double radius8 READ number8 CONSTANT )
Q_PROPERTY( double radius12 READ number12 CONSTANT )
Q_PROPERTY( double radius16 READ number16 CONSTANT )
Q_PROPERTY( double radius20 READ number20 CONSTANT )
Expand Down
13 changes: 13 additions & 0 deletions app/projectsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ QVariant ProjectsModel::data( const QModelIndex &index, int role ) const
CoreUtils::log( "Project error", "Found project that is not downloaded nor remote" );
return QVariant();
}
case ProjectIsActiveProject:
{
return QVariant( project.id() == mActiveProjectId );
}
default:
{
if ( !project.isMergin() ) return QVariant();
Expand Down Expand Up @@ -160,6 +164,7 @@ QHash<int, QByteArray> ProjectsModel::roleNames() const
roles[Roles::ProjectSyncPending] = QStringLiteral( "ProjectSyncPending" ).toLatin1();
roles[Roles::ProjectSyncProgress] = QStringLiteral( "ProjectSyncProgress" ).toLatin1();
roles[Roles::ProjectRemoteError] = QStringLiteral( "ProjectRemoteError" ).toLatin1();
roles[Roles::ProjectIsActiveProject] = QStringLiteral( "ProjectIsActiveProject" ).toLatin1();
return roles;
}

Expand Down Expand Up @@ -708,3 +713,11 @@ void ProjectsModel::setSyncManager( SynchronizationManager *newSyncManager )
mSyncManager = newSyncManager;
emit syncManagerChanged( mSyncManager );
}

QString ProjectsModel::activeProjectId() const { return mActiveProjectId; }

void ProjectsModel::setActiveProjectId( const QString &projectId )
{
mActiveProjectId = projectId;
emit activeProjectIdChanged( mActiveProjectId );
}
Loading

0 comments on commit adf1b8c

Please sign in to comment.