mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-12-06 10:34:13 +00:00
Compare commits
19
Commits
tauri
..
eee76f05d4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eee76f05d4 | ||
|
|
a67b982b1c | ||
|
|
c0afd1fea9 | ||
|
|
c0e6e3d2eb | ||
|
|
9bd38cd5f8 | ||
|
|
a163e1b897 | ||
|
|
33abec525a | ||
|
|
77c542d9aa | ||
|
|
17b5c1d567 | ||
|
|
2048076fe6 | ||
|
|
d7ff7d645b | ||
|
|
262b590bd4 | ||
|
|
14bf9cddd2 | ||
|
|
b9566160e5 | ||
|
|
0cc9d6f664 | ||
|
|
1942e0b9e1 | ||
|
|
70a24f53b3 | ||
|
|
001246a49e | ||
|
|
8fe7d8d64d |
No files matched your search
@@ -1,67 +0,0 @@
|
||||
name: Deploy to Cloudflare Pages
|
||||
on:
|
||||
push:
|
||||
branches: 'dev'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: cloudflare-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
cache-dependency-path: website/package-lock.json
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: wasm32-unknown-unknown
|
||||
|
||||
- name: Install wasm-pack
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Test gpx-rs
|
||||
run: cargo test
|
||||
|
||||
- name: Build wasm
|
||||
run: wasm-pack build --target bundler
|
||||
working-directory: wasm
|
||||
|
||||
- name: Install dependencies for website
|
||||
run: npm install --prefix website
|
||||
|
||||
- name: Test website
|
||||
run: npm test --prefix website
|
||||
|
||||
- name: Create env file
|
||||
run: echo PUBLIC_MAPTILER_KEY=${{ secrets.PUBLIC_MAPTILER_KEY }} >> website/.env
|
||||
|
||||
- name: Build website
|
||||
env:
|
||||
BASE_PATH: ''
|
||||
run: npm run build --prefix website
|
||||
|
||||
- name: Deploy to Cloudflare Pages
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
command: pages deploy website/build --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME || 'gpxstudio' }} --branch=${{ github.ref_name }}
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,11 +1,21 @@
|
||||
name: Deploy to GitHub Pages
|
||||
name: Deploy to Cloudflare Pages
|
||||
on:
|
||||
push:
|
||||
branches: 'main'
|
||||
branches: ['main', 'dev']
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: cloudflare-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_site:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
@@ -41,35 +51,17 @@ jobs:
|
||||
run: npm test --prefix website
|
||||
|
||||
- name: Create env file
|
||||
run: |
|
||||
touch website/.env
|
||||
echo PUBLIC_MAPTILER_KEY=${{ secrets.PUBLIC_MAPTILER_KEY }} >> website/.env
|
||||
cat website/.env
|
||||
run: echo PUBLIC_MAPTILER_KEY=${{ secrets.PUBLIC_MAPTILER_KEY }} >> website/.env
|
||||
|
||||
- name: Build website
|
||||
env:
|
||||
BASE_PATH: ''
|
||||
run: |
|
||||
npm run build --prefix website
|
||||
run: npm run build --prefix website
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
- name: Deploy to Cloudflare Pages
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
path: 'website/build/'
|
||||
|
||||
deploy:
|
||||
needs: build_site
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
steps:
|
||||
- name: Deploy
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
command: pages deploy website/build --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME || 'gpxstudio' }} --branch=${{ github.ref_name }} --commit-dirty=true
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,214 @@
|
||||
name: Desktop release
|
||||
# run by hand: from `main` for a release, from `dev` for a pre-release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: desktop-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
# the release stays a draft until every platform is built and tested
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
draft_tag: ${{ steps.version.outputs.draft_tag }}
|
||||
release_id: ${{ steps.draft.outputs.release_id }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Choose version
|
||||
id: version
|
||||
run: |
|
||||
base=$(jq -r .version tauri/tauri.conf.json)
|
||||
if [[ ! "$base" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "::error::The version in tauri.conf.json should be x.y.z, not $base"
|
||||
exit 1
|
||||
fi
|
||||
case "$GITHUB_REF_NAME" in
|
||||
main)
|
||||
version=$base
|
||||
draft_tag=desktop-v$base
|
||||
if git ls-remote --exit-code --tags origin "refs/tags/$draft_tag"; then
|
||||
echo "::error::$draft_tag is already released: bump the version in tauri.conf.json"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$(jq -r '.plugins.updater.pubkey' tauri/tauri.conf.json)" ]; then
|
||||
echo "::error::The public key of the updater is missing from tauri.conf.json"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
dev)
|
||||
version=$base-beta.$GITHUB_RUN_NUMBER
|
||||
draft_tag=desktop-beta-$GITHUB_RUN_NUMBER
|
||||
;;
|
||||
*)
|
||||
echo "::error::Desktop builds are made from main or dev, not $GITHUB_REF_NAME"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
echo "draft_tag=$draft_tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create draft release
|
||||
id: draft
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
DRAFT_TAG: ${{ steps.version.outputs.draft_tag }}
|
||||
run: |
|
||||
# what a previous attempt left: this tag is not released, so it can only be a draft
|
||||
gh release delete "$DRAFT_TAG" --yes || true
|
||||
if [ "$GITHUB_REF_NAME" = main ]; then
|
||||
gh release create "$DRAFT_TAG" --draft --target "$GITHUB_SHA" \
|
||||
--title "Desktop $VERSION" --generate-notes
|
||||
else
|
||||
gh release create "$DRAFT_TAG" --draft --prerelease --target "$GITHUB_SHA" \
|
||||
--title "Desktop beta $VERSION" \
|
||||
--notes "Beta of the desktop app, built from $GITHUB_SHA on the dev branch. The builds are not signed yet: macOS and Windows will warn before opening them."
|
||||
fi
|
||||
echo "release_id=$(gh release view "$DRAFT_TAG" --json databaseId --jq .databaseId)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
needs: prepare
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- platform: macos-latest
|
||||
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin,wasm32-unknown-unknown
|
||||
args: --target universal-apple-darwin
|
||||
# the oldest supported Ubuntu, so that the AppImage runs on older systems too
|
||||
- platform: ubuntu-22.04
|
||||
rust_targets: wasm32-unknown-unknown
|
||||
args: ''
|
||||
- platform: windows-latest
|
||||
rust_targets: wasm32-unknown-unknown
|
||||
args: ''
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
cache-dependency-path: website/package-lock.json
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.rust_targets }}
|
||||
|
||||
- name: Cache Rust build
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Install wasm-pack
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
# the desktop app does not use it, but the website depends on its package
|
||||
- name: Build wasm
|
||||
run: wasm-pack build --target bundler
|
||||
working-directory: wasm
|
||||
|
||||
- name: Install dependencies for website
|
||||
run: npm install --prefix website
|
||||
|
||||
# the key would be readable in the app: it is left empty, so only the MapTiler layer fails
|
||||
- name: Create env file
|
||||
run: echo "PUBLIC_MAPTILER_KEY=" >> website/.env
|
||||
|
||||
# only the releases update themselves: they need the updater files, and the signing key
|
||||
- name: Set version and updater files
|
||||
shell: bash
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
UPDATER: ${{ github.ref_name == 'main' }}
|
||||
run: |
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const path = 'tauri/tauri.conf.json';
|
||||
const config = JSON.parse(fs.readFileSync(path));
|
||||
config.version = process.env.VERSION;
|
||||
config.bundle.createUpdaterArtifacts = process.env.UPDATER === 'true';
|
||||
fs.writeFileSync(path, JSON.stringify(config, null, 4));
|
||||
"
|
||||
|
||||
- name: Build app and upload it to the draft
|
||||
uses: tauri-apps/tauri-action@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ github.ref_name == 'main' && secrets.TAURI_SIGNING_PRIVATE_KEY || '' }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ github.ref_name == 'main' && secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD || '' }}
|
||||
with:
|
||||
projectPath: tauri
|
||||
tauriScript: npx --yes @tauri-apps/cli@2
|
||||
args: ${{ matrix.args }}
|
||||
releaseId: ${{ needs.prepare.outputs.release_id }}
|
||||
# given with the id for the addresses in `latest.json`
|
||||
tagName: ${{ needs.prepare.outputs.draft_tag }}
|
||||
uploadUpdaterJson: ${{ github.ref_name == 'main' }}
|
||||
|
||||
# after the build, which gives the app the website it embeds
|
||||
- name: Test engine and app
|
||||
run: cargo test -p gpx-engine -p gpx-studio-desktop
|
||||
|
||||
# `releases/latest`, which the updater reads, only changes here
|
||||
publish:
|
||||
needs: [prepare, build]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
DRAFT_TAG: ${{ needs.prepare.outputs.draft_tag }}
|
||||
|
||||
steps:
|
||||
# the builds of the platforms add themselves to it in parallel, and could overwrite each other
|
||||
- name: Check updater file
|
||||
if: github.ref_name == 'main'
|
||||
run: |
|
||||
gh release download "$DRAFT_TAG" --pattern latest.json
|
||||
for platform in darwin-aarch64 darwin-x86_64 linux-x86_64 windows-x86_64; do
|
||||
if ! jq -e --arg platform "$platform" '.platforms[$platform].signature | length > 0' latest.json; then
|
||||
echo "::error::latest.json has no signed update for $platform"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Publish release
|
||||
if: github.ref_name == 'main'
|
||||
run: gh release edit "$DRAFT_TAG" --draft=false --latest
|
||||
|
||||
- name: Replace beta release
|
||||
if: github.ref_name == 'dev'
|
||||
run: |
|
||||
gh release delete desktop-beta --cleanup-tag --yes || true
|
||||
gh release edit "$DRAFT_TAG" --tag desktop-beta --draft=false --prerelease --latest=false
|
||||
Generated
+516
-9
@@ -475,6 +475,12 @@ version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
||||
|
||||
[[package]]
|
||||
name = "cfg_aliases"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.45"
|
||||
@@ -537,6 +543,16 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "core-foundation"
|
||||
version = "0.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
|
||||
dependencies = [
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "core-foundation"
|
||||
version = "0.10.1"
|
||||
@@ -560,7 +576,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"core-foundation",
|
||||
"core-foundation 0.10.1",
|
||||
"core-graphics-types",
|
||||
"foreign-types",
|
||||
"libc",
|
||||
@@ -573,7 +589,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"core-foundation",
|
||||
"core-foundation 0.10.1",
|
||||
"libc",
|
||||
]
|
||||
|
||||
@@ -1020,6 +1036,16 @@ dependencies = [
|
||||
"rustc_version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "filetime"
|
||||
version = "0.2.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "find-msvc-tools"
|
||||
version = "0.1.12"
|
||||
@@ -1287,6 +1313,17 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"wasi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.3.4"
|
||||
@@ -1306,8 +1343,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"r-efi 6.0.0",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1431,7 +1470,9 @@ dependencies = [
|
||||
"tauri-build",
|
||||
"tauri-plugin-dialog",
|
||||
"tauri-plugin-opener",
|
||||
"tauri-plugin-process",
|
||||
"tauri-plugin-single-instance",
|
||||
"tauri-plugin-updater",
|
||||
"trash",
|
||||
"uuid",
|
||||
]
|
||||
@@ -1631,6 +1672,21 @@ dependencies = [
|
||||
"want",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-rustls"
|
||||
version = "0.27.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53"
|
||||
dependencies = [
|
||||
"http",
|
||||
"hyper",
|
||||
"hyper-util",
|
||||
"rustls",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-util"
|
||||
version = "0.1.21"
|
||||
@@ -1650,9 +1706,11 @@ dependencies = [
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"socket2",
|
||||
"system-configuration",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
"windows-registry",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1990,6 +2048,36 @@ dependencies = [
|
||||
"windows-sys 0.45.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni"
|
||||
version = "0.22.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"combine",
|
||||
"jni-macros",
|
||||
"jni-sys 0.4.1",
|
||||
"log",
|
||||
"simd_cesu8",
|
||||
"thiserror 2.0.21",
|
||||
"walkdir",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni-macros"
|
||||
version = "0.22.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustc_version",
|
||||
"simd_cesu8",
|
||||
"syn 2.0.118",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni-sys"
|
||||
version = "0.3.1"
|
||||
@@ -2214,6 +2302,12 @@ dependencies = [
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "minisign-verify"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "871285dc19d8d0ebe0eef3d0e99a205f2a71363b122632cbbfa4a6c370a960ce"
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.8.9"
|
||||
@@ -2303,6 +2397,18 @@ version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.31.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"cfg-if",
|
||||
"cfg_aliases",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "notify"
|
||||
version = "8.2.0"
|
||||
@@ -2529,6 +2635,18 @@ dependencies = [
|
||||
"objc2-core-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-osa-kit"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-quartz-core"
|
||||
version = "0.3.2"
|
||||
@@ -2609,6 +2727,12 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl-probe"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1"
|
||||
|
||||
[[package]]
|
||||
name = "option-ext"
|
||||
version = "0.2.0"
|
||||
@@ -2625,6 +2749,20 @@ dependencies = [
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "osakit"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
"objc2-osa-kit",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pango"
|
||||
version = "0.18.3"
|
||||
@@ -3049,15 +3187,20 @@ dependencies = [
|
||||
"http-body",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-rustls",
|
||||
"hyper-util",
|
||||
"js-sys",
|
||||
"log",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"rustls-platform-verifier",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sync_wrapper",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tokio-util",
|
||||
"tower",
|
||||
"tower-http",
|
||||
@@ -3093,6 +3236,20 @@ dependencies = [
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ring"
|
||||
version = "0.17.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"getrandom 0.2.17",
|
||||
"libc",
|
||||
"untrusted",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "2.1.3"
|
||||
@@ -3121,6 +3278,79 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-native-certs"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4"
|
||||
dependencies = [
|
||||
"openssl-probe",
|
||||
"rustls-pki-types",
|
||||
"schannel",
|
||||
"security-framework",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pki-types"
|
||||
version = "1.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
|
||||
dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-platform-verifier"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98"
|
||||
dependencies = [
|
||||
"core-foundation 0.10.1",
|
||||
"core-foundation-sys",
|
||||
"jni 0.22.4",
|
||||
"log",
|
||||
"once_cell",
|
||||
"rustls",
|
||||
"rustls-native-certs",
|
||||
"rustls-platform-verifier-android",
|
||||
"rustls-webpki",
|
||||
"security-framework",
|
||||
"security-framework-sys",
|
||||
"webpki-root-certs",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-platform-verifier-android"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f"
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.103.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.23"
|
||||
@@ -3136,6 +3366,15 @@ dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
version = "0.1.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "0.8.22"
|
||||
@@ -3193,6 +3432,29 @@ version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "3.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"core-foundation 0.10.1",
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
"security-framework-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework-sys"
|
||||
version = "2.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3"
|
||||
dependencies = [
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "selectors"
|
||||
version = "0.38.0"
|
||||
@@ -3425,6 +3687,22 @@ version = "0.3.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
|
||||
|
||||
[[package]]
|
||||
name = "simd_cesu8"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520"
|
||||
dependencies = [
|
||||
"rustc_version",
|
||||
"simdutf8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simdutf8"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "1.0.4"
|
||||
@@ -3546,6 +3824,12 @@ version = "0.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
||||
|
||||
[[package]]
|
||||
name = "swift-rs"
|
||||
version = "1.0.9"
|
||||
@@ -3609,6 +3893,27 @@ dependencies = [
|
||||
"syn 3.0.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"core-foundation 0.9.4",
|
||||
"system-configuration-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration-sys"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
|
||||
dependencies = [
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-deps"
|
||||
version = "6.2.2"
|
||||
@@ -3630,7 +3935,7 @@ checksum = "f37f381f4e048e6cdf038b5705f8cf14ad108279d46eb968140a7b291aba9400"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"block2",
|
||||
"core-foundation",
|
||||
"core-foundation 0.10.1",
|
||||
"core-graphics",
|
||||
"crossbeam-channel",
|
||||
"dbus",
|
||||
@@ -3640,7 +3945,7 @@ dependencies = [
|
||||
"gdkwayland-sys",
|
||||
"gdkx11-sys",
|
||||
"gtk",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"libc",
|
||||
"log",
|
||||
"ndk",
|
||||
@@ -3673,6 +3978,17 @@ dependencies = [
|
||||
"syn 2.0.118",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tar"
|
||||
version = "0.4.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840"
|
||||
dependencies = [
|
||||
"filetime",
|
||||
"libc",
|
||||
"xattr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "target-lexicon"
|
||||
version = "0.12.16"
|
||||
@@ -3696,7 +4012,7 @@ dependencies = [
|
||||
"gtk",
|
||||
"heck 0.5.0",
|
||||
"http",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"libc",
|
||||
"log",
|
||||
"mime",
|
||||
@@ -3872,6 +4188,16 @@ dependencies = [
|
||||
"zbus",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-process"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74ae3d8549ae564c0397377373e262f340908eb23a5b9fbe03f2a00007dc0038"
|
||||
dependencies = [
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-single-instance"
|
||||
version = "2.5.3"
|
||||
@@ -3888,6 +4214,40 @@ dependencies = [
|
||||
"zbus",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-updater"
|
||||
version = "2.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"dirs",
|
||||
"flate2",
|
||||
"futures-util",
|
||||
"http",
|
||||
"infer",
|
||||
"libc",
|
||||
"log",
|
||||
"minisign-verify",
|
||||
"osakit",
|
||||
"percent-encoding",
|
||||
"reqwest",
|
||||
"rustls",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tar",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"tempfile",
|
||||
"thiserror 2.0.21",
|
||||
"time",
|
||||
"tokio",
|
||||
"url",
|
||||
"windows-sys 0.61.2",
|
||||
"zip",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.12.1"
|
||||
@@ -3898,7 +4258,7 @@ dependencies = [
|
||||
"dpi",
|
||||
"gtk",
|
||||
"http",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"objc2",
|
||||
"objc2-ui-kit",
|
||||
"objc2-web-kit",
|
||||
@@ -3921,7 +4281,7 @@ checksum = "7f9e7e0c9f80a5130773cfabb6df4dc924518fb1b2c923726966804634b57d22"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"log",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
@@ -4110,6 +4470,16 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.26.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db"
|
||||
dependencies = [
|
||||
"rustls",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.7.20"
|
||||
@@ -4341,6 +4711,12 @@ version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||
|
||||
[[package]]
|
||||
name = "typed-path"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e"
|
||||
|
||||
[[package]]
|
||||
name = "typeid"
|
||||
version = "1.0.3"
|
||||
@@ -4376,6 +4752,12 @@ version = "1.13.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
|
||||
|
||||
[[package]]
|
||||
name = "untrusted"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
||||
|
||||
[[package]]
|
||||
name = "url"
|
||||
version = "2.5.8"
|
||||
@@ -4675,6 +5057,15 @@ dependencies = [
|
||||
"system-deps",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-root-certs"
|
||||
version = "1.0.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e49d0e65abc00c142e8f9428da991da9f1a250c39be97459901eb12b9b49f62a"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webview2-com"
|
||||
version = "0.39.1"
|
||||
@@ -4839,6 +5230,17 @@ dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-registry"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"windows-result",
|
||||
"windows-strings",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-result"
|
||||
version = "0.4.1"
|
||||
@@ -4866,6 +5268,15 @@ dependencies = [
|
||||
"windows-targets 0.42.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||
dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.60.2"
|
||||
@@ -4899,6 +5310,22 @@ dependencies = [
|
||||
"windows_x86_64_msvc 0.42.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 0.52.6",
|
||||
"windows_i686_gnu 0.52.6",
|
||||
"windows_i686_gnullvm 0.52.6",
|
||||
"windows_i686_msvc 0.52.6",
|
||||
"windows_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 0.52.6",
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.53.5"
|
||||
@@ -4909,7 +5336,7 @@ dependencies = [
|
||||
"windows_aarch64_gnullvm 0.53.1",
|
||||
"windows_aarch64_msvc 0.53.1",
|
||||
"windows_i686_gnu 0.53.1",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_gnullvm 0.53.1",
|
||||
"windows_i686_msvc 0.53.1",
|
||||
"windows_x86_64_gnu 0.53.1",
|
||||
"windows_x86_64_gnullvm 0.53.1",
|
||||
@@ -4940,6 +5367,12 @@ version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.53.1"
|
||||
@@ -4952,6 +5385,12 @@ version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.53.1"
|
||||
@@ -4964,12 +5403,24 @@ version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.53.1"
|
||||
@@ -4982,6 +5433,12 @@ version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.53.1"
|
||||
@@ -4994,6 +5451,12 @@ version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.53.1"
|
||||
@@ -5006,6 +5469,12 @@ version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.53.1"
|
||||
@@ -5018,6 +5487,12 @@ version = "0.42.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.53.1"
|
||||
@@ -5082,7 +5557,7 @@ dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
"javascriptcore-rs",
|
||||
"jni",
|
||||
"jni 0.21.1",
|
||||
"libc",
|
||||
"ndk",
|
||||
"objc2",
|
||||
@@ -5129,6 +5604,16 @@ dependencies = [
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xattr"
|
||||
version = "1.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rustix",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yoke"
|
||||
version = "0.8.3"
|
||||
@@ -5243,6 +5728,12 @@ dependencies = [
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize"
|
||||
version = "1.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"
|
||||
|
||||
[[package]]
|
||||
name = "zerotrie"
|
||||
version = "0.2.5"
|
||||
@@ -5276,6 +5767,22 @@ dependencies = [
|
||||
"syn 3.0.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "9.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eaeb7f16d2605b49aef586996ded29e65642fab7259a3077e537351df6d80426"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"getrandom 0.4.3",
|
||||
"indexmap 2.14.2",
|
||||
"libc",
|
||||
"memchr",
|
||||
"nix",
|
||||
"typed-path",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zlib-rs"
|
||||
version = "0.6.8"
|
||||
|
||||
@@ -44,14 +44,24 @@ where
|
||||
let last = trkseg.last_index().unwrap();
|
||||
|
||||
let mut kept = vec![(first, None)];
|
||||
ramer_douglas_peucker_helper(trkseg, first, last, measure, epsilon, &mut kept);
|
||||
ramer_douglas_peucker_ranges(trkseg, first, last, measure, epsilon, &mut kept);
|
||||
kept.push((last, None));
|
||||
kept
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn ramer_douglas_peucker_helper<M>(
|
||||
/// What is left to do for the points between two ends, in the order of the points.
|
||||
enum Step {
|
||||
/// Looks for the point to keep between these two.
|
||||
Range(TrackSegmentIndex, TrackSegmentIndex),
|
||||
/// Keeps a point, selected at this distance.
|
||||
Keep(TrackSegmentIndex, f64),
|
||||
}
|
||||
|
||||
/// Adds the points to keep between `start` and `end` to `kept`, in order. It does not recurse: a
|
||||
/// track can make it go as deep as it has points, which would overflow the stack.
|
||||
fn ramer_douglas_peucker_ranges<M>(
|
||||
trkseg: &TrackSegment,
|
||||
start: TrackSegmentIndex,
|
||||
end: TrackSegmentIndex,
|
||||
@@ -61,6 +71,16 @@ fn ramer_douglas_peucker_helper<M>(
|
||||
) where
|
||||
M: Fn(TrackSegmentIndex, TrackSegmentIndex, TrackSegmentIndex) -> f64,
|
||||
{
|
||||
let mut steps = vec![Step::Range(start, end)];
|
||||
while let Some(step) = steps.pop() {
|
||||
let (start, end) = match step {
|
||||
Step::Keep(idx, dist) => {
|
||||
kept.push((idx, Some(dist)));
|
||||
continue;
|
||||
}
|
||||
Step::Range(start, end) => (start, end),
|
||||
};
|
||||
|
||||
let mut max_idx = None;
|
||||
let mut max_dist = 0.0;
|
||||
|
||||
@@ -80,9 +100,11 @@ fn ramer_douglas_peucker_helper<M>(
|
||||
}
|
||||
|
||||
if let Some(idx) = max_idx.filter(|_| max_dist > epsilon) {
|
||||
ramer_douglas_peucker_helper(trkseg, start, idx, measure, epsilon, kept);
|
||||
kept.push((idx, Some(max_dist)));
|
||||
ramer_douglas_peucker_helper(trkseg, idx, end, measure, epsilon, kept);
|
||||
// the last one pushed is done first
|
||||
steps.push(Step::Range(idx, end));
|
||||
steps.push(Step::Keep(idx, max_dist));
|
||||
steps.push(Step::Range(start, idx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,6 +217,16 @@ mod tests {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_goes_as_deep_as_the_segment_is_long_in_order() {
|
||||
let n = 12_000;
|
||||
let trkseg = segment(&vec![0.0; n]);
|
||||
// the point before the end is always the farthest one, so each range only loses one point
|
||||
let kept = ramer_douglas_peucker_by(&trkseg, &|_, _, idx| idx.flat as f64 + 1.0, 0.5);
|
||||
let kept: Vec<usize> = kept.iter().map(|(idx, _)| idx.flat).collect();
|
||||
assert_eq!(kept, (0..n).collect::<Vec<_>>());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_and_single_point() {
|
||||
assert!(simplify(&[], 1.0).is_empty());
|
||||
|
||||
@@ -6,7 +6,7 @@ use chrono::DateTime;
|
||||
use quick_xml::Error;
|
||||
use quick_xml::escape::resolve_predefined_entity;
|
||||
use quick_xml::events::Event;
|
||||
use quick_xml::events::attributes::Attributes;
|
||||
use quick_xml::events::attributes::{Attribute, Attributes};
|
||||
use quick_xml::reader::Reader;
|
||||
|
||||
enum GPXElement {
|
||||
@@ -260,6 +260,13 @@ fn apply_text(
|
||||
}
|
||||
}
|
||||
|
||||
/// The text of an attribute, without its escaping (`&` is `&`), which is written back when the
|
||||
/// file is. As it is in the file if it cannot be read.
|
||||
fn attribute_text(attr: &Attribute<'_>) -> String {
|
||||
attr.unescape_value()
|
||||
.map_or_else(|_| attr.value.to_string(), |text| text.into_owned())
|
||||
}
|
||||
|
||||
/// The email of the author, given as the `id` and `domain` attributes of the element.
|
||||
fn set_email(stack: &mut [GPXElement], attributes: Attributes<'_>) {
|
||||
let Some(GPXElement::Author(author)) = stack.last_mut() else {
|
||||
@@ -268,8 +275,8 @@ fn set_email(stack: &mut [GPXElement], attributes: Attributes<'_>) {
|
||||
let (mut id, mut domain) = (None, None);
|
||||
for attr in attributes.flatten() {
|
||||
match attr.key.as_ref() {
|
||||
"id" => id = Some(attr.value.to_string()),
|
||||
"domain" => domain = Some(attr.value.to_string()),
|
||||
"id" => id = Some(attribute_text(&attr)),
|
||||
"domain" => domain = Some(attribute_text(&attr)),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -283,7 +290,7 @@ fn parse_link(attributes: Attributes<'_>) -> Link {
|
||||
let mut link = Link::default();
|
||||
for attr in attributes.flatten() {
|
||||
if attr.key.as_ref() == "href" {
|
||||
link.href = attr.value.to_string();
|
||||
link.href = attribute_text(&attr);
|
||||
}
|
||||
}
|
||||
link
|
||||
@@ -626,6 +633,14 @@ mod tests {
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_link_href_is_unescaped_and_written_back_once() {
|
||||
let data =
|
||||
r#"<gpx><metadata><link href="https://a.example/?x=1&y=2"/></metadata></gpx>"#;
|
||||
let gpx = parse(data.as_bytes(), &mut Default::default()).unwrap();
|
||||
assert_eq!(gpx.info.links[0].href, "https://a.example/?x=1&y=2");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_entities_and_cdata_in_text() {
|
||||
let data = r#"<gpx><metadata><name>Tom & Jerry <3 éA "x" 'y'</name>
|
||||
|
||||
@@ -7,6 +7,15 @@ edition = "2024"
|
||||
[lib]
|
||||
name = "gpx_studio_desktop_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
# the tests are in `tests/app`: on Windows, a test binary of the library or of the app could not
|
||||
# start without the manifest, which `build.rs` only gives to the binaries of `tests`
|
||||
test = false
|
||||
doctest = false
|
||||
|
||||
[[bin]]
|
||||
name = "gpx-studio-desktop"
|
||||
path = "src/main.rs"
|
||||
test = false
|
||||
|
||||
[dev-dependencies]
|
||||
tauri = { version = "2", features = ["test"] }
|
||||
@@ -28,3 +37,7 @@ tauri-plugin-single-instance = "2.5.3"
|
||||
tauri-plugin-opener = "2"
|
||||
trash = "5"
|
||||
|
||||
[target.'cfg(any(target_os = "macos", windows, target_os = "linux"))'.dependencies]
|
||||
tauri-plugin-process = "2.4.0"
|
||||
tauri-plugin-updater = "2.14.1"
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
fn main() {
|
||||
// On Windows, the dialogs need Common Controls v6, which a binary only gets with a manifest that
|
||||
// asks for it: tauri-build gives one to the app, but not to the test binaries, which would stop
|
||||
// with STATUS_ENTRYPOINT_NOT_FOUND before running any test. This gives them the same manifest
|
||||
// (`-tests` only reaches the binaries of `tests`, hence the tests are there).
|
||||
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows")
|
||||
&& std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc")
|
||||
{
|
||||
let manifest = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("tests")
|
||||
.join("windows-test.manifest");
|
||||
println!("cargo:rerun-if-changed={}", manifest.display());
|
||||
println!("cargo:rustc-link-arg-tests=/MANIFEST:EMBED");
|
||||
println!(
|
||||
"cargo:rustc-link-arg-tests=/MANIFESTINPUT:{}",
|
||||
manifest.display()
|
||||
);
|
||||
}
|
||||
tauri_build::build()
|
||||
}
|
||||
@@ -3,5 +3,5 @@
|
||||
"identifier": "default",
|
||||
"description": "Permissions for the main window",
|
||||
"windows": ["main"],
|
||||
"permissions": ["core:default"]
|
||||
"permissions": ["core:default", "updater:default", "process:allow-restart"]
|
||||
}
|
||||
+12
-9
@@ -3,20 +3,20 @@
|
||||
|
||||
mod bytes;
|
||||
mod commands;
|
||||
mod state;
|
||||
mod store;
|
||||
mod workspace;
|
||||
pub mod state;
|
||||
pub mod store;
|
||||
pub mod workspace;
|
||||
|
||||
use commands::*;
|
||||
use tauri::{Emitter, Manager};
|
||||
|
||||
/// The engine of the app: each file has its own history, so that undoing only concerns the
|
||||
/// selected files, and opening or closing a file is not something to undo.
|
||||
pub(crate) type Engine = gpx_engine::Engine<gpx_engine::PerFileHistory>;
|
||||
pub type Engine = gpx_engine::Engine<gpx_engine::PerFileHistory>;
|
||||
|
||||
/// The GPX files among what the system gave to the app (the arguments of the command line, when a
|
||||
/// file is opened with it).
|
||||
fn gpx_paths(arguments: impl IntoIterator<Item = String>) -> Vec<std::path::PathBuf> {
|
||||
pub fn gpx_paths(arguments: impl IntoIterator<Item = String>) -> Vec<std::path::PathBuf> {
|
||||
arguments
|
||||
.into_iter()
|
||||
.map(std::path::PathBuf::from)
|
||||
@@ -55,6 +55,12 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.setup(|app| {
|
||||
#[cfg(desktop)]
|
||||
{
|
||||
app.handle()
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())?;
|
||||
app.handle().plugin(tauri_plugin_process::init())?;
|
||||
}
|
||||
let handle = app.handle().clone();
|
||||
let emit: state::Emit = std::sync::Arc::new(move |event, payload| {
|
||||
let _ = handle.emit(event, payload);
|
||||
@@ -108,7 +114,7 @@ fn menu<R: tauri::Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<tauri::me
|
||||
}
|
||||
|
||||
/// Gives the builder the commands that reach the engine (which it has to be given as `AppState`).
|
||||
fn register_commands<R: tauri::Runtime>(builder: tauri::Builder<R>) -> tauri::Builder<R> {
|
||||
pub fn register_commands<R: tauri::Runtime>(builder: tauri::Builder<R>) -> tauri::Builder<R> {
|
||||
builder.invoke_handler(tauri::generate_handler![
|
||||
// selection
|
||||
selection::select,
|
||||
@@ -234,6 +240,3 @@ fn register_commands<R: tauri::Runtime>(builder: tauri::Builder<R>) -> tauri::Bu
|
||||
system::reveal_path,
|
||||
])
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -280,13 +280,6 @@ impl AppState {
|
||||
})
|
||||
}
|
||||
|
||||
/// An engine that keeps its data in a directory of its own, and has nobody to tell.
|
||||
#[cfg(test)]
|
||||
pub fn temporary() -> Self {
|
||||
let directory = std::env::temp_dir().join(format!("gpx-studio-{}", uuid::Uuid::new_v4()));
|
||||
Self::open(directory, Arc::new(|_, _| {})).expect("the storage can be opened")
|
||||
}
|
||||
|
||||
/// Opens files that the system gave to the app, see `Core::open_external`.
|
||||
pub fn open_external(&self, paths: Vec<PathBuf>) {
|
||||
self.core(move |core| core.open_external(&paths));
|
||||
|
||||
@@ -217,69 +217,3 @@ impl Storage for FileStorage {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::Engine;
|
||||
use gpx_engine::{Action, Command, Load, LoadFiles, Persister};
|
||||
|
||||
use super::*;
|
||||
|
||||
fn directory() -> PathBuf {
|
||||
std::env::temp_dir().join(format!("gpx-studio-store-{}", Uuid::new_v4()))
|
||||
}
|
||||
|
||||
fn engine_with_a_file() -> Engine {
|
||||
let mut engine = Engine::default();
|
||||
let data = std::fs::read("../gpx-rs/data/simple.gpx").unwrap();
|
||||
engine
|
||||
.execute(Action::Edit(Command::LoadFiles(LoadFiles {
|
||||
files: vec![Load {
|
||||
data: &data,
|
||||
name: "simple",
|
||||
}],
|
||||
})))
|
||||
.unwrap();
|
||||
engine
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keeps_the_files_and_the_settings_between_sessions() {
|
||||
let root = directory();
|
||||
let engine = engine_with_a_file();
|
||||
let order = engine.order().to_vec();
|
||||
|
||||
let storage = FileStorage::open(&root).unwrap();
|
||||
pollster::block_on(Persister::default().save(&storage, engine.snapshot())).unwrap();
|
||||
pollster::block_on(storage.put_setting("units", "\"metric\"")).unwrap();
|
||||
|
||||
// another session
|
||||
let storage = FileStorage::open(&root).unwrap();
|
||||
let restored = pollster::block_on(Persister::default().restore(&storage)).unwrap();
|
||||
let mut other = Engine::default();
|
||||
other.restore(restored);
|
||||
assert_eq!(other.order(), order);
|
||||
assert_eq!(
|
||||
other.file_statistics(&order[0]).unwrap().total_distance,
|
||||
engine.file_statistics(&order[0]).unwrap().total_distance
|
||||
);
|
||||
assert_eq!(storage.settings()["units"], "\"metric\"");
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn refuses_a_commit_that_is_not_based_on_the_head() {
|
||||
let root = directory();
|
||||
let storage = FileStorage::open(&root).unwrap();
|
||||
let batch = Batch {
|
||||
order: Some(vec![]),
|
||||
..Default::default()
|
||||
};
|
||||
assert_eq!(pollster::block_on(storage.commit(&batch)), Ok(Revision(1)));
|
||||
assert_eq!(
|
||||
pollster::block_on(storage.commit(&batch)),
|
||||
Err(CommitError::Stale { head: Revision(1) })
|
||||
);
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
}
|
||||
+2
-812
@@ -148,7 +148,7 @@ pub struct Entry {
|
||||
pub is_dir: bool,
|
||||
}
|
||||
|
||||
fn is_gpx(path: &Path) -> bool {
|
||||
pub fn is_gpx(path: &Path) -> bool {
|
||||
path.extension()
|
||||
.and_then(|extension| extension.to_str())
|
||||
.is_some_and(|extension| extension.eq_ignore_ascii_case("gpx"))
|
||||
@@ -156,7 +156,7 @@ fn is_gpx(path: &Path) -> bool {
|
||||
|
||||
/// Compares names the way people read them: the numbers in them by their value ("track 2" before
|
||||
/// "track 10"), the rest regardless of case.
|
||||
fn natural_cmp(a: &str, b: &str) -> Ordering {
|
||||
pub fn natural_cmp(a: &str, b: &str) -> Ordering {
|
||||
let (mut a, mut b) = (a.chars().peekable(), b.chars().peekable());
|
||||
loop {
|
||||
let order = match (a.peek().copied(), b.peek().copied()) {
|
||||
@@ -1040,813 +1040,3 @@ impl Workspace {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use gpx_engine::SelectMode;
|
||||
|
||||
use super::*;
|
||||
|
||||
fn gpx(name: &str) -> String {
|
||||
format!(
|
||||
r#"<?xml version="1.0"?><gpx version="1.1" creator="test" xmlns="http://www.topografix.com/GPX/1/1"><metadata><name>{name}</name></metadata><trk><name>{name}</name><trkseg><trkpt lat="50.0" lon="4.0"><ele>10</ele></trkpt><trkpt lat="50.1" lon="4.1"><ele>20</ele></trkpt></trkseg></trk></gpx>"#
|
||||
)
|
||||
}
|
||||
|
||||
/// The GPX files of a folder and of the folders in it.
|
||||
pub(super) fn gpx_files(folder: &Path) -> Vec<PathBuf> {
|
||||
let mut found = vec![];
|
||||
for entry in fs::read_dir(folder).unwrap().flatten() {
|
||||
let path = entry.path();
|
||||
if path.is_dir() {
|
||||
found.extend(gpx_files(&path));
|
||||
} else if is_gpx(&path) {
|
||||
found.push(path);
|
||||
}
|
||||
}
|
||||
found.sort();
|
||||
found
|
||||
}
|
||||
|
||||
struct Fixture {
|
||||
folder: PathBuf,
|
||||
engine: Engine,
|
||||
workspace: Workspace,
|
||||
}
|
||||
|
||||
impl Fixture {
|
||||
fn new() -> Self {
|
||||
let folder =
|
||||
canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&folder).unwrap();
|
||||
Self {
|
||||
folder,
|
||||
engine: Engine::default(),
|
||||
workspace: Workspace::default(),
|
||||
}
|
||||
}
|
||||
|
||||
fn write(&self, name: &str, title: &str) -> PathBuf {
|
||||
let path = self.folder.join(name);
|
||||
fs::write(&path, gpx(title)).unwrap();
|
||||
path
|
||||
}
|
||||
|
||||
/// Opens the folder, and all the files that are in it.
|
||||
fn open_folder(&mut self) {
|
||||
let folder = self.folder.clone();
|
||||
self.workspace.open_folder(&mut self.engine, &folder, false);
|
||||
let files = gpx_files(&folder);
|
||||
self.workspace.open_files(&mut self.engine, &files, false);
|
||||
}
|
||||
|
||||
fn reconcile(&mut self, changed: Option<&[PathBuf]>) -> Option<api::Outcome> {
|
||||
self.workspace.reconcile(&mut self.engine, changed)
|
||||
}
|
||||
|
||||
fn save(&mut self, ids: &[Uuid]) {
|
||||
self.workspace
|
||||
.save(&mut self.engine, ids, &BTreeMap::new(), None)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
fn ids(&self) -> Vec<Uuid> {
|
||||
self.engine.order().iter().map(|id| id.0).collect()
|
||||
}
|
||||
|
||||
fn id_named(&self, name: &str) -> Uuid {
|
||||
self.ids()
|
||||
.into_iter()
|
||||
.find(|id| self.name(*id) == name)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn name(&self, id: Uuid) -> String {
|
||||
self.engine
|
||||
.file_structure(&FileId(id))
|
||||
.unwrap()
|
||||
.name
|
||||
.clone()
|
||||
}
|
||||
|
||||
/// What the file holds: the name of its track (its own name is the one of the file).
|
||||
fn content(&self, id: Uuid) -> String {
|
||||
self.engine.file_structure(&FileId(id)).unwrap().tracks[0]
|
||||
.info
|
||||
.name
|
||||
.clone()
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn rename(&mut self, id: Uuid, name: &str) {
|
||||
api::select(&mut self.engine, &[id], SelectMode::Replace);
|
||||
assert!(!api::metadata(&mut self.engine, name, "").has_error());
|
||||
}
|
||||
|
||||
fn status(&self, id: Uuid) -> FileStatus {
|
||||
self.workspace
|
||||
.state(&self.engine)
|
||||
.files
|
||||
.remove(&id.to_string())
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Fixture {
|
||||
fn drop(&mut self) {
|
||||
let _ = fs::remove_dir_all(&self.folder);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_opened_file_is_clean_until_it_is_edited_and_clean_again_once_saved() {
|
||||
let mut fx = Fixture::new();
|
||||
let path = fx.write("a.gpx", "a");
|
||||
fx.workspace
|
||||
.open_files(&mut fx.engine, std::slice::from_ref(&path), true);
|
||||
let id = fx.ids()[0];
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert_eq!(fx.status(id).path.as_deref(), path.to_str());
|
||||
|
||||
fx.rename(id, "renamed");
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
// nothing is written before it is saved
|
||||
assert!(fs::read_to_string(&path).unwrap().contains(">a<"));
|
||||
|
||||
fx.save(&[id]);
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert!(fs::read_to_string(&path).unwrap().contains(">renamed<"));
|
||||
|
||||
// going back before the save is an edit again
|
||||
api::select(&mut fx.engine, &[id], SelectMode::Replace);
|
||||
api::undo(&mut fx.engine);
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
api::redo(&mut fx.engine);
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_that_is_not_on_the_disk_is_unsaved_until_it_is_given_a_place() {
|
||||
let mut fx = Fixture::new();
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
let id = fx.ids()[0];
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert_eq!(
|
||||
fx.workspace.unlinked(&fx.engine, &[id]),
|
||||
[(id, "fresh".to_string())]
|
||||
);
|
||||
// nowhere to put it without being told
|
||||
fx.save(&[id]);
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
|
||||
let path = fx.folder.join("fresh.gpx");
|
||||
let paths = BTreeMap::from([(id, path.clone())]);
|
||||
fx.workspace
|
||||
.save(&mut fx.engine, &[id], &paths, None)
|
||||
.unwrap();
|
||||
assert!(path.exists());
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert!(fx.workspace.unlinked(&fx.engine, &[id]).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn several_files_without_a_place_go_in_a_folder_with_names_that_are_free() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("fresh.gpx", "already there");
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
api::new_file(&mut fx.engine, "a/b: c", None, None, None, false);
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
let ids = fx.ids();
|
||||
let folder = fx.folder.clone();
|
||||
fx.workspace
|
||||
.save(&mut fx.engine, &ids, &BTreeMap::new(), Some(&folder))
|
||||
.unwrap();
|
||||
for name in ["fresh (2).gpx", "fresh (3).gpx", "a_b_ c.gpx"] {
|
||||
assert!(fx.folder.join(name).exists(), "{name}");
|
||||
}
|
||||
assert!(ids.iter().all(|id| !fx.workspace.is_dirty(&fx.engine, *id)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn what_this_app_writes_is_not_a_change_of_the_disk() {
|
||||
let mut fx = Fixture::new();
|
||||
let path = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
api::select(&mut fx.engine, &[id], SelectMode::Replace);
|
||||
assert!(!api::style(&mut fx.engine, Some("#ff0000"), None, None).has_error());
|
||||
fx.save(&[id]);
|
||||
assert!(fx.reconcile(Some(&[path])).is_none());
|
||||
assert!(!fx.status(id).replaced && !fx.status(id).dirty);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_folders_of_the_files_outside_the_open_folder_are_watched_too() {
|
||||
let mut fx = Fixture::new();
|
||||
let inside = fx.write("in.gpx", "in");
|
||||
let elsewhere = canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&elsewhere).unwrap();
|
||||
let (one, two) = (elsewhere.join("one.gpx"), elsewhere.join("two.gpx"));
|
||||
fs::write(&one, gpx("one")).unwrap();
|
||||
fs::write(&two, gpx("two")).unwrap();
|
||||
let folder = fx.folder.clone();
|
||||
|
||||
// no folder: only the folder of the files
|
||||
fx.workspace.open_files(&mut fx.engine, &[one, two], false);
|
||||
assert_eq!(fx.workspace.watched(), [(elsewhere.clone(), false)]);
|
||||
|
||||
// the open folder as a whole, and the file in it needs nothing more
|
||||
fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
fx.workspace.open_files(&mut fx.engine, &[inside], false);
|
||||
assert_eq!(
|
||||
fx.workspace.watched(),
|
||||
[(folder, true), (elsewhere.clone(), false)]
|
||||
);
|
||||
|
||||
// closing the files stops it
|
||||
let ids = fx.ids();
|
||||
fx.workspace.close_files(&mut fx.engine, &ids, true);
|
||||
assert_eq!(fx.workspace.watched(), [(fx.folder.clone(), true)]);
|
||||
fs::remove_dir_all(elsewhere).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opening_a_folder_does_not_open_its_files() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
let folder = fx.folder.clone();
|
||||
let outcome = fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
assert!(!outcome.changed);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert_eq!(fx.workspace.folder.as_deref(), Some(folder.as_path()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn folders_are_made_renamed_and_moved_and_the_open_files_follow() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
let root = fx.folder.clone();
|
||||
let path_of = |fx: &Fixture| PathBuf::from(fx.status(id).path.unwrap());
|
||||
|
||||
let first = fx.workspace.create_folder(&root, "New folder").unwrap();
|
||||
let second = fx.workspace.create_folder(&root, "New folder").unwrap();
|
||||
assert_eq!(first, root.join("New folder"));
|
||||
assert_eq!(second, root.join("New folder 2"));
|
||||
|
||||
fx.workspace.move_paths(&[a], &first).unwrap();
|
||||
assert_eq!(path_of(&fx), first.join("a.gpx"));
|
||||
assert!(first.join("a.gpx").exists() && !fx.status(id).dirty);
|
||||
|
||||
let trips = fx.workspace.rename_path(&first, "Trips").unwrap();
|
||||
assert_eq!(path_of(&fx), root.join("Trips/a.gpx"));
|
||||
// a folder does not go into itself, nor onto something else
|
||||
assert!(
|
||||
fx.workspace
|
||||
.move_paths(std::slice::from_ref(&trips), &trips)
|
||||
.is_err()
|
||||
);
|
||||
assert_eq!(
|
||||
fx.workspace.rename_path(&trips, "New folder 2"),
|
||||
Err(NAME_TAKEN.to_owned())
|
||||
);
|
||||
fx.workspace.move_paths(&[trips], &second).unwrap();
|
||||
assert_eq!(path_of(&fx), second.join("Trips/a.gpx"));
|
||||
|
||||
// a file keeps its extension
|
||||
let closed = fx.write("c.gpx", "c");
|
||||
assert_eq!(
|
||||
fx.workspace.rename_path(&closed, "d").unwrap(),
|
||||
root.join("d.gpx")
|
||||
);
|
||||
// the open folder and what is not in it are left alone
|
||||
assert!(fx.workspace.rename_path(&root, "x").is_err());
|
||||
let elsewhere = canonical(&std::env::temp_dir());
|
||||
assert!(fx.workspace.rename_path(&elsewhere, "x").is_err());
|
||||
assert!(fx.workspace.create_folder(&elsewhere, "x").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deleted_files_are_closed_unless_they_have_edits() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
let b = fx.write("b.gpx", "b");
|
||||
fx.open_folder();
|
||||
let (id_a, id_b) = (fx.id_named("a"), fx.id_named("b"));
|
||||
api::select(&mut fx.engine, &[id_b], SelectMode::Replace);
|
||||
assert!(!api::style(&mut fx.engine, Some("#ff0000"), None, None).has_error());
|
||||
|
||||
let outcome = fx
|
||||
.workspace
|
||||
.delete_paths(&mut fx.engine, &[a.clone(), b.clone()], |paths| {
|
||||
paths.iter().for_each(|path| fs::remove_file(path).unwrap());
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
assert!(outcome.changed);
|
||||
assert_eq!(fx.ids(), [id_b]);
|
||||
assert!(!fx.ids().contains(&id_a));
|
||||
let status = fx.status(id_b);
|
||||
assert!(status.dirty && status.missing);
|
||||
assert!(!a.exists() && !b.exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_tree_of_the_folder_shows_folders_first_and_only_gpx_files() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("b.gpx", "b");
|
||||
fx.write("A.GPX", "a");
|
||||
fx.write("b 10.gpx", "b 10");
|
||||
fx.write("b 2.gpx", "b 2");
|
||||
fx.write("notes.txt", "not a track");
|
||||
fx.write(".hidden.gpx", "hidden");
|
||||
fs::create_dir(fx.folder.join("zoo")).unwrap();
|
||||
fs::create_dir(fx.folder.join("Alps")).unwrap();
|
||||
fs::create_dir(fx.folder.join(".git")).unwrap();
|
||||
fx.write("zoo/c.gpx", "c");
|
||||
let folder = fx.folder.clone();
|
||||
fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
|
||||
let names = |entries: Vec<Entry>| -> Vec<(String, bool)> {
|
||||
entries.into_iter().map(|e| (e.name, e.is_dir)).collect()
|
||||
};
|
||||
assert_eq!(
|
||||
names(fx.workspace.list_folder(&folder).unwrap()),
|
||||
[
|
||||
("Alps".to_string(), true),
|
||||
("zoo".to_string(), true),
|
||||
("A.GPX".to_string(), false),
|
||||
("b.gpx".to_string(), false),
|
||||
("b 2.gpx".to_string(), false),
|
||||
("b 10.gpx".to_string(), false),
|
||||
]
|
||||
);
|
||||
assert_eq!(
|
||||
names(fx.workspace.list_folder(&folder.join("zoo")).unwrap()),
|
||||
[("c.gpx".to_string(), false)]
|
||||
);
|
||||
// only what is in the open folder can be listed
|
||||
let elsewhere = canonical(&std::env::temp_dir());
|
||||
assert!(fx.workspace.list_folder(&elsewhere).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn names_are_sorted_by_the_numbers_they_hold() {
|
||||
let mut names = vec![
|
||||
"track 10",
|
||||
"track 2",
|
||||
"Track 1",
|
||||
"track",
|
||||
"track 02b",
|
||||
"track 2a",
|
||||
"b",
|
||||
"A",
|
||||
];
|
||||
names.sort_by(|a, b| natural_cmp(a, b).then_with(|| a.cmp(b)));
|
||||
assert_eq!(
|
||||
names,
|
||||
[
|
||||
"A",
|
||||
"b",
|
||||
"track",
|
||||
"Track 1",
|
||||
"track 2",
|
||||
"track 2a",
|
||||
"track 02b",
|
||||
"track 10",
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_without_edits_is_read_again_when_the_disk_changes() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
|
||||
fx.write("a.gpx", "theirs");
|
||||
let outcome = fx.reconcile(Some(std::slice::from_ref(&a))).unwrap();
|
||||
assert!(outcome.changed);
|
||||
// the same file, now the one on the disk
|
||||
assert_eq!(fx.ids(), [id]);
|
||||
assert_eq!(fx.content(id), "theirs");
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.replaced);
|
||||
// looking again changes nothing
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_with_edits_is_flagged_when_the_disk_changes_and_not_read_again() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "mine");
|
||||
|
||||
fx.write("a.gpx", "theirs");
|
||||
let outcome = fx.reconcile(Some(std::slice::from_ref(&a))).unwrap();
|
||||
assert!(!outcome.changed);
|
||||
assert_eq!(fx.name(id), "mine");
|
||||
let status = fx.status(id);
|
||||
assert!(status.dirty && status.replaced && !status.missing);
|
||||
// looking again changes nothing
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_none());
|
||||
|
||||
// the disk goes back to what was read: only the edits are left
|
||||
fx.write("a.gpx", "a");
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_some());
|
||||
let status = fx.status(id);
|
||||
assert!(status.dirty && !status.replaced);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_user_can_take_the_disk_instead_of_the_edits() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "mine");
|
||||
fx.write("a.gpx", "theirs");
|
||||
fx.reconcile(None);
|
||||
assert!(fx.status(id).replaced);
|
||||
|
||||
fx.workspace.reload(&mut fx.engine, &[id]).unwrap();
|
||||
assert_eq!(fx.content(id), "theirs");
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.replaced);
|
||||
// and it is one undo step
|
||||
api::select(&mut fx.engine, &[id], SelectMode::Replace);
|
||||
api::undo(&mut fx.engine);
|
||||
assert_eq!(fx.content(id), "mine");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn saving_overwrites_what_replaced_the_file() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "mine");
|
||||
fx.write("a.gpx", "theirs");
|
||||
fx.reconcile(None);
|
||||
assert!(fx.status(id).replaced);
|
||||
|
||||
fx.save(&[id]);
|
||||
assert!(fs::read_to_string(a).unwrap().contains(">mine<"));
|
||||
assert!(!fx.status(id).replaced && !fx.status(id).dirty);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_that_is_gone_from_the_disk_stays_open_and_dirty_until_it_is_saved_again() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
|
||||
fs::remove_file(&a).unwrap();
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_some());
|
||||
assert_eq!(fx.ids(), [id]);
|
||||
let status = fx.status(id);
|
||||
assert!(status.dirty && status.missing && status.path.is_some());
|
||||
|
||||
// saving puts it back
|
||||
fx.save(&[id]);
|
||||
assert!(a.exists());
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.missing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_that_comes_back_different_is_read_again() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fs::remove_file(&a).unwrap();
|
||||
fx.reconcile(None);
|
||||
assert!(fx.status(id).missing);
|
||||
|
||||
fx.write("a.gpx", "back");
|
||||
fx.reconcile(None);
|
||||
assert_eq!(fx.content(id), "back");
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.missing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn what_changed_while_the_app_was_closed_is_found_when_it_starts() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.write("a.gpx", "changed");
|
||||
assert!(fx.reconcile(None).is_some());
|
||||
assert_eq!(fx.content(id), "changed");
|
||||
fs::remove_file(a).unwrap();
|
||||
assert!(fx.reconcile(None).is_some());
|
||||
assert!(fx.status(id).missing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn new_files_made_from_a_file_of_the_folder_are_saved_next_to_it() {
|
||||
let mut fx = Fixture::new();
|
||||
fs::create_dir(fx.folder.join("sub")).unwrap();
|
||||
fx.write("sub/b.gpx", "b");
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let b = fx.id_named("b");
|
||||
let sub = fx.folder.join("sub");
|
||||
assert_eq!(fx.workspace.source_dir(&[b]), Some(canonical(&sub)));
|
||||
|
||||
let before = fx.ids();
|
||||
api::select(&mut fx.engine, &[b], SelectMode::Replace);
|
||||
let outcome = api::duplicate(&mut fx.engine);
|
||||
let copy = fx
|
||||
.ids()
|
||||
.into_iter()
|
||||
.find(|id| !before.contains(id))
|
||||
.unwrap();
|
||||
fx.workspace.inherit(outcome.added(), &canonical(&sub));
|
||||
assert_eq!(fx.status(copy).folder.as_deref(), canonical(&sub).to_str());
|
||||
assert!(fx.status(copy).path.is_none() && fx.status(copy).dirty);
|
||||
// nobody needs to be asked where it goes
|
||||
assert!(fx.workspace.unlinked(&fx.engine, &[copy]).is_empty());
|
||||
|
||||
fx.save(&[copy]);
|
||||
assert!(sub.join("b (2).gpx").exists());
|
||||
let status = fx.status(copy);
|
||||
assert!(!status.dirty && status.folder.is_none());
|
||||
assert_eq!(
|
||||
status.path.as_deref(),
|
||||
canonical(&sub.join("b (2).gpx")).to_str()
|
||||
);
|
||||
// the copy of the copy is next to it as well
|
||||
assert_eq!(fx.workspace.source_dir(&[copy]), Some(canonical(&sub)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_outside_the_open_folder_hands_nothing_down() {
|
||||
let mut fx = Fixture::new();
|
||||
let elsewhere = canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&elsewhere).unwrap();
|
||||
let outside = elsewhere.join("o.gpx");
|
||||
fs::write(&outside, gpx("o")).unwrap();
|
||||
let folder = fx.folder.clone();
|
||||
fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
fx.workspace
|
||||
.open_files(&mut fx.engine, std::slice::from_ref(&outside), true);
|
||||
let id = fx.ids()[0];
|
||||
assert_eq!(fx.workspace.source_dir(&[id]), None);
|
||||
// a new file with no source is not linked to a folder by `source_dir`: the caller falls back
|
||||
fs::remove_dir_all(elsewhere).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closing_files_asks_what_to_do_with_the_unsaved_ones() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.write("b.gpx", "b");
|
||||
fx.open_folder();
|
||||
let (a, b) = (fx.id_named("a"), fx.id_named("b"));
|
||||
fx.rename(a, "edited");
|
||||
assert_eq!(fx.workspace.unsaved(&fx.engine, &[a, b]), [a]);
|
||||
|
||||
// without a choice what has edits stays
|
||||
let outcome = fx.workspace.close_files(&mut fx.engine, &[a, b], false);
|
||||
assert!(outcome.changed);
|
||||
assert_eq!(fx.ids(), [a]);
|
||||
|
||||
// saved first
|
||||
fx.save(&[a]);
|
||||
fx.workspace.close_files(&mut fx.engine, &[a], false);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert!(
|
||||
fs::read_to_string(fx.folder.join("a.gpx"))
|
||||
.unwrap()
|
||||
.contains("edited")
|
||||
);
|
||||
assert!(fx.workspace.links.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closing_files_can_discard_their_edits() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let a = fx.ids()[0];
|
||||
fx.rename(a, "edited");
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
let fresh = fx.id_named("fresh");
|
||||
fx.workspace.close_files(&mut fx.engine, &[a, fresh], true);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert!(
|
||||
fs::read_to_string(fx.folder.join("a.gpx"))
|
||||
.unwrap()
|
||||
.contains(">a<")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closing_the_folder_closes_every_file() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
assert_eq!(fx.ids().len(), 2);
|
||||
|
||||
// the new file has nowhere to go: it has to be discarded
|
||||
let outcome = fx.workspace.close_folder(&mut fx.engine, false);
|
||||
assert!(outcome.changed);
|
||||
assert_eq!(fx.ids().len(), 1);
|
||||
assert!(fx.workspace.folder.is_none());
|
||||
|
||||
let outcome = fx.workspace.close_folder(&mut fx.engine, true);
|
||||
assert!(outcome.changed);
|
||||
assert!(fx.ids().is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opening_another_folder_closes_the_first_with_all_its_files() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let a = fx.ids()[0];
|
||||
fx.rename(a, "edited");
|
||||
let other = canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&other).unwrap();
|
||||
|
||||
// the edits stay, nothing is lost without a choice
|
||||
fx.workspace.open_folder(&mut fx.engine, &other, false);
|
||||
assert_eq!(fx.ids(), [a]);
|
||||
assert_eq!(fx.workspace.folder.as_deref(), Some(other.as_path()));
|
||||
|
||||
let first = fx.folder.clone();
|
||||
fx.workspace.open_folder(&mut fx.engine, &first, true);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert!(
|
||||
fs::read_to_string(fx.folder.join("a.gpx"))
|
||||
.unwrap()
|
||||
.contains(">a<")
|
||||
);
|
||||
fs::remove_dir_all(other).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opening_the_same_folder_again_changes_nothing() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let folder = fx.folder.clone();
|
||||
let outcome = fx.workspace.open_folder(&mut fx.engine, &folder, true);
|
||||
assert!(!outcome.changed);
|
||||
assert_eq!(fx.ids().len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_failed_save_stops_at_the_file_and_leaves_it_dirty() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "edited");
|
||||
// the place of the file is taken by a folder
|
||||
fs::remove_file(fx.folder.join("a.gpx")).unwrap();
|
||||
fs::create_dir(fx.folder.join("a.gpx")).unwrap();
|
||||
let result = fx
|
||||
.workspace
|
||||
.save(&mut fx.engine, &[id], &BTreeMap::new(), None);
|
||||
assert!(result.is_err());
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn saving_as_gives_the_file_another_place() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.write("b.gpx", "b");
|
||||
fx.open_folder();
|
||||
let id = fx.id_named("a");
|
||||
let other = fx.id_named("b");
|
||||
fx.rename(id, "edited");
|
||||
|
||||
let target = fx.folder.join("copy.gpx");
|
||||
fx.workspace.save_as(&mut fx.engine, id, &target).unwrap();
|
||||
assert!(fs::read_to_string(&target).unwrap().contains("edited"));
|
||||
assert!(fs::read_to_string(a).unwrap().contains(">a<"));
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty);
|
||||
assert_eq!(status.path.as_deref(), canonical(&target).to_str());
|
||||
|
||||
// the place of another open file is not available
|
||||
let taken = fx.folder.join("b.gpx");
|
||||
assert!(fx.workspace.save_as(&mut fx.engine, id, &taken).is_err());
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, other));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod restart_tests {
|
||||
use gpx_engine::Persister;
|
||||
|
||||
use super::*;
|
||||
use crate::store::FileStorage;
|
||||
|
||||
/// What the app does when it starts again: the engine and the links are read from what was
|
||||
/// kept.
|
||||
fn restart(engine: &Engine, workspace: &Workspace, root: &Path) -> (Engine, Workspace) {
|
||||
let storage = FileStorage::open(root).unwrap();
|
||||
pollster::block_on(Persister::default().save(&storage, engine.snapshot())).unwrap();
|
||||
let mut restarted = Engine::default();
|
||||
let restored = pollster::block_on(Persister::default().restore(&storage)).unwrap();
|
||||
restarted.restore(restored);
|
||||
let links = serde_json::to_string(workspace).unwrap();
|
||||
(restarted, serde_json::from_str(&links).unwrap())
|
||||
}
|
||||
|
||||
fn setup() -> (PathBuf, Engine, Workspace, Vec<Uuid>) {
|
||||
let root = std::env::temp_dir().join(format!("gpx-restart-{}", Uuid::new_v4()));
|
||||
let folder = root.join("tracks");
|
||||
fs::create_dir_all(&folder).unwrap();
|
||||
for name in ["with_tracks", "with_time", "with_waypoint"] {
|
||||
let _ = fs::copy(
|
||||
format!("../gpx-rs/data/{name}.gpx"),
|
||||
folder.join(format!("{name}.gpx")),
|
||||
);
|
||||
}
|
||||
let mut engine = Engine::default();
|
||||
let mut workspace = Workspace::default();
|
||||
workspace.open_folder(&mut engine, &folder, false);
|
||||
workspace.open_files(&mut engine, &tests::gpx_files(&folder), false);
|
||||
let ids = engine.order().iter().map(|id| id.0).collect();
|
||||
(root, engine, workspace, ids)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn files_that_were_not_edited_are_not_unsaved_after_a_restart() {
|
||||
let (root, engine, workspace, ids) = setup();
|
||||
assert!(ids.len() >= 2);
|
||||
let (restarted, mut workspace) = restart(&engine, &workspace, &root.join("store"));
|
||||
// the files are the same, but the engine knows their contents by new identities
|
||||
assert!(ids.iter().any(|id| workspace.is_dirty(&restarted, *id)));
|
||||
workspace.verify(&restarted);
|
||||
assert!(ids.iter().all(|id| !workspace.is_dirty(&restarted, *id)));
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn files_that_were_edited_are_still_unsaved_after_a_restart() {
|
||||
let (root, mut engine, workspace, ids) = setup();
|
||||
api::select(&mut engine, &[ids[0]], gpx_engine::SelectMode::Replace);
|
||||
api::metadata(&mut engine, "edited", "");
|
||||
assert!(workspace.is_dirty(&engine, ids[0]));
|
||||
let (restarted, mut workspace) = restart(&engine, &workspace, &root.join("store"));
|
||||
workspace.verify(&restarted);
|
||||
assert!(workspace.is_dirty(&restarted, ids[0]));
|
||||
assert!(
|
||||
ids[1..]
|
||||
.iter()
|
||||
.all(|id| !workspace.is_dirty(&restarted, *id))
|
||||
);
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn links_made_before_the_content_was_kept_are_checked_against_the_disk() {
|
||||
let (root, mut engine, mut workspace, ids) = setup();
|
||||
api::select(&mut engine, &[ids[0]], gpx_engine::SelectMode::Replace);
|
||||
api::metadata(&mut engine, "edited", "");
|
||||
for link in workspace.links.values_mut() {
|
||||
link.export_hash = 0;
|
||||
}
|
||||
let (restarted, mut workspace) = restart(&engine, &workspace, &root.join("store"));
|
||||
workspace.verify(&restarted);
|
||||
assert!(workspace.is_dirty(&restarted, ids[0]));
|
||||
assert!(
|
||||
ids[1..]
|
||||
.iter()
|
||||
.all(|id| !workspace.is_dirty(&restarted, *id))
|
||||
);
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_folders_of_new_files_and_the_old_flag_name_survive_a_restart() {
|
||||
let (root, engine, mut workspace, ids) = setup();
|
||||
let folder = workspace.folder.clone().unwrap();
|
||||
let fresh = Uuid::new_v4();
|
||||
workspace.inherit(&[fresh.to_string()], &folder);
|
||||
workspace.links.get_mut(&ids[0]).unwrap().replaced = true;
|
||||
let json = serde_json::to_string(&workspace).unwrap();
|
||||
// links written by the previous version had `conflict`, which is the same thing
|
||||
let json = json.replace("\"replaced\"", "\"conflict\"");
|
||||
assert!(json.contains("\"conflict\":true"));
|
||||
let read: Workspace = serde_json::from_str(&json).unwrap();
|
||||
assert!(read.links[&ids[0]].replaced);
|
||||
assert_eq!(read.dirs.get(&fresh), Some(&folder));
|
||||
let _ = engine;
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -27,7 +27,8 @@
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"targets": ["app", "dmg", "appimage", "deb", "rpm", "nsis"],
|
||||
"macOS": { "signingIdentity": "-" },
|
||||
"fileAssociations": [
|
||||
{
|
||||
"ext": ["gpx"],
|
||||
@@ -44,5 +45,13 @@
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
},
|
||||
"plugins": {
|
||||
"updater": {
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5NTFDQzVDOUYwNEMyNEMKUldSTXdnU2ZYTXhSR1ZXRDV6aVErc3dUWXBaK0VGSitYRnFFR21hZ2s5UEJTT01aYkE5Unp5c0cKdW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEFFNTU3Q0Y1NzhFODkyMTEKUldRUmt1aDQ5WHhWcmdXQmx0UG83V29TenRxSVJjdkc4ckN1Zi93ajc3ZUhVUVp3eFlCOXphb1IK",
|
||||
"endpoints": [
|
||||
"https://github.com/gpxstudio/gpx.studio/releases/latest/download/latest.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,21 @@ use tauri::test::{INVOKE_KEY, get_ipc_response, mock_builder, mock_context, noop
|
||||
use tauri::webview::InvokeRequest;
|
||||
use tauri::{WebviewWindow, ipc::CallbackFn, ipc::InvokeBody, ipc::InvokeResponseBody};
|
||||
|
||||
/// The origin of the pages of the app, the one Tauri allows the commands from: Windows has no
|
||||
/// custom protocols, the pages come from `http://tauri.localhost` there.
|
||||
const ORIGIN: &str = if cfg!(windows) {
|
||||
"http://tauri.localhost"
|
||||
} else {
|
||||
"tauri://localhost"
|
||||
};
|
||||
|
||||
struct App(WebviewWindow<tauri::test::MockRuntime>);
|
||||
|
||||
impl App {
|
||||
fn new() -> Self {
|
||||
let app =
|
||||
crate::register_commands(mock_builder().manage(crate::state::AppState::temporary()))
|
||||
let app = gpx_studio_desktop_lib::register_commands(
|
||||
mock_builder().manage(crate::temporary_state()),
|
||||
)
|
||||
.build(mock_context(noop_assets()))
|
||||
.unwrap();
|
||||
let window = tauri::WebviewWindowBuilder::new(&app, "main", Default::default())
|
||||
@@ -34,7 +43,7 @@ impl App {
|
||||
cmd: cmd.into(),
|
||||
callback: CallbackFn(0),
|
||||
error: CallbackFn(1),
|
||||
url: "tauri://localhost".parse().unwrap(),
|
||||
url: ORIGIN.parse().unwrap(),
|
||||
body,
|
||||
headers,
|
||||
invoke_key: INVOKE_KEY.to_string(),
|
||||
@@ -56,7 +65,7 @@ impl App {
|
||||
cmd: cmd.into(),
|
||||
callback: CallbackFn(0),
|
||||
error: CallbackFn(1),
|
||||
url: "tauri://localhost".parse().unwrap(),
|
||||
url: ORIGIN.parse().unwrap(),
|
||||
body: InvokeBody::Json(args),
|
||||
headers: Default::default(),
|
||||
invoke_key: INVOKE_KEY.to_string(),
|
||||
@@ -311,8 +320,8 @@ fn keeps_settings_for_the_session() {
|
||||
|
||||
#[test]
|
||||
fn the_files_are_still_there_in_the_next_session() {
|
||||
use crate::state::AppState;
|
||||
use gpx_engine::api;
|
||||
use gpx_studio_desktop_lib::state::AppState;
|
||||
|
||||
let directory =
|
||||
std::env::temp_dir().join(format!("gpx-studio-session-{}", uuid::Uuid::new_v4()));
|
||||
@@ -347,14 +356,14 @@ fn only_gpx_files_that_exist_are_taken_from_what_the_system_gives() {
|
||||
text.to_string_lossy().into_owned(),
|
||||
directory.join("missing.gpx").to_string_lossy().into_owned(),
|
||||
];
|
||||
assert_eq!(crate::gpx_paths(arguments), [track]);
|
||||
assert_eq!(gpx_studio_desktop_lib::gpx_paths(arguments), [track]);
|
||||
std::fs::remove_dir_all(directory).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_opened_with_the_app_is_opened_selected_and_announced() {
|
||||
use crate::state::AppState;
|
||||
use gpx_engine::api;
|
||||
use gpx_studio_desktop_lib::state::AppState;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
let directory = std::env::temp_dir().join(format!("gpx-studio-open-{}", uuid::Uuid::new_v4()));
|
||||
@@ -441,7 +450,7 @@ fn a_file_outside_the_open_folder_is_read_again_when_the_disk_changes() {
|
||||
|
||||
let (events, received) = mpsc::channel();
|
||||
let directory = std::env::temp_dir().join(format!("gpx-store-{}", uuid::Uuid::new_v4()));
|
||||
let state = crate::state::AppState::open(
|
||||
let state = gpx_studio_desktop_lib::state::AppState::open(
|
||||
directory.clone(),
|
||||
std::sync::Arc::new(move |name, _| {
|
||||
let _ = events.send(name.to_string());
|
||||
@@ -461,8 +470,8 @@ fn a_file_outside_the_open_folder_is_read_again_when_the_disk_changes() {
|
||||
});
|
||||
let id = uuid::Uuid::parse_str(&id).unwrap();
|
||||
// the name comes from the path, which does not change: the content does
|
||||
let signature = |state: &crate::state::AppState| {
|
||||
state.core(move |core| crate::workspace::signature(&core.engine, id))
|
||||
let signature = |state: &gpx_studio_desktop_lib::state::AppState| {
|
||||
state.core(move |core| gpx_studio_desktop_lib::workspace::signature(&core.engine, id))
|
||||
};
|
||||
let before = signature(&state);
|
||||
|
||||
@@ -483,7 +492,7 @@ fn a_file_outside_the_open_folder_is_read_again_when_the_disk_changes() {
|
||||
|
||||
#[test]
|
||||
fn files_made_from_a_file_of_the_open_folder_are_written_next_to_it_at_once() {
|
||||
let state = crate::state::AppState::temporary();
|
||||
let state = crate::temporary_state();
|
||||
let folder = std::env::temp_dir().join(format!("gpx-tests-{}", uuid::Uuid::new_v4()));
|
||||
std::fs::create_dir_all(folder.join("sub")).unwrap();
|
||||
std::fs::copy("../gpx-rs/data/simple.gpx", folder.join("sub/track.gpx")).unwrap();
|
||||
@@ -516,19 +525,23 @@ fn files_made_from_a_file_of_the_open_folder_are_written_next_to_it_at_once() {
|
||||
.collect();
|
||||
// the copy is in the subfolder, named after its name (the one in the file, not of the file)
|
||||
assert!(
|
||||
paths.iter().any(|path| path.ends_with("sub/simple.gpx")),
|
||||
paths
|
||||
.iter()
|
||||
.any(|path| std::path::Path::new(path).ends_with("sub/simple.gpx")),
|
||||
"{paths:?}"
|
||||
);
|
||||
// the new file went where the selected file is
|
||||
assert!(
|
||||
paths.iter().any(|path| path.ends_with("sub/fresh.gpx")),
|
||||
paths
|
||||
.iter()
|
||||
.any(|path| std::path::Path::new(path).ends_with("sub/fresh.gpx")),
|
||||
"{paths:?}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_parts_of_a_split_are_numbered_from_one() {
|
||||
let state = crate::state::AppState::temporary();
|
||||
let state = crate::temporary_state();
|
||||
let folder = std::env::temp_dir().join(format!("gpx-tests-{}", uuid::Uuid::new_v4()));
|
||||
std::fs::create_dir_all(&folder).unwrap();
|
||||
std::fs::copy("../gpx-rs/data/simple.gpx", folder.join("track.gpx")).unwrap();
|
||||
@@ -649,7 +662,7 @@ fn a_file_keeps_its_name_and_its_file_is_renamed_apart() {
|
||||
|
||||
// the name of another file is not taken
|
||||
let error = app.error("rename_file", json!({ "fileId": id, "name": "taken" }));
|
||||
assert_eq!(error, crate::workspace::NAME_TAKEN);
|
||||
assert_eq!(error, gpx_studio_desktop_lib::workspace::NAME_TAKEN);
|
||||
assert!(folder.join("moved.gpx").exists());
|
||||
|
||||
// a name is one that a file can have
|
||||
@@ -0,0 +1,15 @@
|
||||
//! The tests of the desktop app. They are integration tests, in a single binary, rather than unit
|
||||
//! tests: on Windows, only test binaries can be given the manifest that the app needs to start
|
||||
//! (see `build.rs`).
|
||||
|
||||
mod commands;
|
||||
mod store;
|
||||
mod workspace;
|
||||
|
||||
use gpx_studio_desktop_lib::state::AppState;
|
||||
|
||||
/// An engine that keeps its data in a directory of its own, and has nobody to tell.
|
||||
fn temporary_state() -> AppState {
|
||||
let directory = std::env::temp_dir().join(format!("gpx-studio-{}", uuid::Uuid::new_v4()));
|
||||
AppState::open(directory, std::sync::Arc::new(|_, _| {})).expect("the storage can be opened")
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
//! The storage of the engine on the file system (`store`).
|
||||
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use gpx_engine::{
|
||||
Action, Batch, Command, CommitError, Load, LoadFiles, Persister, Revision, Storage,
|
||||
};
|
||||
use gpx_studio_desktop_lib::Engine;
|
||||
use gpx_studio_desktop_lib::store::FileStorage;
|
||||
use uuid::Uuid;
|
||||
|
||||
fn directory() -> PathBuf {
|
||||
std::env::temp_dir().join(format!("gpx-studio-store-{}", Uuid::new_v4()))
|
||||
}
|
||||
|
||||
fn engine_with_a_file() -> Engine {
|
||||
let mut engine = Engine::default();
|
||||
let data = std::fs::read("../gpx-rs/data/simple.gpx").unwrap();
|
||||
engine
|
||||
.execute(Action::Edit(Command::LoadFiles(LoadFiles {
|
||||
files: vec![Load {
|
||||
data: &data,
|
||||
name: "simple",
|
||||
}],
|
||||
})))
|
||||
.unwrap();
|
||||
engine
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keeps_the_files_and_the_settings_between_sessions() {
|
||||
let root = directory();
|
||||
let engine = engine_with_a_file();
|
||||
let order = engine.order().to_vec();
|
||||
|
||||
let storage = FileStorage::open(&root).unwrap();
|
||||
pollster::block_on(Persister::default().save(&storage, engine.snapshot())).unwrap();
|
||||
pollster::block_on(storage.put_setting("units", "\"metric\"")).unwrap();
|
||||
|
||||
// another session
|
||||
let storage = FileStorage::open(&root).unwrap();
|
||||
let restored = pollster::block_on(Persister::default().restore(&storage)).unwrap();
|
||||
let mut other = Engine::default();
|
||||
other.restore(restored);
|
||||
assert_eq!(other.order(), order);
|
||||
assert_eq!(
|
||||
other.file_statistics(&order[0]).unwrap().total_distance,
|
||||
engine.file_statistics(&order[0]).unwrap().total_distance
|
||||
);
|
||||
assert_eq!(storage.settings()["units"], "\"metric\"");
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn refuses_a_commit_that_is_not_based_on_the_head() {
|
||||
let root = directory();
|
||||
let storage = FileStorage::open(&root).unwrap();
|
||||
let batch = Batch {
|
||||
order: Some(vec![]),
|
||||
..Default::default()
|
||||
};
|
||||
assert_eq!(pollster::block_on(storage.commit(&batch)), Ok(Revision(1)));
|
||||
assert_eq!(
|
||||
pollster::block_on(storage.commit(&batch)),
|
||||
Err(CommitError::Stale { head: Revision(1) })
|
||||
);
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
@@ -0,0 +1,811 @@
|
||||
//! The places of the files of the engine on the disk (`workspace`).
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use gpx_engine::{FileId, SelectMode, api};
|
||||
use gpx_studio_desktop_lib::Engine;
|
||||
use gpx_studio_desktop_lib::workspace::*;
|
||||
use uuid::Uuid;
|
||||
|
||||
fn gpx(name: &str) -> String {
|
||||
format!(
|
||||
r#"<?xml version="1.0"?><gpx version="1.1" creator="test" xmlns="http://www.topografix.com/GPX/1/1"><metadata><name>{name}</name></metadata><trk><name>{name}</name><trkseg><trkpt lat="50.0" lon="4.0"><ele>10</ele></trkpt><trkpt lat="50.1" lon="4.1"><ele>20</ele></trkpt></trkseg></trk></gpx>"#
|
||||
)
|
||||
}
|
||||
|
||||
/// The GPX files of a folder and of the folders in it.
|
||||
pub fn gpx_files(folder: &Path) -> Vec<PathBuf> {
|
||||
let mut found = vec![];
|
||||
for entry in fs::read_dir(folder).unwrap().flatten() {
|
||||
let path = entry.path();
|
||||
if path.is_dir() {
|
||||
found.extend(gpx_files(&path));
|
||||
} else if is_gpx(&path) {
|
||||
found.push(path);
|
||||
}
|
||||
}
|
||||
found.sort();
|
||||
found
|
||||
}
|
||||
|
||||
struct Fixture {
|
||||
folder: PathBuf,
|
||||
engine: Engine,
|
||||
workspace: Workspace,
|
||||
}
|
||||
|
||||
impl Fixture {
|
||||
fn new() -> Self {
|
||||
let folder = canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&folder).unwrap();
|
||||
Self {
|
||||
folder,
|
||||
engine: Engine::default(),
|
||||
workspace: Workspace::default(),
|
||||
}
|
||||
}
|
||||
|
||||
fn write(&self, name: &str, title: &str) -> PathBuf {
|
||||
let path = self.folder.join(name);
|
||||
fs::write(&path, gpx(title)).unwrap();
|
||||
path
|
||||
}
|
||||
|
||||
/// Opens the folder, and all the files that are in it.
|
||||
fn open_folder(&mut self) {
|
||||
let folder = self.folder.clone();
|
||||
self.workspace.open_folder(&mut self.engine, &folder, false);
|
||||
let files = gpx_files(&folder);
|
||||
self.workspace.open_files(&mut self.engine, &files, false);
|
||||
}
|
||||
|
||||
fn reconcile(&mut self, changed: Option<&[PathBuf]>) -> Option<api::Outcome> {
|
||||
self.workspace.reconcile(&mut self.engine, changed)
|
||||
}
|
||||
|
||||
fn save(&mut self, ids: &[Uuid]) {
|
||||
self.workspace
|
||||
.save(&mut self.engine, ids, &BTreeMap::new(), None)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
fn ids(&self) -> Vec<Uuid> {
|
||||
self.engine.order().iter().map(|id| id.0).collect()
|
||||
}
|
||||
|
||||
fn id_named(&self, name: &str) -> Uuid {
|
||||
self.ids()
|
||||
.into_iter()
|
||||
.find(|id| self.name(*id) == name)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn name(&self, id: Uuid) -> String {
|
||||
self.engine
|
||||
.file_structure(&FileId(id))
|
||||
.unwrap()
|
||||
.name
|
||||
.clone()
|
||||
}
|
||||
|
||||
/// What the file holds: the name of its track (its own name is the one of the file).
|
||||
fn content(&self, id: Uuid) -> String {
|
||||
self.engine.file_structure(&FileId(id)).unwrap().tracks[0]
|
||||
.info
|
||||
.name
|
||||
.clone()
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn rename(&mut self, id: Uuid, name: &str) {
|
||||
api::select(&mut self.engine, &[id], SelectMode::Replace);
|
||||
assert!(!api::metadata(&mut self.engine, name, "").has_error());
|
||||
}
|
||||
|
||||
fn status(&self, id: Uuid) -> FileStatus {
|
||||
self.workspace
|
||||
.state(&self.engine)
|
||||
.files
|
||||
.remove(&id.to_string())
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Fixture {
|
||||
fn drop(&mut self) {
|
||||
let _ = fs::remove_dir_all(&self.folder);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_opened_file_is_clean_until_it_is_edited_and_clean_again_once_saved() {
|
||||
let mut fx = Fixture::new();
|
||||
let path = fx.write("a.gpx", "a");
|
||||
fx.workspace
|
||||
.open_files(&mut fx.engine, std::slice::from_ref(&path), true);
|
||||
let id = fx.ids()[0];
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert_eq!(fx.status(id).path.as_deref(), path.to_str());
|
||||
|
||||
fx.rename(id, "renamed");
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
// nothing is written before it is saved
|
||||
assert!(fs::read_to_string(&path).unwrap().contains(">a<"));
|
||||
|
||||
fx.save(&[id]);
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert!(fs::read_to_string(&path).unwrap().contains(">renamed<"));
|
||||
|
||||
// going back before the save is an edit again
|
||||
api::select(&mut fx.engine, &[id], SelectMode::Replace);
|
||||
api::undo(&mut fx.engine);
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
api::redo(&mut fx.engine);
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_that_is_not_on_the_disk_is_unsaved_until_it_is_given_a_place() {
|
||||
let mut fx = Fixture::new();
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
let id = fx.ids()[0];
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert_eq!(
|
||||
fx.workspace.unlinked(&fx.engine, &[id]),
|
||||
[(id, "fresh".to_string())]
|
||||
);
|
||||
// nowhere to put it without being told
|
||||
fx.save(&[id]);
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
|
||||
let path = fx.folder.join("fresh.gpx");
|
||||
let paths = BTreeMap::from([(id, path.clone())]);
|
||||
fx.workspace
|
||||
.save(&mut fx.engine, &[id], &paths, None)
|
||||
.unwrap();
|
||||
assert!(path.exists());
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, id));
|
||||
assert!(fx.workspace.unlinked(&fx.engine, &[id]).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn several_files_without_a_place_go_in_a_folder_with_names_that_are_free() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("fresh.gpx", "already there");
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
api::new_file(&mut fx.engine, "a/b: c", None, None, None, false);
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
let ids = fx.ids();
|
||||
let folder = fx.folder.clone();
|
||||
fx.workspace
|
||||
.save(&mut fx.engine, &ids, &BTreeMap::new(), Some(&folder))
|
||||
.unwrap();
|
||||
for name in ["fresh (2).gpx", "fresh (3).gpx", "a_b_ c.gpx"] {
|
||||
assert!(fx.folder.join(name).exists(), "{name}");
|
||||
}
|
||||
assert!(ids.iter().all(|id| !fx.workspace.is_dirty(&fx.engine, *id)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn what_this_app_writes_is_not_a_change_of_the_disk() {
|
||||
let mut fx = Fixture::new();
|
||||
let path = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
api::select(&mut fx.engine, &[id], SelectMode::Replace);
|
||||
assert!(!api::style(&mut fx.engine, Some("#ff0000"), None, None).has_error());
|
||||
fx.save(&[id]);
|
||||
assert!(fx.reconcile(Some(&[path])).is_none());
|
||||
assert!(!fx.status(id).replaced && !fx.status(id).dirty);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_folders_of_the_files_outside_the_open_folder_are_watched_too() {
|
||||
let mut fx = Fixture::new();
|
||||
let inside = fx.write("in.gpx", "in");
|
||||
let elsewhere = canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&elsewhere).unwrap();
|
||||
let (one, two) = (elsewhere.join("one.gpx"), elsewhere.join("two.gpx"));
|
||||
fs::write(&one, gpx("one")).unwrap();
|
||||
fs::write(&two, gpx("two")).unwrap();
|
||||
let folder = fx.folder.clone();
|
||||
|
||||
// no folder: only the folder of the files
|
||||
fx.workspace.open_files(&mut fx.engine, &[one, two], false);
|
||||
assert_eq!(fx.workspace.watched(), [(elsewhere.clone(), false)]);
|
||||
|
||||
// the open folder as a whole, and the file in it needs nothing more
|
||||
fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
fx.workspace.open_files(&mut fx.engine, &[inside], false);
|
||||
assert_eq!(
|
||||
fx.workspace.watched(),
|
||||
[(folder, true), (elsewhere.clone(), false)]
|
||||
);
|
||||
|
||||
// closing the files stops it
|
||||
let ids = fx.ids();
|
||||
fx.workspace.close_files(&mut fx.engine, &ids, true);
|
||||
assert_eq!(fx.workspace.watched(), [(fx.folder.clone(), true)]);
|
||||
fs::remove_dir_all(elsewhere).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opening_a_folder_does_not_open_its_files() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
let folder = fx.folder.clone();
|
||||
let outcome = fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
assert!(!outcome.changed);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert_eq!(fx.workspace.folder.as_deref(), Some(folder.as_path()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn folders_are_made_renamed_and_moved_and_the_open_files_follow() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
let root = fx.folder.clone();
|
||||
let path_of = |fx: &Fixture| PathBuf::from(fx.status(id).path.unwrap());
|
||||
|
||||
let first = fx.workspace.create_folder(&root, "New folder").unwrap();
|
||||
let second = fx.workspace.create_folder(&root, "New folder").unwrap();
|
||||
assert_eq!(first, root.join("New folder"));
|
||||
assert_eq!(second, root.join("New folder 2"));
|
||||
|
||||
fx.workspace.move_paths(&[a], &first).unwrap();
|
||||
assert_eq!(path_of(&fx), first.join("a.gpx"));
|
||||
assert!(first.join("a.gpx").exists() && !fx.status(id).dirty);
|
||||
|
||||
let trips = fx.workspace.rename_path(&first, "Trips").unwrap();
|
||||
assert_eq!(path_of(&fx), root.join("Trips/a.gpx"));
|
||||
// a folder does not go into itself, nor onto something else
|
||||
assert!(
|
||||
fx.workspace
|
||||
.move_paths(std::slice::from_ref(&trips), &trips)
|
||||
.is_err()
|
||||
);
|
||||
assert_eq!(
|
||||
fx.workspace.rename_path(&trips, "New folder 2"),
|
||||
Err(NAME_TAKEN.to_owned())
|
||||
);
|
||||
fx.workspace.move_paths(&[trips], &second).unwrap();
|
||||
assert_eq!(path_of(&fx), second.join("Trips/a.gpx"));
|
||||
|
||||
// a file keeps its extension
|
||||
let closed = fx.write("c.gpx", "c");
|
||||
assert_eq!(
|
||||
fx.workspace.rename_path(&closed, "d").unwrap(),
|
||||
root.join("d.gpx")
|
||||
);
|
||||
// the open folder and what is not in it are left alone
|
||||
assert!(fx.workspace.rename_path(&root, "x").is_err());
|
||||
let elsewhere = canonical(&std::env::temp_dir());
|
||||
assert!(fx.workspace.rename_path(&elsewhere, "x").is_err());
|
||||
assert!(fx.workspace.create_folder(&elsewhere, "x").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deleted_files_are_closed_unless_they_have_edits() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
let b = fx.write("b.gpx", "b");
|
||||
fx.open_folder();
|
||||
let (id_a, id_b) = (fx.id_named("a"), fx.id_named("b"));
|
||||
api::select(&mut fx.engine, &[id_b], SelectMode::Replace);
|
||||
assert!(!api::style(&mut fx.engine, Some("#ff0000"), None, None).has_error());
|
||||
|
||||
let outcome = fx
|
||||
.workspace
|
||||
.delete_paths(&mut fx.engine, &[a.clone(), b.clone()], |paths| {
|
||||
paths.iter().for_each(|path| fs::remove_file(path).unwrap());
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
assert!(outcome.changed);
|
||||
assert_eq!(fx.ids(), [id_b]);
|
||||
assert!(!fx.ids().contains(&id_a));
|
||||
let status = fx.status(id_b);
|
||||
assert!(status.dirty && status.missing);
|
||||
assert!(!a.exists() && !b.exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_tree_of_the_folder_shows_folders_first_and_only_gpx_files() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("b.gpx", "b");
|
||||
fx.write("A.GPX", "a");
|
||||
fx.write("b 10.gpx", "b 10");
|
||||
fx.write("b 2.gpx", "b 2");
|
||||
fx.write("notes.txt", "not a track");
|
||||
fx.write(".hidden.gpx", "hidden");
|
||||
fs::create_dir(fx.folder.join("zoo")).unwrap();
|
||||
fs::create_dir(fx.folder.join("Alps")).unwrap();
|
||||
fs::create_dir(fx.folder.join(".git")).unwrap();
|
||||
fx.write("zoo/c.gpx", "c");
|
||||
let folder = fx.folder.clone();
|
||||
fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
|
||||
let names = |entries: Vec<Entry>| -> Vec<(String, bool)> {
|
||||
entries.into_iter().map(|e| (e.name, e.is_dir)).collect()
|
||||
};
|
||||
assert_eq!(
|
||||
names(fx.workspace.list_folder(&folder).unwrap()),
|
||||
[
|
||||
("Alps".to_string(), true),
|
||||
("zoo".to_string(), true),
|
||||
("A.GPX".to_string(), false),
|
||||
("b.gpx".to_string(), false),
|
||||
("b 2.gpx".to_string(), false),
|
||||
("b 10.gpx".to_string(), false),
|
||||
]
|
||||
);
|
||||
assert_eq!(
|
||||
names(fx.workspace.list_folder(&folder.join("zoo")).unwrap()),
|
||||
[("c.gpx".to_string(), false)]
|
||||
);
|
||||
// only what is in the open folder can be listed
|
||||
let elsewhere = canonical(&std::env::temp_dir());
|
||||
assert!(fx.workspace.list_folder(&elsewhere).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn names_are_sorted_by_the_numbers_they_hold() {
|
||||
let mut names = vec![
|
||||
"track 10",
|
||||
"track 2",
|
||||
"Track 1",
|
||||
"track",
|
||||
"track 02b",
|
||||
"track 2a",
|
||||
"b",
|
||||
"A",
|
||||
];
|
||||
names.sort_by(|a, b| natural_cmp(a, b).then_with(|| a.cmp(b)));
|
||||
assert_eq!(
|
||||
names,
|
||||
[
|
||||
"A",
|
||||
"b",
|
||||
"track",
|
||||
"Track 1",
|
||||
"track 2",
|
||||
"track 2a",
|
||||
"track 02b",
|
||||
"track 10",
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_without_edits_is_read_again_when_the_disk_changes() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
|
||||
fx.write("a.gpx", "theirs");
|
||||
let outcome = fx.reconcile(Some(std::slice::from_ref(&a))).unwrap();
|
||||
assert!(outcome.changed);
|
||||
// the same file, now the one on the disk
|
||||
assert_eq!(fx.ids(), [id]);
|
||||
assert_eq!(fx.content(id), "theirs");
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.replaced);
|
||||
// looking again changes nothing
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_with_edits_is_flagged_when_the_disk_changes_and_not_read_again() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "mine");
|
||||
|
||||
fx.write("a.gpx", "theirs");
|
||||
let outcome = fx.reconcile(Some(std::slice::from_ref(&a))).unwrap();
|
||||
assert!(!outcome.changed);
|
||||
assert_eq!(fx.name(id), "mine");
|
||||
let status = fx.status(id);
|
||||
assert!(status.dirty && status.replaced && !status.missing);
|
||||
// looking again changes nothing
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_none());
|
||||
|
||||
// the disk goes back to what was read: only the edits are left
|
||||
fx.write("a.gpx", "a");
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_some());
|
||||
let status = fx.status(id);
|
||||
assert!(status.dirty && !status.replaced);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_user_can_take_the_disk_instead_of_the_edits() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "mine");
|
||||
fx.write("a.gpx", "theirs");
|
||||
fx.reconcile(None);
|
||||
assert!(fx.status(id).replaced);
|
||||
|
||||
fx.workspace.reload(&mut fx.engine, &[id]).unwrap();
|
||||
assert_eq!(fx.content(id), "theirs");
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.replaced);
|
||||
// and it is one undo step
|
||||
api::select(&mut fx.engine, &[id], SelectMode::Replace);
|
||||
api::undo(&mut fx.engine);
|
||||
assert_eq!(fx.content(id), "mine");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn saving_overwrites_what_replaced_the_file() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "mine");
|
||||
fx.write("a.gpx", "theirs");
|
||||
fx.reconcile(None);
|
||||
assert!(fx.status(id).replaced);
|
||||
|
||||
fx.save(&[id]);
|
||||
assert!(fs::read_to_string(a).unwrap().contains(">mine<"));
|
||||
assert!(!fx.status(id).replaced && !fx.status(id).dirty);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_that_is_gone_from_the_disk_stays_open_and_dirty_until_it_is_saved_again() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
|
||||
fs::remove_file(&a).unwrap();
|
||||
assert!(fx.reconcile(Some(std::slice::from_ref(&a))).is_some());
|
||||
assert_eq!(fx.ids(), [id]);
|
||||
let status = fx.status(id);
|
||||
assert!(status.dirty && status.missing && status.path.is_some());
|
||||
|
||||
// saving puts it back
|
||||
fx.save(&[id]);
|
||||
assert!(a.exists());
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.missing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_that_comes_back_different_is_read_again() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fs::remove_file(&a).unwrap();
|
||||
fx.reconcile(None);
|
||||
assert!(fx.status(id).missing);
|
||||
|
||||
fx.write("a.gpx", "back");
|
||||
fx.reconcile(None);
|
||||
assert_eq!(fx.content(id), "back");
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty && !status.missing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn what_changed_while_the_app_was_closed_is_found_when_it_starts() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.write("a.gpx", "changed");
|
||||
assert!(fx.reconcile(None).is_some());
|
||||
assert_eq!(fx.content(id), "changed");
|
||||
fs::remove_file(a).unwrap();
|
||||
assert!(fx.reconcile(None).is_some());
|
||||
assert!(fx.status(id).missing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn new_files_made_from_a_file_of_the_folder_are_saved_next_to_it() {
|
||||
let mut fx = Fixture::new();
|
||||
fs::create_dir(fx.folder.join("sub")).unwrap();
|
||||
fx.write("sub/b.gpx", "b");
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let b = fx.id_named("b");
|
||||
let sub = fx.folder.join("sub");
|
||||
assert_eq!(fx.workspace.source_dir(&[b]), Some(canonical(&sub)));
|
||||
|
||||
let before = fx.ids();
|
||||
api::select(&mut fx.engine, &[b], SelectMode::Replace);
|
||||
let outcome = api::duplicate(&mut fx.engine);
|
||||
let copy = fx
|
||||
.ids()
|
||||
.into_iter()
|
||||
.find(|id| !before.contains(id))
|
||||
.unwrap();
|
||||
fx.workspace.inherit(outcome.added(), &canonical(&sub));
|
||||
assert_eq!(fx.status(copy).folder.as_deref(), canonical(&sub).to_str());
|
||||
assert!(fx.status(copy).path.is_none() && fx.status(copy).dirty);
|
||||
// nobody needs to be asked where it goes
|
||||
assert!(fx.workspace.unlinked(&fx.engine, &[copy]).is_empty());
|
||||
|
||||
fx.save(&[copy]);
|
||||
assert!(sub.join("b (2).gpx").exists());
|
||||
let status = fx.status(copy);
|
||||
assert!(!status.dirty && status.folder.is_none());
|
||||
assert_eq!(
|
||||
status.path.as_deref(),
|
||||
canonical(&sub.join("b (2).gpx")).to_str()
|
||||
);
|
||||
// the copy of the copy is next to it as well
|
||||
assert_eq!(fx.workspace.source_dir(&[copy]), Some(canonical(&sub)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_file_outside_the_open_folder_hands_nothing_down() {
|
||||
let mut fx = Fixture::new();
|
||||
let elsewhere = canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&elsewhere).unwrap();
|
||||
let outside = elsewhere.join("o.gpx");
|
||||
fs::write(&outside, gpx("o")).unwrap();
|
||||
let folder = fx.folder.clone();
|
||||
fx.workspace.open_folder(&mut fx.engine, &folder, false);
|
||||
fx.workspace
|
||||
.open_files(&mut fx.engine, std::slice::from_ref(&outside), true);
|
||||
let id = fx.ids()[0];
|
||||
assert_eq!(fx.workspace.source_dir(&[id]), None);
|
||||
// a new file with no source is not linked to a folder by `source_dir`: the caller falls back
|
||||
fs::remove_dir_all(elsewhere).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closing_files_asks_what_to_do_with_the_unsaved_ones() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.write("b.gpx", "b");
|
||||
fx.open_folder();
|
||||
let (a, b) = (fx.id_named("a"), fx.id_named("b"));
|
||||
fx.rename(a, "edited");
|
||||
assert_eq!(fx.workspace.unsaved(&fx.engine, &[a, b]), [a]);
|
||||
|
||||
// without a choice what has edits stays
|
||||
let outcome = fx.workspace.close_files(&mut fx.engine, &[a, b], false);
|
||||
assert!(outcome.changed);
|
||||
assert_eq!(fx.ids(), [a]);
|
||||
|
||||
// saved first
|
||||
fx.save(&[a]);
|
||||
fx.workspace.close_files(&mut fx.engine, &[a], false);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert!(
|
||||
fs::read_to_string(fx.folder.join("a.gpx"))
|
||||
.unwrap()
|
||||
.contains("edited")
|
||||
);
|
||||
assert!(fx.workspace.links.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closing_files_can_discard_their_edits() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let a = fx.ids()[0];
|
||||
fx.rename(a, "edited");
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
let fresh = fx.id_named("fresh");
|
||||
fx.workspace.close_files(&mut fx.engine, &[a, fresh], true);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert!(
|
||||
fs::read_to_string(fx.folder.join("a.gpx"))
|
||||
.unwrap()
|
||||
.contains(">a<")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn closing_the_folder_closes_every_file() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
api::new_file(&mut fx.engine, "fresh", None, None, None, false);
|
||||
assert_eq!(fx.ids().len(), 2);
|
||||
|
||||
// the new file has nowhere to go: it has to be discarded
|
||||
let outcome = fx.workspace.close_folder(&mut fx.engine, false);
|
||||
assert!(outcome.changed);
|
||||
assert_eq!(fx.ids().len(), 1);
|
||||
assert!(fx.workspace.folder.is_none());
|
||||
|
||||
let outcome = fx.workspace.close_folder(&mut fx.engine, true);
|
||||
assert!(outcome.changed);
|
||||
assert!(fx.ids().is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opening_another_folder_closes_the_first_with_all_its_files() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let a = fx.ids()[0];
|
||||
fx.rename(a, "edited");
|
||||
let other = canonical(&std::env::temp_dir()).join(format!("gpx-ws-{}", Uuid::new_v4()));
|
||||
fs::create_dir_all(&other).unwrap();
|
||||
|
||||
// the edits stay, nothing is lost without a choice
|
||||
fx.workspace.open_folder(&mut fx.engine, &other, false);
|
||||
assert_eq!(fx.ids(), [a]);
|
||||
assert_eq!(fx.workspace.folder.as_deref(), Some(other.as_path()));
|
||||
|
||||
let first = fx.folder.clone();
|
||||
fx.workspace.open_folder(&mut fx.engine, &first, true);
|
||||
assert!(fx.ids().is_empty());
|
||||
assert!(
|
||||
fs::read_to_string(fx.folder.join("a.gpx"))
|
||||
.unwrap()
|
||||
.contains(">a<")
|
||||
);
|
||||
fs::remove_dir_all(other).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opening_the_same_folder_again_changes_nothing() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let folder = fx.folder.clone();
|
||||
let outcome = fx.workspace.open_folder(&mut fx.engine, &folder, true);
|
||||
assert!(!outcome.changed);
|
||||
assert_eq!(fx.ids().len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_failed_save_stops_at_the_file_and_leaves_it_dirty() {
|
||||
let mut fx = Fixture::new();
|
||||
fx.write("a.gpx", "a");
|
||||
fx.open_folder();
|
||||
let id = fx.ids()[0];
|
||||
fx.rename(id, "edited");
|
||||
// the place of the file is taken by a folder
|
||||
fs::remove_file(fx.folder.join("a.gpx")).unwrap();
|
||||
fs::create_dir(fx.folder.join("a.gpx")).unwrap();
|
||||
let result = fx
|
||||
.workspace
|
||||
.save(&mut fx.engine, &[id], &BTreeMap::new(), None);
|
||||
assert!(result.is_err());
|
||||
assert!(fx.workspace.is_dirty(&fx.engine, id));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn saving_as_gives_the_file_another_place() {
|
||||
let mut fx = Fixture::new();
|
||||
let a = fx.write("a.gpx", "a");
|
||||
fx.write("b.gpx", "b");
|
||||
fx.open_folder();
|
||||
let id = fx.id_named("a");
|
||||
let other = fx.id_named("b");
|
||||
fx.rename(id, "edited");
|
||||
|
||||
let target = fx.folder.join("copy.gpx");
|
||||
fx.workspace.save_as(&mut fx.engine, id, &target).unwrap();
|
||||
assert!(fs::read_to_string(&target).unwrap().contains("edited"));
|
||||
assert!(fs::read_to_string(a).unwrap().contains(">a<"));
|
||||
let status = fx.status(id);
|
||||
assert!(!status.dirty);
|
||||
assert_eq!(status.path.as_deref(), canonical(&target).to_str());
|
||||
|
||||
// the place of another open file is not available
|
||||
let taken = fx.folder.join("b.gpx");
|
||||
assert!(fx.workspace.save_as(&mut fx.engine, id, &taken).is_err());
|
||||
assert!(!fx.workspace.is_dirty(&fx.engine, other));
|
||||
}
|
||||
|
||||
mod restart {
|
||||
use gpx_engine::Persister;
|
||||
|
||||
use super::*;
|
||||
use gpx_studio_desktop_lib::store::FileStorage;
|
||||
|
||||
/// What the app does when it starts again: the engine and the links are read from what was
|
||||
/// kept.
|
||||
fn restart(engine: &Engine, workspace: &Workspace, root: &Path) -> (Engine, Workspace) {
|
||||
let storage = FileStorage::open(root).unwrap();
|
||||
pollster::block_on(Persister::default().save(&storage, engine.snapshot())).unwrap();
|
||||
let mut restarted = Engine::default();
|
||||
let restored = pollster::block_on(Persister::default().restore(&storage)).unwrap();
|
||||
restarted.restore(restored);
|
||||
let links = serde_json::to_string(workspace).unwrap();
|
||||
(restarted, serde_json::from_str(&links).unwrap())
|
||||
}
|
||||
|
||||
fn setup() -> (PathBuf, Engine, Workspace, Vec<Uuid>) {
|
||||
let root = std::env::temp_dir().join(format!("gpx-restart-{}", Uuid::new_v4()));
|
||||
let folder = root.join("tracks");
|
||||
fs::create_dir_all(&folder).unwrap();
|
||||
for name in ["with_tracks", "with_time", "with_waypoint"] {
|
||||
let _ = fs::copy(
|
||||
format!("../gpx-rs/data/{name}.gpx"),
|
||||
folder.join(format!("{name}.gpx")),
|
||||
);
|
||||
}
|
||||
let mut engine = Engine::default();
|
||||
let mut workspace = Workspace::default();
|
||||
workspace.open_folder(&mut engine, &folder, false);
|
||||
workspace.open_files(&mut engine, &gpx_files(&folder), false);
|
||||
let ids = engine.order().iter().map(|id| id.0).collect();
|
||||
(root, engine, workspace, ids)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn files_that_were_not_edited_are_not_unsaved_after_a_restart() {
|
||||
let (root, engine, workspace, ids) = setup();
|
||||
assert!(ids.len() >= 2);
|
||||
let (restarted, mut workspace) = restart(&engine, &workspace, &root.join("store"));
|
||||
// the files are the same, but the engine knows their contents by new identities
|
||||
assert!(ids.iter().any(|id| workspace.is_dirty(&restarted, *id)));
|
||||
workspace.verify(&restarted);
|
||||
assert!(ids.iter().all(|id| !workspace.is_dirty(&restarted, *id)));
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn files_that_were_edited_are_still_unsaved_after_a_restart() {
|
||||
let (root, mut engine, workspace, ids) = setup();
|
||||
api::select(&mut engine, &[ids[0]], gpx_engine::SelectMode::Replace);
|
||||
api::metadata(&mut engine, "edited", "");
|
||||
assert!(workspace.is_dirty(&engine, ids[0]));
|
||||
let (restarted, mut workspace) = restart(&engine, &workspace, &root.join("store"));
|
||||
workspace.verify(&restarted);
|
||||
assert!(workspace.is_dirty(&restarted, ids[0]));
|
||||
assert!(
|
||||
ids[1..]
|
||||
.iter()
|
||||
.all(|id| !workspace.is_dirty(&restarted, *id))
|
||||
);
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn links_made_before_the_content_was_kept_are_checked_against_the_disk() {
|
||||
let (root, mut engine, mut workspace, ids) = setup();
|
||||
api::select(&mut engine, &[ids[0]], gpx_engine::SelectMode::Replace);
|
||||
api::metadata(&mut engine, "edited", "");
|
||||
for link in workspace.links.values_mut() {
|
||||
link.export_hash = 0;
|
||||
}
|
||||
let (restarted, mut workspace) = restart(&engine, &workspace, &root.join("store"));
|
||||
workspace.verify(&restarted);
|
||||
assert!(workspace.is_dirty(&restarted, ids[0]));
|
||||
assert!(
|
||||
ids[1..]
|
||||
.iter()
|
||||
.all(|id| !workspace.is_dirty(&restarted, *id))
|
||||
);
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_folders_of_new_files_and_the_old_flag_name_survive_a_restart() {
|
||||
let (root, engine, mut workspace, ids) = setup();
|
||||
let folder = workspace.folder.clone().unwrap();
|
||||
let fresh = Uuid::new_v4();
|
||||
workspace.inherit(&[fresh.to_string()], &folder);
|
||||
workspace.links.get_mut(&ids[0]).unwrap().replaced = true;
|
||||
let json = serde_json::to_string(&workspace).unwrap();
|
||||
// links written by the previous version had `conflict`, which is the same thing
|
||||
let json = json.replace("\"replaced\"", "\"conflict\"");
|
||||
assert!(json.contains("\"conflict\":true"));
|
||||
let read: Workspace = serde_json::from_str(&json).unwrap();
|
||||
assert!(read.links[&ids[0]].replaced);
|
||||
assert_eq!(read.dirs.get(&fresh), Some(&folder));
|
||||
let _ = engine;
|
||||
fs::remove_dir_all(root).unwrap();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
||||
+18
-6
@@ -26,6 +26,9 @@ thread_local! {
|
||||
static PERSISTER: RefCell<Option<Persister>> = const { RefCell::new(None) };
|
||||
static SAVING: Cell<bool> = const { Cell::new(false) };
|
||||
static DIRTY: Cell<bool> = const { Cell::new(false) };
|
||||
/// Whether the last write failed, or was not done because a newer version wrote the storage:
|
||||
/// what the engine holds is then not all stored.
|
||||
static NOT_WRITTEN: Cell<bool> = const { Cell::new(false) };
|
||||
/// Resolve functions of the promises of `flush_storage`.
|
||||
/// Called after the files were written, and when a write was refused because they were
|
||||
/// written by someone else since: see `open_storage`.
|
||||
@@ -73,20 +76,28 @@ pub(crate) fn schedule_save() {
|
||||
let result = persister.save(&*storage, snapshot).await;
|
||||
PERSISTER.with(|slot| *slot.borrow_mut() = Some(persister));
|
||||
match result {
|
||||
Ok(()) => saved = true,
|
||||
Ok(()) => {
|
||||
NOT_WRITTEN.set(false);
|
||||
saved = true;
|
||||
}
|
||||
// nothing was written, so that the files of the other tab are not damaged: this
|
||||
// tab has to read them, which replaces what it did
|
||||
Err(engine::CommitError::Stale { .. }) => {
|
||||
NOT_WRITTEN.set(false);
|
||||
DIRTY.set(false);
|
||||
behind = true;
|
||||
}
|
||||
// nothing is written, so that the newer version finds its data again
|
||||
Err(engine::CommitError::Failed(engine::StorageError::Newer)) => {
|
||||
NOT_WRITTEN.set(true);
|
||||
DIRTY.set(false);
|
||||
newer = true;
|
||||
}
|
||||
// what failed is written with the next change
|
||||
Err(error) => console_error(&error.to_string()),
|
||||
Err(error) => {
|
||||
NOT_WRITTEN.set(true);
|
||||
console_error(&error.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
SAVING.set(false);
|
||||
@@ -188,17 +199,18 @@ pub(crate) fn to_js_error(error: engine::StorageError) -> JsValue {
|
||||
JsValue::from_str(&error.to_string())
|
||||
}
|
||||
|
||||
/// Resolves when what was changed has been written to the storage.
|
||||
/// Resolves when the writes of what was changed are done, to whether they went well. A write that
|
||||
/// was refused because another tab wrote since is fine: this tab then reads what that tab wrote.
|
||||
#[wasm_bindgen]
|
||||
pub async fn flush_storage() -> Result<(), JsValue> {
|
||||
pub async fn flush_storage() -> Result<bool, JsValue> {
|
||||
if !SAVING.get() {
|
||||
return Ok(());
|
||||
return Ok(!NOT_WRITTEN.get());
|
||||
}
|
||||
let promise = js_sys::Promise::new(&mut |resolve, _| {
|
||||
WAITERS.with(|waiters| waiters.borrow_mut().push(resolve));
|
||||
});
|
||||
wasm_bindgen_futures::JsFuture::from(promise).await?;
|
||||
Ok(())
|
||||
Ok(!NOT_WRITTEN.get())
|
||||
}
|
||||
|
||||
/// If another tab wrote the files since this one last did, reads them again and overwrites the
|
||||
|
||||
Generated
+48
@@ -32,6 +32,8 @@
|
||||
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
||||
"@tailwindcss/vite": "^4.1.8",
|
||||
"@tauri-apps/api": "^2.12.3",
|
||||
"@tauri-apps/plugin-process": "^2.4.0",
|
||||
"@tauri-apps/plugin-updater": "^2.14.1",
|
||||
"@types/eslint": "^9.6.1",
|
||||
"@types/events": "^3.0.3",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
@@ -44,6 +46,7 @@
|
||||
"@typescript-eslint/parser": "^8.33.1",
|
||||
"bits-ui": "^2.17.2",
|
||||
"clsx": "^2.1.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"eslint": "^9.28.0",
|
||||
"eslint-config-prettier": "^10.1.5",
|
||||
"eslint-plugin-svelte": "^3.9.1",
|
||||
@@ -354,6 +357,13 @@
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@epic-web/invariant": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
|
||||
"integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.27.7",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",
|
||||
@@ -2659,6 +2669,26 @@
|
||||
"url": "https://opencollective.com/tauri"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/plugin-process": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-process/-/plugin-process-2.4.0.tgz",
|
||||
"integrity": "sha512-GddrmsSLAYrLa/yTXlXK/YRDzUgYeeOnUXTbiyvJWkmI424RmDPD3FVLeqcon7rv6O6ZfhBilcrHWnSo7o6hIQ==",
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@tauri-apps/plugin-updater": {
|
||||
"version": "2.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-updater/-/plugin-updater-2.14.1.tgz",
|
||||
"integrity": "sha512-Hr7nlBm1wT6xbwzjZ/S36YULazu8MNlj5vvOwMl47fXI7HTa5Bjl1PbDEwVHaZTAKzE1VZsUy35UqnbrQxmYQw==",
|
||||
"dev": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/cookie": {
|
||||
"version": "0.6.0",
|
||||
"dev": true,
|
||||
@@ -3275,6 +3305,24 @@
|
||||
"version": "1.0.3",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cross-env": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz",
|
||||
"integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@epic-web/invariant": "^1.0.0",
|
||||
"cross-spawn": "^7.0.6"
|
||||
},
|
||||
"bin": {
|
||||
"cross-env": "dist/bin/cross-env.js",
|
||||
"cross-env-shell": "dist/bin/cross-env-shell.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"dev": true,
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"build:desktop": "BUILD_TARGET=desktop BASE_PATH='' vite build",
|
||||
"build:desktop": "cross-env BUILD_TARGET=desktop BASE_PATH= vite build",
|
||||
"prebuild": "npx tsx src/lib/scripts/pwa-manifest.ts",
|
||||
"postbuild": "npx tsx src/lib/scripts/sitemap.ts",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"pretest": "svelte-kit sync",
|
||||
"test": "node --import tsx --import ./src/test/register.mjs --experimental-wasm-modules --disable-warning=ExperimentalWarning --test \"src/**/*.test.ts\"",
|
||||
"generate:example": "node --import tsx src/lib/scripts/example-statistics.ts",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
@@ -26,6 +27,8 @@
|
||||
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
||||
"@tailwindcss/vite": "^4.1.8",
|
||||
"@tauri-apps/api": "^2.12.3",
|
||||
"@tauri-apps/plugin-process": "^2.4.0",
|
||||
"@tauri-apps/plugin-updater": "^2.14.1",
|
||||
"@types/eslint": "^9.6.1",
|
||||
"@types/events": "^3.0.3",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
@@ -38,6 +41,7 @@
|
||||
"@typescript-eslint/parser": "^8.33.1",
|
||||
"bits-ui": "^2.17.2",
|
||||
"clsx": "^2.1.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"eslint": "^9.28.0",
|
||||
"eslint-config-prettier": "^10.1.5",
|
||||
"eslint-plugin-svelte": "^3.9.1",
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import { BundleType, getBundleType, getVersion } from '@tauri-apps/api/app';
|
||||
import { relaunch } from '@tauri-apps/plugin-process';
|
||||
import { check, type Update } from '@tauri-apps/plugin-updater';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { engine } from '$lib/engine';
|
||||
import { i18n } from '$lib/i18n/i18n.svelte';
|
||||
|
||||
/** Where the `.deb` and `.rpm` packages can be downloaded, as they do not update themselves. */
|
||||
const releases = 'https://github.com/gpxstudio/gpx.studio/releases/latest';
|
||||
|
||||
/**
|
||||
* Offers the update, if there is one. The app does not restart by itself, as it would interrupt
|
||||
* the user. The beta versions are not updated, as they would be replaced by the stable release.
|
||||
*/
|
||||
export async function checkForUpdates() {
|
||||
if (import.meta.env.DEV || (await getVersion()).includes('-')) {
|
||||
return;
|
||||
}
|
||||
const update = await check().catch((error) => {
|
||||
// most likely offline: it will be checked again the next time the app starts
|
||||
console.warn('Could not check for updates', error);
|
||||
return null;
|
||||
});
|
||||
if (update === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const message = i18n._('desktop.update_available').replace('{version}', update.version);
|
||||
const bundle = await getBundleType();
|
||||
if (bundle === BundleType.Deb || bundle === BundleType.Rpm) {
|
||||
toast.info(message, {
|
||||
duration: Number.POSITIVE_INFINITY,
|
||||
action: {
|
||||
label: i18n._('desktop.update_download'),
|
||||
onClick: () => engine.openUrl(releases),
|
||||
},
|
||||
});
|
||||
} else {
|
||||
toast.info(message, {
|
||||
duration: Number.POSITIVE_INFINITY,
|
||||
action: {
|
||||
label: i18n._('desktop.update_restart'),
|
||||
onClick: () => install(update),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function install(update: Update) {
|
||||
const installing = toast.loading(i18n._('desktop.update_installing'));
|
||||
try {
|
||||
await update.downloadAndInstall();
|
||||
await relaunch();
|
||||
} catch (error) {
|
||||
console.error('Could not install the update', error);
|
||||
toast.error(i18n._('desktop.update_failed'), { id: installing });
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ By right-clicking on a file tab, you can access the same actions as in the [edit
|
||||
|
||||
As mentioned in the [view options section](./menu/view), you can switch to a tree layout for the files list.
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
You can also apply [edit actions](./menu/edit) and [tools](./toolbar) to internal file items.
|
||||
Furthermore, you can drag and drop the inner items to reorder them, or move them in the hierarchy or even to another file.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: Фармат файла GPX
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
<a href="https://www.topografix.com/gpx.asp" target="_blank">Фармат файла GPX</a> - гэта адкрыты стандарт для абмену дадзенымі GPS паміж праграмамі і прыладамі GPS.
|
||||
Па сутнасці, ён складаецца з серыі кропак GPS, якія кадзіруюць адну або некалькі слядоў GPS, і, па жаданні, некаторыя кропкі цікавасці.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
Файлы GPX могуць таксама ўтрымліваць метададзеныя, з якіх палі **імя** і **апісанне** найбольш карысныя для карыстальнікаў.
|
||||
|
||||
@@ -27,6 +29,20 @@ title: Фармат файла GPX
|
||||
У большасці выпадкаў файлы GPX утрымліваюць адзін трэк з адным сегментам.
|
||||
Аднак іерархія, апісаная вышэй, дазваляе выкарыстоўваць больш складаныя выпадкі, напрыклад, планаваць шматдзённыя паездкі з некалькімі варыянтамі на кожны дзень.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Кропкі цікавасці
|
||||
|
||||
**Кропкі цікавасці** (тэхнічна званыя _маршрутнымі кропкамі_) уяўляюць цікавыя месцы, якія можна паказаць альбо на прыладзе GPS, альбо на лічбавай карце.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Edit actions
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Unlike the file actions, the edit actions can potentially modify the content of the currently selected files.
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, and points of interest](../gpx).
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Therefore, we will refer to the elements that can be modified by these actions as _file items_.
|
||||
Note that except for the undo and redo actions, the edit actions are also accessible through the context menu (right-click) of the file items.
|
||||
|
||||
@@ -27,10 +27,6 @@ Open the information dialog of the currently selected file item, where you can s
|
||||
|
||||
Open the appearance dialog, where you can change the color, opacity, and width of the selected file items on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New track
|
||||
|
||||
Create a new track in the selected file.
|
||||
@@ -42,6 +38,17 @@ Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
This action is only available when the tree layout of the files list is enabled.
|
||||
Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New segment
|
||||
|
||||
Create a new segment in the selected track.
|
||||
@@ -53,14 +60,17 @@ Additionally, the selection must be a single track.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Select all
|
||||
|
||||
Add all file items in the current hierarchy level to the selection.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Copy
|
||||
|
||||
Copy the selected file items to the clipboard.
|
||||
|
||||
@@ -15,6 +15,10 @@ The file actions menu contains a set of pretty self-explanatory file operations.
|
||||
|
||||
Create a new empty file.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Open...
|
||||
|
||||
Open files from your computer.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: View options
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Hide the elevation profile to make room for the map, or show it to inspect the c
|
||||
|
||||
Toggle the tree layout for the [file list](../files-and-stats).
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Switch to previous basemap
|
||||
|
||||
@@ -38,6 +38,14 @@ They are displayed for the current selection, like the [elevation profile](../fi
|
||||
|
||||
Toggle the visibility of direction arrows on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Toggle 3D
|
||||
|
||||
Enter or exit the 3D map view.
|
||||
|
||||
@@ -16,7 +16,7 @@ This tool allows you to extract [tracks (or segments)](../gpx) from files (or tr
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Applying the tool to a file containing multiple tracks will create a new file for each of the tracks it contains.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Similarly, applying the tool to a track containing multiple segments will create (in the same file) a new track for each of the segments it contains.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Merge
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, or segments](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- If your goal is to create a single continuous trace from your selection, use the **Connect the traces** option and validate.
|
||||
- The second option can be used to create or manage files with multiple [tracks or segments](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks (or segments) from the selection.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ To split the selected trace into two parts, click on one of the split markers di
|
||||
To split at a specific point of your choice, hover over the trace on the map.
|
||||
Scissors will appear at the cursor position, showing that you can split the trace at that point.
|
||||
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks or segments](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Hovering over the selected trace turns your cursor into scissors." />
|
||||
@@ -51,7 +51,7 @@ Clicant el botó dret en la pestanya d'un arxiu, pots accedir a les mateixes acc
|
||||
|
||||
Tal i com es menciona en la [secció d'opcions de vista](./menu/view), pots canviar a un esquema d'arbre per a la llista d'arxius.
|
||||
Aquesta disposició és ideal per tal d'administrar un gran nombre d'arxius oberts, ja que els organitza en una llista vertical en la part dreta del mapa.
|
||||
A més, la vista d'arbre d'arxius permet inspeccionar [tracs, segments i punts d'interès](./gpx) continguts dins dels arxius a través de seccions plegables.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
També pots aplicar [accions d'edició](./menu/edit) i [eines](./toolbar) a elements interns de l'arxiu.
|
||||
A més, pots arrossegar i deixar anar els elements interns per reordenar-los, o moure'ls en la jerarquia o fins i tot a un altre arxiu.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: Format d'arxiu GPX
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
El <a href="https://www.topografix.com/gpx.asp" target="_blank">format d'arxiu GPX</a> és un estàndard obert per intercanviar dades GPS entre aplicacions i aparells GPS.
|
||||
Bàsicament consisteix en una sèrie de punts GPS que codifiquen una o diverses traces GPS i, opcionalment, alguns punts d'interès.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
Els arxius GPX poden contenir també metadades, de les quals els camps **nom** i **descripció** són els més útils pels usuaris.
|
||||
|
||||
@@ -27,6 +29,20 @@ Aquests estan organitzats en una estructura jeràrquica, amb els tracs en el niv
|
||||
En la majoria dels casos, els arxius GPX contenen un sol trac amb un sol segment.
|
||||
Tanmateix, la jerarquia descrita a dalt permet casos d'ús més avançat, com la planificació de viatges de diversos dies amb variants per cada dia.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Punts d'interès
|
||||
|
||||
**Punts d'interès** (tècnicament anomenats _waypoints_) representen ubicacions d'interès per mostrar en un dispositiu GPS o en mapa digital.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Accions d'edició
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
A diferència de les accions de l'arxiu, les accions d'edició poden potencialment modificar el contingut dels arxius seleccionats actualment.
|
||||
A més a més, quan està habilitada la disposició de l'arbre de la llista d'arxius (veure [Arxius i estadístiques](../files-and-stats)), també es poden aplicar a [tracs, segments i punts d'interès](../gpx).
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Per tant, ens referirem als elements que poden ser modificats per aquestes accions com a _elements d'arxiu_.
|
||||
Tingui en compte que excepte per a les accions de desfer i refer, les accions d'edició també són accessibles a través del menú contextual (clic dret) dels elements de l'arxiu.
|
||||
|
||||
@@ -27,10 +27,6 @@ Obre el quadre de diàleg d'informació de l'element de l'arxiu seleccionat, on
|
||||
|
||||
Obre el diàleg d'aparença, on pots canviar el color, l'opacitat i l'amplada del mapa dels elements de l'arxiu seleccionat.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Amaga/mostra
|
||||
|
||||
Alterna la visibilitat dels elements de l'arxiu seleccionat en el mapa.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Nou trac
|
||||
|
||||
Crear nova ruta en l'arxiu seleccionat.
|
||||
@@ -42,6 +38,17 @@ A més, la selecció ha de ser un únic arxiu.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Aquesta acció només està disponible quan està habilitada la disposició de l'arbre de la llista d'arxius.
|
||||
A més, la selecció ha de ser un únic arxiu.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Nou segment
|
||||
|
||||
Crear un nou segment en el trac seleccionat.
|
||||
@@ -53,14 +60,17 @@ A més, la selecció ha de ser un trac únic.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Selecciona tot
|
||||
|
||||
Afegeix a la selecció tots els elements de l'arxiu en el nivell de jerarquia actual.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Centrar
|
||||
|
||||
Centrar el mapa en els elements de l'arxiu seleccionat.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Copia
|
||||
|
||||
Copia els elements de l'arxiu seleccionat en el porta-retalls.
|
||||
|
||||
@@ -15,6 +15,10 @@ El menú d'accions d'arxiu conté un conjunt d'operacions força autoexplicative
|
||||
|
||||
Crea un arxiu nou buit.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Obrir...
|
||||
|
||||
Obrir arxius del teu equip.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Opcions de vista
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Amagar el perfil d'elevació per fer espai al mapa o mostra-lo per inspeccionar
|
||||
|
||||
Alterna el disseny de l'arbre per la [llista d'arxius](../files-and-stats).
|
||||
Aquesta disposició és ideal per tal d'administrar un gran nombre d'arxius oberts, ja que els organitza en una llista vertical en la part dreta del mapa.
|
||||
A més, la vista de l'arbre d'arxius permet inspeccionar [tracs, segments i punts d'interès](../gpx) continguts en els arxius a través de les seccions plegables.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Canvia la mapa base anterior
|
||||
|
||||
@@ -38,6 +38,14 @@ Es mostren per a la selecció actual, com el [perfil d'elevació](../files-and-s
|
||||
|
||||
Alterna la visibilitat de les fletxes de direcció en el mapa.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Alternar 3D
|
||||
|
||||
Entra o surt de la vista de mapa en 3D.
|
||||
|
||||
@@ -16,7 +16,7 @@ Aquesta eina permet extreure [tracs (o segments)](../gpx) des d'arxius (o tracs)
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Aplicant l'eina a un arxiu que contingui múltiples tracs, crearà un arxiu nou per cada trac que contingui.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Igualment, aplicant l'eina a un trac que contingui múltiples segments, crearà (en el mateix arxiu) un nou trac per cada un dels segments que contingui.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Fusionar
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
Per utilitzar aquesta eina, s'ha de [seleccionar](../files-and-stats) múltiples arxius, [tracs o segments](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- Si el teu objectiu és crear una traça contínua a partir de la selecció, utilitza l'opció **Connectar les traces** i valida-ho.
|
||||
- La segona opció es pot utilitzar per a crear o gestionar arxius amb múltiples [tracs o segments](../gpx).
|
||||
Fusionar arxius (o tracs) crearà un sol arxiu (o trac) que contindrà tots els tracs (o segments) seleccionats.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ Per dividir la traça seleccionada en dues parts, clica sobre un dels marcadors
|
||||
Per dividir en un punt triat específicament, situat sobre la traça del mapa.
|
||||
Les tisores apareixeran en la posició del cursor, mostrant que pots dividir el traçat en aquest punt.
|
||||
|
||||
Pots triar dividir el traçat en dos arxius GPX o mantenir les parts dividides en el mateix arxiu com a [tracs o segments](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Situar el cursor sobre el traçat seleccionat el converteix en tisores." />
|
||||
@@ -51,7 +51,7 @@ Kliknutím pravým tlačítkem myši na kartu souboru můžete provést stejné
|
||||
|
||||
Jak je uvedeno v části [možnosti zobrazení](./menu/view), můžete přepnout na stromové rozvržení seznamu souborů.
|
||||
Toto zobrazení je ideální pro správu velkého počtu otevřených souborů, protože je uspořádá do svislého seznamu na pravé straně mapy.
|
||||
Stromové rozvržení souborů navíc umožňuje zkontrolovat [trasy, úseky a body zájmu](./gpx) obsažené v souborech prostřednictvím sbalitelných sekcí.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
Rovněž můžete využít [akce úprav](./menu/edit) a [nástroje](./toolbar) na prvky uvnitř souborů.
|
||||
Navíc přetažením prvků uvnitř souborů můžete změnit jejich pořadí nebo je přesunout v hierarchii či dokonce do jiného souboru.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: Formát souboru GPX
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
<a href="https://www.topografix.com/gpx.asp" target="_blank">GPX formát</a> je otevřeným standardem pro výměnu GPS dat mezi aplikacemi a GPS zařízeními.
|
||||
V podstatě se skládá z řady GPS bodů kódujících jednu nebo více GPS stop a volitelně i nějaké body zájmu.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
GPX soubory mohou obsahovat také metadata, z nichž pole **název** a **popis** jsou pro uživatele nejužitečnější.
|
||||
|
||||
@@ -27,6 +29,20 @@ Ty jsou uspořádány v hierarchické struktuře, přičemž trasy jsou na nejvy
|
||||
Ve většině případů obsahují GPX soubory pouze jednu trasu s jedním úsekem.
|
||||
Nicméně výše popsaná hierarchie umožňuje pokročilejší případy použití, například plánování vícedenních výletů s několika variantami pro každý den.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Body zájmu
|
||||
|
||||
**Body zájmu** (odborně nazývané _waypoints_) představují zajímavá místa, která se zobrazí buď na zařízení GPS, nebo na digitální mapě.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Akce úprav
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Na rozdíl od akcí v menu Soubor, mohou akce úprav potenciálně změnit obsah aktuálně vybraných souborů.
|
||||
Navíc pokud je povoleno rozvržení stromu seznamu souborů (viz [Soubory a statistiky](../files-and-stats)), mohou být také použity na [trasy, segmenty a body zájmu](../gpx).
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Proto budeme všechny prvky, které mohou být těmito akcemi upraveny, označovat jako _prvky souborů_.
|
||||
Všechny akce kromě zpět a opakovat jsou také dostupné z kontextového menu (klik pravým tlačítkem) prvků souborů.
|
||||
|
||||
@@ -27,10 +27,6 @@ Otevře informační dialog zvoleného prvku souborů, kde lze zobrazit a změni
|
||||
|
||||
Otevře dialog vzhledu, kde můžete změnit barvu, neprůhlednost a tloušťku zvolených prvků souborů v mapě.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Skrýt/zobrazit
|
||||
|
||||
Přepnout viditelnost zvolených prvků souborů v mapě.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Nová trasa
|
||||
|
||||
Vytvořit novou trasu ve zvoleném souboru.
|
||||
@@ -42,6 +38,17 @@ Kromě toho musí být vybrán právě jeden soubor.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Tato akce je dostupná pouze v případě, že je povoleno rozvržení stromu seznamu souborů.
|
||||
Kromě toho musí být vybrán právě jeden soubor.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Nový úsek
|
||||
|
||||
Vytvořit nový úsek na zvolené trase.
|
||||
@@ -53,14 +60,17 @@ Kromě toho musí být zvolena právě jedna trasa.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Vybrat vše
|
||||
|
||||
Přidejte k výběru všechny prvky souborů v dané úrovni hierarchie.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Vycentrovat
|
||||
|
||||
Vystředí mapu na označené prvky souborů.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Kopírovat
|
||||
|
||||
Zkopíruje zvolené prvky souborů do schránky.
|
||||
|
||||
@@ -15,6 +15,10 @@ Menu akce souboru obsahuje sadu poměrně samovysvětlujících operací.
|
||||
|
||||
Vytvořit nový prázdný soubor.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Otevřít...
|
||||
|
||||
Otevřít soubor z vašeho počítače.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Možnosti zobrazení
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Skrýt výškový profil, aby se vytvořilo místo pro mapu, nebo ho zobrazit a
|
||||
|
||||
Přepnout rozvržení stromu pro [seznam souborů](../files-and-stats).
|
||||
Toto zobrazení je ideální pro správu velkého počtu otevřených souborů, protože je uspořádá do svislého seznamu na pravé straně mapy.
|
||||
Kromě jiného umožňuje zobrazení stromu souborů zkontrolovat [trasy, segmenty, a body zájmu](../gpx) obsažené uvnitř souborů skrze sbalitelné sekce.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Přepnout na předchozí základní mapu
|
||||
|
||||
@@ -38,6 +38,14 @@ Zobrazují se pro aktuální výběr, jako je [výškový profil](../files-and-s
|
||||
|
||||
Přepnout viditelnost směrových šipek na mapě.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Přepnout 3D
|
||||
|
||||
Zapnout nebo vypnout 3D zobrazení mapy.
|
||||
|
||||
@@ -16,7 +16,7 @@ Tento nástroj umožňuje extrahovat [trasy (nebo úseky)](../gpx) ze souborů (
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Použití nástroje na soubor obsahující více tras vytvoří nový soubor pro každou z tras, kterou obsahuje.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Obdobně použití nástroje na trasu obsahující více úseků vytvoří (ve stejném souboru) novou trasu pro každý úsek, který obsahuje.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Sloučit
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
Chcete-li použít tento nástroj, musíte [vybrat](../files-and-stats) více souborů, [tras nebo segmentů](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- Pokud je vaším cílem vytvořit z vašeho výběru jednu spojitou stopu, použijte možnost **Připojit stopy** a potvrďte.
|
||||
- Druhá možnost může být použita k vytvoření nebo správě souborů s více [trasami nebo segmenty](../gpx).
|
||||
Sloučením souborů (nebo tras) vznikne jeden soubor (nebo trasa) obsahující všechny trasy (nebo úseky) z výběru.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ Chcete-li rozdělit vybranou stopu na dvě části, klikněte na jednu z rozděl
|
||||
Chcete-li rozdělit stopu v určitém bodě dle vašeho výběru, najeďte nad stopu na mapě.
|
||||
Na pozici kurzoru se objeví nůžky, což znázorňuje, že v tomto bodě můžete stopu rozdělit.
|
||||
|
||||
Můžete zvolit rozdělení stopy na dva GPX soubory, nebo uchovat rozdělené části ve stejném souboru jako [trasy nebo segmenty](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Najetí kurzorem nad vybranou stopu změní kurzor v nůžky." />
|
||||
@@ -51,7 +51,7 @@ By right-clicking on a file tab, you can access the same actions as in the [edit
|
||||
|
||||
As mentioned in the [view options section](./menu/view), you can switch to a tree layout for the files list.
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
You can also apply [edit actions](./menu/edit) and [tools](./toolbar) to internal file items.
|
||||
Furthermore, you can drag and drop the inner items to reorder them, or move them in the hierarchy or even to another file.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: GPX file format
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
The <a href="https://www.topografix.com/gpx.asp" target="_blank">GPX file format</a> is an open standard for exchanging GPS data between applications and GPS devices.
|
||||
It essentially consists of a series of GPS points encoding one or multiple GPS traces, and, optionally, some points of interest.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
GPX files may also contain metadata, of which the **name** and **description** fields are the most useful for users.
|
||||
|
||||
@@ -27,6 +29,20 @@ These are organized in a hierarchical structure, with tracks at the top level.
|
||||
In most cases, GPX files contain a single track with a single segment.
|
||||
However, the hierarchy described above allows for more advanced use cases, such as planning multi-day trips with several variants for each day.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Points of interest
|
||||
|
||||
**Points of interest** (technically called _waypoints_) represent locations of interest to show either on a GPS device or on a digital map.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Edit actions
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Unlike the file actions, the edit actions can potentially modify the content of the currently selected files.
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, and points of interest](../gpx).
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Therefore, we will refer to the elements that can be modified by these actions as _file items_.
|
||||
Note that except for the undo and redo actions, the edit actions are also accessible through the context menu (right-click) of the file items.
|
||||
|
||||
@@ -27,10 +27,6 @@ Open the information dialog of the currently selected file item, where you can s
|
||||
|
||||
Open the appearance dialog, where you can change the color, opacity, and width of the selected file items on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New track
|
||||
|
||||
Create a new track in the selected file.
|
||||
@@ -42,6 +38,17 @@ Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
This action is only available when the tree layout of the files list is enabled.
|
||||
Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New segment
|
||||
|
||||
Create a new segment in the selected track.
|
||||
@@ -53,14 +60,17 @@ Additionally, the selection must be a single track.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Select all
|
||||
|
||||
Add all file items in the current hierarchy level to the selection.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Kopier
|
||||
|
||||
Copy the selected file items to the clipboard.
|
||||
|
||||
@@ -15,6 +15,10 @@ The file actions menu contains a set of pretty self-explanatory file operations.
|
||||
|
||||
Create a new empty file.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Open...
|
||||
|
||||
Open files from your computer.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: View options
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Hide the elevation profile to make room for the map, or show it to inspect the c
|
||||
|
||||
Toggle the tree layout for the [file list](../files-and-stats).
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Switch to previous basemap
|
||||
|
||||
@@ -38,6 +38,14 @@ They are displayed for the current selection, like the [elevation profile](../fi
|
||||
|
||||
Toggle the visibility of direction arrows on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Toggle 3D
|
||||
|
||||
Enter or exit the 3D map view.
|
||||
|
||||
@@ -16,7 +16,7 @@ This tool allows you to extract [tracks (or segments)](../gpx) from files (or tr
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Applying the tool to a file containing multiple tracks will create a new file for each of the tracks it contains.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Similarly, applying the tool to a track containing multiple segments will create (in the same file) a new track for each of the segments it contains.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Merge
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, or segments](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- If your goal is to create a single continuous trace from your selection, use the **Connect the traces** option and validate.
|
||||
- The second option can be used to create or manage files with multiple [tracks or segments](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks (or segments) from the selection.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ To split the selected trace into two parts, click on one of the split markers di
|
||||
To split at a specific point of your choice, hover over the trace on the map.
|
||||
Scissors will appear at the cursor position, showing that you can split the trace at that point.
|
||||
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks or segments](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Hovering over the selected trace turns your cursor into scissors." />
|
||||
@@ -51,7 +51,7 @@ Wenn du mit der rechten Maustaste auf einen Datei-Tab klickst, kannst du auf die
|
||||
|
||||
Wie schon in den Anzeigeoptionen (/Menü/Ansicht) erwähnt, kann man das Layout des Dateibaums für die Dateienliste anpassen.
|
||||
Dieses Layout eignet sich am besten um für eine große Anzahl von Dateien, da es diese in einer vertikalen Liste auf der rechten Seite der Karte anordnet.
|
||||
Darüber hinaus ermöglicht die Dateibaumansicht die Prüfung der [Tracks, Segmente, und Punkte von Interesse](./gpx), die in den Dateien durch zusammenklappbare Abschnitte enthalten sind.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
Du kannst auch [Bearbeiten von Aktionen](./menu/edit) und [tools](./toolbar) auf interne Dateielemente anwenden.
|
||||
Außerdem können Sie die inneren Elemente per Drag & Drop verschieben, um sie neu zu ordnen oder in die Hierarchie oder sogar in eine andere Datei zu verschieben.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: GPX Dateiformat
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Das <a href="https://www.topografix.com/gpx.asp" target="_blank">GPX-Dateiformat</a> ist ein offener Standard für den Austausch von GPS-Daten zwischen Anwendungen und GPS-Geräten.
|
||||
Es besteht im Wesentlichen aus einer Serie von GPS-Punkten, die einen oder mehrere GPS-Spuren kodieren, und optional aus einigen interessanten Punkten.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
GPX-Dateien können auch Metadaten enthalten, von denen die Felder **Name** und **Beschreibung** für Benutzer am nützlichsten sind.
|
||||
|
||||
@@ -27,6 +29,20 @@ Diese sind in einer hierarchischen Struktur mit Spuren auf der obersten Ebene or
|
||||
In den meisten Fällen enthalten GPX-Dateien einen einzigen Track mit einem Segment.
|
||||
Die oben beschriebene Hierarchie erlaubt jedoch weitergehende Anwendungsfälle, wie zum Beispiel die Planung von Mehrtagestouren mit mehreren Varianten pro Tag.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Punkte von Interesse
|
||||
|
||||
**Points of Interessive** (technisch genannt _Wegpunkte_) stellen Orte dar, die auf einem GPS-Gerät oder auf einer digitalen Karte angezeigt werden.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Bearbeite Aktionen
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Im Gegensatz zu den Datei-Aktionen können die Bearbeitungs-Aktionen möglicherweise den Inhalt der aktuell ausgewählten Dateien verändern.
|
||||
Wenn das vertikale Layout der Dateiliste aktiviert ist (siehe [Dateien und Statistik](.. /files-and-stats)), können dieses auch auf [Tracks, Segmente und Points-of-Interest](../gpx) angewendet werden.
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Daher bezeichnen wir die Elemente, die durch diese Aktionen geändert werden können, als _file items_.
|
||||
Beachte, dass die Bearbeitungsaktionen auch über das Kontextmenü (Rechtsklick) der Dateielemente zugänglich sind, ausgenommen von "rückgängig" und "wiederholen".
|
||||
|
||||
@@ -27,10 +27,6 @@ Dies gilt für alle Aktionen der Bedienoberfläche, aber nicht für Optionen, An
|
||||
|
||||
Öffnen Sie das Dialogfeld Darstellung, in der Sie die Farbe, Deckkraft und Breite der ausgewählten Dateielemente auf der Karte ändern können.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Einblenden/Ausblenden
|
||||
|
||||
Konfigurieren Sie die Sichtbarkeit der ausgewählten Dateielemente auf der Karte.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Neuer Track
|
||||
|
||||
Erstelle ein neues Segment im ausgewählten Track.
|
||||
@@ -42,6 +38,17 @@ Außerdem muss die Auswahl aus einem einzelnen Track bestehen.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Diese Aktion ist nur verfügbar, wenn das vertikale Layout der Dateiliste aktiviert ist.
|
||||
Außerdem muss die Auswahl aus einem einzelnen Track bestehen.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Neues Segment
|
||||
|
||||
Erstelle ein neues Segment im ausgewählten Track.
|
||||
@@ -53,14 +60,17 @@ Außerdem muss die Auswahl aus einem einzelnen Track bestehen.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Alle auswählen
|
||||
|
||||
Alle Dateielemente in der aktuellen Hierarchieebene zur Auswahl hinzufügen.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Zentrieren
|
||||
|
||||
Zentrieren der Karte auf den ausgewählten Dateielementen.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Kopieren
|
||||
|
||||
Kopieren Sie die ausgewählten Dateielemente in die Zwischenablage.
|
||||
|
||||
@@ -15,6 +15,10 @@ Das Aktionsmenü Datei enthält eine Reihe von selbsterklärenden Dateioperation
|
||||
|
||||
Neue leere Datei erstellen.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Öffnen...
|
||||
|
||||
Öffne Dateien von Ihrem Computer.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Anzeigeoptionen
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Das Höhenprofil ausblenden, um Platz für die Karte zu schaffen, oder um die ak
|
||||
|
||||
Umschalten des vertikalen Layouts für die [Dateiliste](../files-and-stats).
|
||||
Dieses Layout eignet sich am besten um für eine große Anzahl von Dateien, da es diese in einer vertikalen Liste auf der rechten Seite der Karte anordnet.
|
||||
Darüber hinaus ermöglicht die Dateibaumansicht die Prüfung der [Tracks, Segmente, und Punkte von Interesse](../gpx), die in den Dateien durch zusammenklappbare Abschnitte enthalten sind.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Wechseln zur vorherigen Basiskarte
|
||||
|
||||
@@ -38,6 +38,14 @@ Sie werden für die aktuelle Auswahl angezeigt, wie in [elevation profile](../fi
|
||||
|
||||
Schaltet die Sichtbarkeit der Richtungspfeile auf der Karte um.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> 3D Ein/Aus
|
||||
|
||||
Aufrufen oder Beenden der 3D-Kartenansicht.
|
||||
|
||||
@@ -19,6 +19,6 @@ Mit diesem Tool kannst du Höhendaten zu Routen und [Points of Interest] (../gpx
|
||||
<DocsNote>
|
||||
|
||||
Elevation data is provided by <a href="https://mapterhorn.com" target="_blank">Mapterhorn</a>.
|
||||
You can learn more about its origin and accuracy in the <a href="https://mapterhorn.com/attribution/" target="_blank">documentation</a>.
|
||||
Mehr über die Herkunft und Genauigkeit erfährst du in der <a href="https://mapterhorn.com/attribution/" target="_blank">Dokumentation</a>.
|
||||
|
||||
</DocsNote>
|
||||
@@ -16,7 +16,7 @@ Dieses Werkzeug ermöglicht Ihnen [Tracks (oder Segmente)](../gpx) von Dateien (
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Wenn Sie das Werkzeug auf eine Datei mit mehreren enthaltenen Tracks anwenden, wird für jeden der darin enthaltenen Tracks eine neue Datei erstellt.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Gleichermaßen gilt: wenn du das Werkzeug auf einen Track anwendest, der mehrere Segmente enthält, wird (in derselben Datei) ein neuer Track für jedes der darin enthaltenen Segmente erstellt.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Zusammenfügen
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
Um dieses Tool nutzen zu können, musst du [select](../files-and-stats) mehrere Dateien, [Tracks oder Segmente](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- Wenn Ihr Ziel darin besteht, eine einzige kontinuierliche Spur aus Ihrer Auswahl zu erstellen, verwenden Sie die Option **Verbinden Sie die Spuren** und validieren Sie sie.
|
||||
- Die zweite Option kann verwendet werden, um Dateien mit mehreren [Tracks oder Segments](../gpx) zu erstellen oder zu verwalten.
|
||||
Das Zusammenführen von Dateien (oder Tracks) führt zu einer einzigen Datei (oder Track), die alle Tracks (oder Segmente) aus der Auswahl enthält.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ Um die ausgewählte Spur in zwei Teile aufzuteilen, klicken Sie auf einen der ge
|
||||
Um sich an einem bestimmten Punkt Ihrer Wahl zu teilen, fahren Sie über die Spur auf der Karte.
|
||||
Schere werden an der Cursorposition angezeigt, so dass Sie die Spur an diesem Punkt teilen können.
|
||||
|
||||
Du kannst die Trace in zwei GPX-Dateien aufteilen oder die Teile in der gleichen Datei wie [Tracks oder Segmente](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Über dem ausgewählten Pfad schweben verwandelt den Cursor in Scheren." />
|
||||
@@ -51,7 +51,7 @@ By right-clicking on a file tab, you can access the same actions as in the [edit
|
||||
|
||||
As mentioned in the [view options section](./menu/view), you can switch to a tree layout for the files list.
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
You can also apply [edit actions](./menu/edit) and [tools](./toolbar) to internal file items.
|
||||
Furthermore, you can drag and drop the inner items to reorder them, or move them in the hierarchy or even to another file.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: GPX file format
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
The <a href="https://www.topografix.com/gpx.asp" target="_blank">GPX file format</a> is an open standard for exchanging GPS data between applications and GPS devices.
|
||||
It essentially consists of a series of GPS points encoding one or multiple GPS traces, and, optionally, some points of interest.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
GPX files may also contain metadata, of which the **name** and **description** fields are the most useful for users.
|
||||
|
||||
@@ -27,6 +29,20 @@ These are organized in a hierarchical structure, with tracks at the top level.
|
||||
In most cases, GPX files contain a single track with a single segment.
|
||||
However, the hierarchy described above allows for more advanced use cases, such as planning multi-day trips with several variants for each day.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Points of interest
|
||||
|
||||
**Points of interest** (technically called _waypoints_) represent locations of interest to show either on a GPS device or on a digital map.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Edit actions
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Unlike the file actions, the edit actions can potentially modify the content of the currently selected files.
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, and points of interest](../gpx).
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Therefore, we will refer to the elements that can be modified by these actions as _file items_.
|
||||
Note that except for the undo and redo actions, the edit actions are also accessible through the context menu (right-click) of the file items.
|
||||
|
||||
@@ -27,10 +27,6 @@ Open the information dialog of the currently selected file item, where you can s
|
||||
|
||||
Open the appearance dialog, where you can change the color, opacity, and width of the selected file items on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New track
|
||||
|
||||
Create a new track in the selected file.
|
||||
@@ -42,6 +38,17 @@ Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
This action is only available when the tree layout of the files list is enabled.
|
||||
Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New segment
|
||||
|
||||
Create a new segment in the selected track.
|
||||
@@ -53,14 +60,17 @@ Additionally, the selection must be a single track.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Select all
|
||||
|
||||
Add all file items in the current hierarchy level to the selection.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Copy
|
||||
|
||||
Copy the selected file items to the clipboard.
|
||||
|
||||
@@ -15,6 +15,10 @@ The file actions menu contains a set of pretty self-explanatory file operations.
|
||||
|
||||
Create a new empty file.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Open...
|
||||
|
||||
Open files from your computer.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: View options
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Hide the elevation profile to make room for the map, or show it to inspect the c
|
||||
|
||||
Toggle the tree layout for the [file list](../files-and-stats).
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Switch to previous basemap
|
||||
|
||||
@@ -38,6 +38,14 @@ They are displayed for the current selection, like the [elevation profile](../fi
|
||||
|
||||
Toggle the visibility of direction arrows on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Toggle 3D
|
||||
|
||||
Enter or exit the 3D map view.
|
||||
|
||||
@@ -16,7 +16,7 @@ This tool allows you to extract [tracks (or segments)](../gpx) from files (or tr
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Applying the tool to a file containing multiple tracks will create a new file for each of the tracks it contains.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Similarly, applying the tool to a track containing multiple segments will create (in the same file) a new track for each of the segments it contains.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Merge
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, or segments](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- If your goal is to create a single continuous trace from your selection, use the **Connect the traces** option and validate.
|
||||
- The second option can be used to create or manage files with multiple [tracks or segments](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks (or segments) from the selection.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ To split the selected trace into two parts, click on one of the split markers di
|
||||
To split at a specific point of your choice, hover over the trace on the map.
|
||||
Scissors will appear at the cursor position, showing that you can split the trace at that point.
|
||||
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks or segments](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Hovering over the selected trace turns your cursor into scissors." />
|
||||
@@ -67,12 +67,6 @@ Since a route has a single segment, a track with multiple segments is converted
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Except for whole files, this action is only available when the tree layout of the files list is enabled.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Select all
|
||||
|
||||
Add all file items in the current hierarchy level to the selection.
|
||||
|
||||
@@ -51,7 +51,7 @@ Al hacer clic con el botón derecho en una pestaña de archivo, puede acceder a
|
||||
|
||||
Como se mencionó en la [sección de opciones de vista](./menu/view), puede cambiar a un esquema de árbol para la lista de archivos.
|
||||
Esta disposición es ideal para administrar un gran número de archivos abiertos ya que los organiza en una lista vertical en la parte derecha del mapa.
|
||||
Además, la vista de árbol de archivos permite inspeccionar [pistas, segmentos y puntos de interés](./gpx) contenidos dentro de los archivos a través de secciones plegables.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
También puede aplicar [acciones de edición](./menu/edit) y [herramientas](./toolbar) a los elementos internos del archivo.
|
||||
Además, puede arrastrar y soltar los elementos internos para reordenarlos, o moverlos dentro de la jerarquía o incluso a otro archivo.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: Formato de archivo GPX
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
El <a href="https://www.topografix.com/gpx.asp" target="_blank">formato de archivo GPX</a> es un estándar abierto para el intercambio de datos GPS entre aplicaciones y dispositivos GPS.
|
||||
Consiste esencialmente en una serie de puntos GPS que codifican uno o varios trazados GPS y, opcionalmente, algunos puntos de interés.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
Los archivos GPX también pueden contener metadatos, de los cuales los campos **nombre** y **descripción** son los más útiles para los usuarios.
|
||||
|
||||
@@ -27,6 +29,20 @@ Como se mencionó anteriormente, un archivo GPX puede contener múltiples trazad
|
||||
En la mayoría de los casos, los archivos GPX contienen una sola pista con un solo segmento.
|
||||
Sin embargo, la jerarquía descrita anteriormente permite casos de uso más avanzados, como la planificación de viajes de varios días con varias variantes para cada día.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Puntos de interés
|
||||
|
||||
**Puntos de interés** (técnicamente llamados _waypoints_) representan ubicaciones de interés para mostrar en un dispositivo GPS o en un mapa digital.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Acciones de edición
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
A diferencia de las acciones de archivo, las acciones de edición pueden potencialmente modificar el contenido de los archivos seleccionados actualmente.
|
||||
Además, cuando está habilitada la disposición del árbol de la lista de archivos (ver [Archivos y estadísticas](../files-and-stats)), se pueden aplicar a [pistas, segmentos y puntos de interés](../gpx).
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Por lo tanto, nos referiremos a los elementos que pueden ser modificados por estas acciones como _elementos de archivo_.
|
||||
Tenga en cuenta que, excepto para las acciones de deshacer y rehacer, las acciones de edición también son accesibles a través del menú contextual (clic derecho) de los elementos del archivo.
|
||||
|
||||
@@ -27,10 +27,6 @@ Abre el cuadro de diálogo de información del elemento del archivo seleccionado
|
||||
|
||||
Abre el diálogo de apariencia, donde puede cambiar el color, la opacidad y el ancho en el mapa de los elementos de archivo seleccionados.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Ocultar/mostrar
|
||||
|
||||
Alterna la visibilidad de los elementos del archivo seleccionado en el mapa.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Nueva pista
|
||||
|
||||
Crear una nueva pista en el archivo seleccionado.
|
||||
@@ -42,6 +38,17 @@ Además, la selección debe ser un solo archivo.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Esta acción sólo está disponible cuando está habilitada la disposición del árbol de la lista de archivos.
|
||||
Además, la selección debe ser un solo archivo.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Nuevo segmento
|
||||
|
||||
Crear un nuevo segmento en la pista seleccionada.
|
||||
@@ -53,14 +60,17 @@ Además, la selección debe ser una sola pista.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Seleccionar todo
|
||||
|
||||
Añade todos los elementos del archivo en el nivel de jerarquía actual a la selección.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Centrar
|
||||
|
||||
Centrar el mapa en los elementos de archivo seleccionados.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Copiar
|
||||
|
||||
Copia los elementos del archivo seleccionado al portapapeles.
|
||||
|
||||
@@ -15,6 +15,10 @@ El menú de acciones de archivo contiene un conjunto de operaciones bastante aut
|
||||
|
||||
Crea un nuevo archivo vacío.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Abrir...
|
||||
|
||||
Abre archivos desde su equipo.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Opciones de vista
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Oculta el perfil de elevación para dejar espacio para el mapa, o lo muestra par
|
||||
|
||||
Alterna el diseño de árbol para la [lista de archivos](../files-and-stats).
|
||||
Esta disposición es ideal para administrar un gran número de archivos abiertos ya que los organiza en una lista vertical en la parte derecha del mapa.
|
||||
Además, la vista de árbol de archivos le permite inspeccionar [pistas, segmentos y puntos de interés](../gpx) contenidos dentro de los archivos a través de secciones plegables.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Cambiar al mapa base anterior
|
||||
|
||||
@@ -38,6 +38,14 @@ Se muestran para la selección actual, como el [perfil de elevación](../files-a
|
||||
|
||||
Alterna la visibilidad de las flechas de dirección en el mapa.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Alternar 3D
|
||||
|
||||
Entra o sale de la vista 3D del mapa.
|
||||
|
||||
@@ -16,7 +16,7 @@ Esta herramienta le permite extraer [pistas (o segmentos)](../gpx) de archivos (
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Aplicar la herramienta a un archivo que contenga múltiples pistas creará un nuevo archivo para cada una de las pistas.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Del mismo modo, la aplicación de la herramienta a una pista que contenga varios segmentos creará (en el mismo archivo) una nueva pista para cada uno de los segmentos.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Combinar
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
Para usar esta herramienta, necesita [seleccionar](../files-and-stats) múltiples archivos, [pistas o segmentos](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- Si su objetivo es crear un único trazado continuo a partir de su selección, use la opción **Conectar los trazados** y valide.
|
||||
- La segunda opción se puede usar para crear o gestionar archivos con múltiples [pistas o segmentos](../gpx).
|
||||
Combinar archivos (o pistas) dará como resultado un único archivo (o pista) que contendrá todas las pistas (o segmentos) de la selección.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ Para dividir el trazado seleccionado en dos partes, haga clic en uno de los marc
|
||||
Para dividir en un punto específico de su elección, sitúe el cursor sobre el trazado en el mapa.
|
||||
Las tijeras aparecerán en la posición del cursor, mostrando que puede dividir el trazado en ese punto.
|
||||
|
||||
Puede elegir dividir el trazado en dos archivos GPX o mantener las partes divididas en el mismo archivo como [pistas o segmentos](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Situar el cursor sobre el trazado seleccionado lo convierte en tijeras." />
|
||||
@@ -50,7 +50,7 @@ Fitxategi fitxa batean eskuin-klik eginez, [editatu menuko](./menu/edit) ekintza
|
||||
|
||||
Aipatu bezala, [ikusi atalean](./menu/view), fitxategien zerrendaren zuhaitz diseinura alda dezakezu.
|
||||
Diseinu hau aproposa da irekitako fitxategi ugari kudeatzeko, maparen eskuinaldean zerrenda bertikal batean antolatzen baitu.
|
||||
Gainera, fitxategi-zuhaitzaren ikuspegiak aukera ematen du [arrastoak, segmentuak eta interesguneak](./gpx) ikuskatzeko ataletan antolatutako fitxategietan.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
[Edizio ekintzak](./menu/edit) eta [tresnak](./toolbar) fitxategien barneko elementuetara ere aplikatu ditzakezu.
|
||||
Gainera, barruko elementuak arrastatu eta jaregin ditzakezu berrantolatzeko edo hierarkian edo beste fitxategi batera eraman.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: GPX fitxategi formatua
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
<a href="https://www.topografix.com/gpx.asp" target="_blank">GPX fitxategi formatua</a> GPS datuak aplikazioen eta GPS gailuen artean trukatzeko formatu ireki estandarra da.
|
||||
GPS puntu serie bat GPS arrasto bat edo gehiagotan bildua, eta, aukeran, interesgune batzuk.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
GPX fitxategiek metadatuak ere izan ditzakete, horien artean **izena** eta **deskribapena** eremuak erabiltzaileentzat erabilgarrienak izaten dira.
|
||||
|
||||
@@ -27,6 +29,20 @@ Egitura hierarkiko batean antolatuta daude, goiko mailan:
|
||||
Gehienetan, GPX fitxategiek segmentu bakarraz osatutako arrasto edo ibilbide bakarra dute.
|
||||
Hala ere, goian deskribatutako hierarkiak erabilera kasu aurreratuagoak egiteko aukera ematen du, hala nola egun anitzeko bidaiak antolatzea egun bakoitzeko hainbat aldaerekin.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Interesguneak
|
||||
|
||||
**Interesguneak** (_bide-puntu_ gisa ere ezagunak) interesgarriak diren kokapenak GPS gailu batean edo mapa digital batean erakusteko erabiltzen dira.
|
||||
|
||||
@@ -13,8 +13,8 @@ title: Integrazioa
|
||||
|
||||
Behar duzun guztia hau da:
|
||||
|
||||
1. GPX files hosted on your server or on Google Drive, or accessible via a public URL;
|
||||
2. _Optional:_ a <a href="https://cloud.maptiler.com/auth/widget?next=https://cloud.maptiler.com/maps/" target="_blank">MapTiler key</a> to load MapTiler maps.
|
||||
1. Zure zerbitzarian edo Google Drive-n ostatatutako GPX fitxategiak, edo URL publiko baten bidez eskura daitezke;
|
||||
2. _Aukerakoa:_ <a href="https://cloud.maptiler.com/auth/widget?next=https://cloud.maptiler.com/maps/" target="_blank">MapTiler tekla</a> MapTiler mapak kargatzeko.
|
||||
|
||||
Ondoren, konfiguratzailearekin jolastu dezakezu zure mapa pertsonalizatzeko eta dagokion HTML kodea sortzeko.
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ Maparen geruzen botoiak mapa-oinarri desberdinen artean aldatzeko aukera ematen
|
||||
<DocsLayers />
|
||||
<span class="text-sm text-center mt-2">
|
||||
|
||||
Hover over the map to show the <a href="https://hiking.waymarkedtrails.org" target="_blank">Waymarked Trails hiking</a> overlay on top of the topographic basemap.
|
||||
Pasa ezazu maparen gainean <a href="https://hiking.waymarkedtrails.org" target="_blank">markatutako mendi-ibiliak</a> gainjartzeko oinarrizko mapa topografikoaren gainean.
|
||||
|
||||
</span>
|
||||
</div>
|
||||
@@ -69,4 +69,4 @@ Global eta tokiko mapa oinarri bilduma handia dago **gpx.studio**-n eskuragarri,
|
||||
|
||||
Ezarpen horietan, gainjartzeen opakutasuna ere kudeatu dezakezu.
|
||||
|
||||
For advanced users, it is possible to add custom basemaps and overlays by providing <a href="https://en.wikipedia.org/wiki/Web_Map_Tile_Service" target="_blank">WMTS</a>, <a href="https://en.wikipedia.org/wiki/Web_Map_Service" target="_blank">WMS</a>, or <a href="https://maplibre.org/maplibre-style-spec/" target="_blank">MapLibre style JSON</a> URLs.
|
||||
Erabiltzaile aurreratuentzat, oinarrizko mapa pertsonalizatuak eta gainjartzeak gehi daitezke <a href="https://en.wikipedia.org/wiki/Web_Map_Tile_Service" target="_blank">WMTS</a>, <a href="https://en.wikipedia.org/wiki/Web_Map_Service" target="_blank">WMS</a> edo <a href="https://maplibre.org/maplibre-style-spec/" target="_blank">MapLibre estiloko JSON</a> URLak.
|
||||
@@ -3,14 +3,14 @@ title: Edizio ekintzak
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Fitxategi-ekintzak ez bezala, edizio-ekintzek hautatutako fitxategien edukia alda dezakete.
|
||||
Are gehiago, fitxategien zerrendaren zuhaitzaren diseinua gaituta dagoenean (Ikusi [Fitxategiak eta estatistikak](../files-and-stats)), ekintzek [arrasto, segmentu eta interesgunetan](../gpx) ere aplikatu daitezke.
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Hori dela eta, ekintza hauek alda dezaketen elementuei _fitxategi-elementuak_ izendatzen ditugu.
|
||||
Ohar zaitez, desegin eta berregin ekintzak ez, beste guztiak fitxategi-elementu hauen alboko menuaren bidez (eskuin-klik) ere erabili daitezke.
|
||||
|
||||
@@ -27,10 +27,6 @@ Ireki hautatutako fitxategiaren elementuaren elkarrizketa-koadroa, non bere izen
|
||||
|
||||
Ireki Itxuraren elkarrizketa-koadroa, eta bertan mapan hautatutako elementuaren kolorea, opakotasuna eta zabalera alda ditzakezu.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Ezkutatu/erakutsi
|
||||
|
||||
Aldatu mapan hautatutako elementuen ikusgarritasuna.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Arrasto berria
|
||||
|
||||
Sortu arrasto berri bat hautatutako fitxategian.
|
||||
@@ -42,6 +38,17 @@ Gainera, fitxategi bakarra egon behar du hautatuta.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Ekintza hau soilik aktibatuko da fitxategien zerrendako zuhaitz-geruza gaituta dagoenean.
|
||||
Gainera, fitxategi bakarra egon behar du hautatuta.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> Segmentu berria
|
||||
|
||||
Sortu segmentu berri bat hautatutako arrastoan.
|
||||
@@ -53,14 +60,17 @@ Gainera, arrasto bakarra egon behar du hautatuta.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Hautatu denak
|
||||
|
||||
Gehitu hautapenera uneko hierarkia mailako fitxategi elementu guztiak.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Erdiratu
|
||||
|
||||
Erdiratu mapan hautatutako fitxategi-elementuak.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Kopiatu
|
||||
|
||||
Kopiatu arbelean hautatutako fitxategi-elementuak.
|
||||
|
||||
@@ -15,6 +15,10 @@ Fitxategi ekintzen menuan fitxategien eragiketa multzoa dago.
|
||||
|
||||
Sortu fitxategi huts berri bat.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Ireki...
|
||||
|
||||
Ireki zure ordenagailuko fitxategiak.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Ikusteko aukerak
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Ezkutatu altueren profila mapari lekua egiteko, edo erakutsi uneko hautapena iku
|
||||
|
||||
Aldatu [fitxategi zerrendaren](../files-and-stats) zuhaitza ikuspegira.
|
||||
Diseinu hau aproposa da irekitako fitxategi ugari kudeatzeko, maparen eskuinaldean zerrenda bertikal batean antolatzen baitu.
|
||||
Fitxategien zuhaitza ikuspegiak fitxategien barneko [ibilbideak, segmentuak eta interesguneak](../gpx) atal gisa erakusten ditu.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Aldatu erabilitako aurreko geruzara
|
||||
|
||||
@@ -38,6 +38,14 @@ Unean hautatutako ibilbidean ikusten dira, [koten profila bezala](../files-and-s
|
||||
|
||||
Aldatu ibilbidearen noranzko gezien ikusgarritasuna.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Aldatu 3D
|
||||
|
||||
Aktibatu edo desaktibatu maparen 3D ikuspegia.
|
||||
@@ -48,7 +56,6 @@ Maparen orientazioa eta okertzea kontrolatzeko, mapa ere arrasta dezakezu <kbd>
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Maximize2 size="16" class="inline-block" style="margin-bottom: 2px" /> Full screen
|
||||
### <Maximize2 size="16" class="inline-block" style="margin-bottom: 2px" /> Pantaila osoa
|
||||
|
||||
Enter or exit full screen mode.
|
||||
You can also press <kbd>F11</kbd> to toggle, or <kbd>Escape</kbd> to exit.
|
||||
Sartu edo irten pantaila osoko moduan.<kbd>F11</kbd> ere saka dezakezu txandakatzeko, edo <kbd>Ihes</kbd> irteteko.
|
||||
@@ -18,7 +18,7 @@ Tresna honen bidez elebazio datuak gehitzen ahal dira ibilbidetan eta [interesgu
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Elevation data is provided by <a href="https://mapterhorn.com" target="_blank">Mapterhorn</a>.
|
||||
You can learn more about its origin and accuracy in the <a href="https://mapterhorn.com/attribution/" target="_blank">documentation</a>.
|
||||
Altueraren datuak <a href="https://mapterhorn.com" target="_blank">Mapterhorn</a>k ematen ditu.
|
||||
Haren jatorriari eta zehaztasunari buruz gehiago jakin dezakezu <a href="https://mapterhorn.com/attribution/" target="_blank">dokumentazioan</a>.
|
||||
|
||||
</DocsNote>
|
||||
@@ -16,7 +16,7 @@ Tresna honen bidez [ibilbideak (edo segmentuak)](../gpx) erauzi ditzakezu fitxat
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Hainbat ibilbide dituen fitxategi bati aplikatuz gero dituen ibilbide bakoitzarentzat fitxategi bana sortuko du.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Era berean, hainbat segmentu duen ibilbide bati aplikatuz gero (fitxategi berean) duen segmentu bakoitzeko ibilbide bana sortuko du.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,16 +10,16 @@ title: Batu
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
Tresna hau erabiltzeko [hautatu](../files-and-stats) behar duzu hainbat fitxategi [ibilbidea, edo segmentuak](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- Zure helburua hautaketatik abiatuta etengabeko arrasto bakarra sortzea bada, erabili **Konektatu trazak ** aukera eta balioztatu.
|
||||
- Bigarren aukera bat izan daiteke hainbat [arrasto edo segmentu](../gpx) biltzen duen fitxategiak sortzea edo kudeatzea.
|
||||
Fitxategiak (edo arrastoak) batzearen emaitza fitxategi (edo arrasto) bakarra sortzea da zeinak hautapenaren arrastoak (edo segmentuak) biltzen duena.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Selected items are merged in the order they appear in the files list.
|
||||
Reorder items by drag-and-drop if needed.
|
||||
Hautatutako elementuak fitxategien zerrendan agertzen diren ordenan batzen dira.
|
||||
Berrantolatu elementuak arrastatu eta jareginez, behar izanez gero.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ Hautatutako ibilbidea bi zatitan banatzeko, egin klik arrastoko zatiketa markatz
|
||||
Puntu zehatz batean banatzeko, pasa ezazu maparen arrastoaren gainean.
|
||||
Artaziak agertuko dira kurtsorearen posizioan, puntu horretan ebaki dezakezula erakutsiz.
|
||||
|
||||
Arrastoa bi GPX fitxategietan zatitzea edo fitxategi berean zatiak [arrastoak edo segmentuak](../gpx) gisa gordetzea aukeratu dezakezu.
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Aukeratutako trazaren gainean kokatzean, zure kurtsorea guraize bihurtuko da." />
|
||||
@@ -51,7 +51,7 @@ By right-clicking on a file tab, you can access the same actions as in the [edit
|
||||
|
||||
As mentioned in the [view options section](./menu/view), you can switch to a tree layout for the files list.
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](./gpx) contained inside the files through collapsible sections.
|
||||
|
||||
You can also apply [edit actions](./menu/edit) and [tools](./toolbar) to internal file items.
|
||||
Furthermore, you can drag and drop the inner items to reorder them, or move them in the hierarchy or even to another file.
|
||||
|
||||
@@ -3,13 +3,15 @@ title: GPX file format
|
||||
---
|
||||
|
||||
<script>
|
||||
import { Waypoints, MapPin } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
import { Waypoints, Route, MapPin } from '@lucide/svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
The <a href="https://www.topografix.com/gpx.asp" target="_blank">GPX file format</a> is an open standard for exchanging GPS data between applications and GPS devices.
|
||||
It essentially consists of a series of GPS points encoding one or multiple GPS traces, and, optionally, some points of interest.
|
||||
These traces can be stored either as tracks or as routes.
|
||||
|
||||
GPX files may also contain metadata, of which the **name** and **description** fields are the most useful for users.
|
||||
|
||||
@@ -27,6 +29,20 @@ These are organized in a hierarchical structure, with tracks at the top level.
|
||||
In most cases, GPX files contain a single track with a single segment.
|
||||
However, the hierarchy described above allows for more advanced use cases, such as planning multi-day trips with several variants for each day.
|
||||
|
||||
### <Route size="16" class="inline-block" style="margin-bottom: 2px" /> Routes
|
||||
|
||||
A **route** is a single continuous path made of a sequence of **route points**.
|
||||
These are mandatory checkpoints, which correspond to the anchor points of the [routing tool](./toolbar/routing).
|
||||
The points in between are only a suggested path connecting the route points.
|
||||
Like a track, a route can have a **name**, a **description**, and **appearance properties**.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
Nowadays, most apps and GPS devices work perfectly well with tracks, even for navigation.
|
||||
However, some of them only work with routes: in that case, you can [convert](./menu/edit) your tracks to routes, or [create](./menu/file) a route file from the start.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <MapPin size="16" class="inline-block" style="margin-bottom: 2px" /> Points of interest
|
||||
|
||||
**Points of interest** (technically called _waypoints_) represent locations of interest to show either on a GPS device or on a digital map.
|
||||
|
||||
@@ -3,14 +3,14 @@ title: Edit actions
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { Undo2, Redo2, Info, PaintBucket, EyeOff, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Maximize, Plus } from '@lucide/svelte';
|
||||
import { Undo2, Redo2, Info, PaintBucket, ArrowRightLeft, FileStack, ClipboardCopy, Scissors, ClipboardPaste, Trash2, Plus } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
# { title }
|
||||
|
||||
Unlike the file actions, the edit actions can potentially modify the content of the currently selected files.
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, and points of interest](../gpx).
|
||||
Moreover, when the tree layout of the files list is enabled (see [Files and statistics](../files-and-stats)), they can also be applied to [tracks, segments, routes, and points of interest](../gpx).
|
||||
Therefore, we will refer to the elements that can be modified by these actions as _file items_.
|
||||
Note that except for the undo and redo actions, the edit actions are also accessible through the context menu (right-click) of the file items.
|
||||
|
||||
@@ -27,10 +27,6 @@ Open the information dialog of the currently selected file item, where you can s
|
||||
|
||||
Open the appearance dialog, where you can change the color, opacity, and width of the selected file items on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New track
|
||||
|
||||
Create a new track in the selected file.
|
||||
@@ -42,6 +38,17 @@ Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route
|
||||
|
||||
Create a new route in the selected file.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
This action is only available when the tree layout of the files list is enabled.
|
||||
Additionally, the selection must be a single file.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New segment
|
||||
|
||||
Create a new segment in the selected track.
|
||||
@@ -53,14 +60,17 @@ Additionally, the selection must be a single track.
|
||||
|
||||
</DocsNote>
|
||||
|
||||
### <ArrowRightLeft size="16" class="inline-block" style="margin-bottom: 2px" /> Convert to route/track
|
||||
|
||||
Convert the selected routes to tracks, or the selected tracks or segments to routes.
|
||||
Since a route has a single segment, a track with multiple segments is converted into one route per segment.
|
||||
|
||||
When the selected files contain only routes, or only tracks, you can also convert all of them at once.
|
||||
|
||||
### <FileStack size="16" class="inline-block" style="margin-bottom: 2px" /> Select all
|
||||
|
||||
Add all file items in the current hierarchy level to the selection.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <ClipboardCopy size="16" class="inline-block" style="margin-bottom: 2px" /> Copy
|
||||
|
||||
Copy the selected file items to the clipboard.
|
||||
|
||||
@@ -15,6 +15,10 @@ The file actions menu contains a set of pretty self-explanatory file operations.
|
||||
|
||||
Create a new empty file.
|
||||
|
||||
### <Plus size="16" class="inline-block" style="margin-bottom: 2px" /> New route file
|
||||
|
||||
Create a new file containing an empty [route](../gpx).
|
||||
|
||||
### <FolderOpen size="16" class="inline-block" style="margin-bottom: 2px" /> Open...
|
||||
|
||||
Open files from your computer.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: View options
|
||||
---
|
||||
|
||||
<script lang="ts">
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, Box, Maximize2 } from '@lucide/svelte';
|
||||
import { ChartArea, ListTree, Map, Layers2, Coins, Milestone, EyeOff, Maximize, Box, Maximize2 } from '@lucide/svelte';
|
||||
import DocsNote from '$lib/components/docs/DocsNote.svelte';
|
||||
</script>
|
||||
|
||||
@@ -19,7 +19,7 @@ Hide the elevation profile to make room for the map, or show it to inspect the c
|
||||
|
||||
Toggle the tree layout for the [file list](../files-and-stats).
|
||||
This layout is ideal for managing a large number of open files, as it organizes them into a vertical list on the right side of the map.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
In addition, the file tree view enables you to inspect the [tracks, segments, routes, and points of interest](../gpx) contained inside the files through collapsible sections.
|
||||
|
||||
### <Map size="16" class="inline-block" style="margin-bottom: 2px" /> Switch to previous basemap
|
||||
|
||||
@@ -38,6 +38,14 @@ They are displayed for the current selection, like the [elevation profile](../fi
|
||||
|
||||
Toggle the visibility of direction arrows on the map.
|
||||
|
||||
### <EyeOff size="16" class="inline-block" style="margin-bottom: 2px" /> Hide/unhide
|
||||
|
||||
Toggle the visibility of the selected file items on the map.
|
||||
|
||||
### <Maximize size="16" class="inline-block" style="margin-bottom: 2px" /> Center
|
||||
|
||||
Center the map on the selected file items.
|
||||
|
||||
### <Box size="16" class="inline-block" style="margin-bottom: 2px" /> Toggle 3D
|
||||
|
||||
Enter or exit the 3D map view.
|
||||
|
||||
@@ -16,7 +16,7 @@ This tool allows you to extract [tracks (or segments)](../gpx) from files (or tr
|
||||
<Extract class="text-foreground p-3 border rounded-md shadow-lg" />
|
||||
</div>
|
||||
|
||||
Applying the tool to a file containing multiple tracks will create a new file for each of the tracks it contains.
|
||||
Applying the tool to a file containing multiple [tracks or routes](../gpx) will create a new file for each of the tracks and routes it contains.
|
||||
Similarly, applying the tool to a track containing multiple segments will create (in the same file) a new track for each of the segments it contains.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
@@ -10,11 +10,11 @@ title: Merge
|
||||
|
||||
# <Group size="24" class="inline-block" style="margin-bottom: 5px" /> { title }
|
||||
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, or segments](../gpx).
|
||||
To use this tool, you need to [select](../files-and-stats) multiple files, [tracks, segments or routes](../gpx).
|
||||
|
||||
- If your goal is to create a single continuous trace from your selection, use the **Connect the traces** option and validate.
|
||||
- The second option can be used to create or manage files with multiple [tracks or segments](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks (or segments) from the selection.
|
||||
- The second option can be used to create or manage files with multiple [tracks, segments or routes](../gpx).
|
||||
Merging files (or tracks) will result in a single file (or track) containing all tracks and routes (or segments) from the selection.
|
||||
|
||||
<DocsNote>
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ To split the selected trace into two parts, click on one of the split markers di
|
||||
To split at a specific point of your choice, hover over the trace on the map.
|
||||
Scissors will appear at the cursor position, showing that you can split the trace at that point.
|
||||
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks or segments](../gpx).
|
||||
You can choose to split the trace into two GPX files, or to keep the split parts in the same file as [tracks, segments or routes](../gpx).
|
||||
|
||||
<DocsImage src="tools/split" alt="Hovering over the selected trace turns your cursor into scissors." />
|
||||
Loaded 100 of 359 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user