140 Commits

Author SHA1 Message Date
e09348e064 chore: bump release info to 1.3.0 2025-12-18 00:44:57 +08:00
Hosted Weblate
fce6a835b7 i18n: Translations update from Hosted Weblate
Co-authored-by: Andrey <andrey@mailbox.org>
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ru/
Translation: pineapple-pictures/Application
2025-12-16 17:32:28 +01:00
afcd126c00 feat(CI): add deepin 25 build 2025-12-17 00:31:42 +08:00
aa025b0f3b Revert "chore: avoid use screenAt(QCursor::pos())"
I actually forgot why I did this, I might thought this API
is deprecated?

Reverting this resolved the issue that window is not appeared
at the screen that currently the cursor is at.

This reverts commit 4375fe1c2d.
2025-12-14 11:26:21 +08:00
e6e738412d chore(CI): add passoc binary for msvc build and minor tweaks
Resolve https://github.com/BLumia/pineapple-pictures/issues/13
2025-12-14 00:23:55 +08:00
2e748e19e1 fix: correct license for files under dist/passoc 2025-12-11 00:47:19 +08:00
4b5c9e9ebd chore: add icons for Windows file assoc 2025-12-11 00:07:31 +08:00
cdfa8b78a4 feat(Windows): install passoc default config file 2025-12-03 00:10:42 +08:00
1ba5ae60dc feat: option to limit svg support to svg tiny 1.2 only 2025-12-02 00:04:12 +08:00
Hosted Weblate
08d1c09033 i18n: Translations update from Hosted Weblate
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Languages add-on <noreply-addon-languages@weblate.org>
Co-authored-by: VenusGirl <VenusGirl@outlook.com>
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ko/
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/appstream-metadata/ko/
Translation: pineapple-pictures/AppStream Metadata
Translation: pineapple-pictures/Application
2025-12-01 23:54:11 +08:00
612b542e2a fix(CI): fix broken avif support
The following commit from libavif is related:
f7ce882698

Resolve: https://github.com/BLumia/pineapple-pictures/issues/164
2025-11-24 19:10:07 +08:00
d74db66ab5 chore(CI): tweak msvc CI and make use of cmake install command
We also no longer include msvcrt in msvc cmake CI build
2025-11-22 17:40:43 +08:00
9dd34b3fce chore: bump release info to 1.2.1 2025-11-21 20:42:44 +08:00
adfe6c51da chore(CI): bump Qt version to 6.10.1 2025-11-20 23:29:43 +08:00
Weblate (bot)
96565b2ccf i18n: Translated using Weblate (Italian) (#162)
Currently translated at 100.0% (168 of 168 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

Co-authored-by: albanobattistella <albanobattistella@gmail.com>
2025-11-08 23:19:06 +08:00
107440145a chore(CI): bump dependencies version for msvc build 2025-11-06 00:28:32 +08:00
1c55e3194e fix: missing QColorSpace include and Qt version check 2025-11-05 20:34:06 +08:00
9021ff2579 fix: inaccurate color when display CMYK images
Resolve https://github.com/BLumia/pineapple-pictures/issues/100
2025-11-05 20:23:40 +08:00
10e1e91e7b chore: add donation link to AppStream metainfo 2025-10-13 00:04:07 +08:00
ef887d7a06 chore(CI): switch back to Qt 6.9.3 and add cache for install-qt-action 2025-10-08 13:48:12 +08:00
5446d94966 chore(CI): use Qt 6.10.0 2025-10-08 13:25:42 +08:00
a2f42c2e3d chore: update Contribution section in README.md 2025-09-27 15:50:25 +08:00
56b18353db chore: update release info to 1.2.0 2025-09-20 00:03:34 +08:00
9170765344 fix(CI): appveyor FTBFS due to mingw location change 2025-09-17 00:19:30 +08:00
Weblate (bot)
ee7b3beda4 i18n: Translated using Weblate (Turkish) (#161)
Currently translated at 100.0% (168 of 168 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/tr/

Co-authored-by: Sabri Ünal <yakushabb@gmail.com>
2025-09-13 20:47:59 +08:00
919a672c17 chore(CI): bump Qt version to 6.9.2 2025-08-28 00:28:05 +08:00
e52a6d8eed feat: new action for fit long image 2025-08-25 12:48:35 +08:00
8b0c8ec194 i18n: update ts files 2025-08-25 12:47:42 +08:00
Weblate (bot)
1da7fff518 i18n: Translations update from Hosted Weblate (#159)
* Translated using Weblate (Italian)

Currently translated at 100.0% (167 of 167 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (167 of 167 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/nl/

---------

Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
Co-authored-by: Heimen Stoffels <vistausss@fastmail.com>
2025-08-25 12:44:28 +08:00
e216592205 fix(CI): reuse lint 2025-08-24 14:08:00 +08:00
8fc9d06937 chore: add product version to windows build rc file 2025-08-24 13:53:14 +08:00
73b15da182 chore: remove gitee release page link from README.zh_CN.md 2025-08-23 15:24:00 +08:00
f4f7d93e38 chore: simplified long image mode code 2025-08-05 00:06:05 +08:00
591b01a83a i18n: update ts files 2025-08-04 21:56:58 +08:00
f8d3dcc899 feat: auto long image mode 2025-08-04 20:41:49 +08:00
f0ed9d0ca1 chore: update release info to 1.1.1 2025-08-02 13:30:14 +08:00
Weblate (bot)
13227cfac9 i18n: Translations update from Hosted Weblate (#157)
* Translated using Weblate (Korean)

Currently translated at 100.0% (166 of 166 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ko/

* Translated using Weblate (Dutch)

Currently translated at 100.0% (166 of 166 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/nl/

---------

Co-authored-by: VenusGirl <VenusGirl@outlook.com>
Co-authored-by: Heimen Stoffels <vistausss@fastmail.com>
2025-08-01 23:44:43 +08:00
b73df5ea1a refactor: make fitByOrientation() more sane 2025-07-27 15:53:23 +08:00
4375fe1c2d chore: avoid use screenAt(QCursor::pos()) 2025-07-26 16:03:13 +08:00
4654cb21a0 fix: REUSE compliance 2025-07-23 21:29:18 +08:00
ba23208a7a chore: add config file for CRLF to LF change 2025-07-23 21:22:41 +08:00
ed5a602332 chore: let's use LF all the time 2025-07-23 21:20:34 +08:00
347681e604 feat(macOS): click dock icon to show window when it's hidden 2025-07-22 00:08:06 +08:00
505ab9e2a6 chore: update README 2025-07-11 19:41:09 +08:00
c787e14a69 chore(CI): bump exiv2 version for msvc build 2025-07-11 00:31:10 +08:00
29c5783a66 chore: update release info to 1.1.0 2025-07-06 00:05:52 +08:00
Weblate (bot)
ddc75f7cd0 i18n: Translated using Weblate (Tamil) (#155)
Currently translated at 100.0% (166 of 166 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ta/

Co-authored-by: தமிழ்நேரம் <anishprabu.t@gmail.com>
2025-07-05 23:19:32 +08:00
f976fea418 fix: shouldn't loop when navigate gallery via shortcuts
Related: https://github.com/BLumia/pineapple-pictures/issues/153
2025-06-29 16:24:26 +08:00
2846e4907b feat: support load m3u8 playlist
This change is sponsored by @superuser7777

Related: https://github.com/BLumia/pineapple-pictures/issues/153
2025-06-28 09:27:30 +08:00
c828f86b74 fix: FTBFS, and tidy code 2025-06-25 21:55:08 +08:00
040e2a7b5f i18n: update ts files 2025-06-25 21:47:31 +08:00
b566096b1f feat: option to disable gallery looping
This change is sponsored by @superuser7777

Related: https://github.com/BLumia/pineapple-pictures/issues/153
2025-06-25 20:55:42 +08:00
2bee79c064 i18n: update ts files 2025-06-22 15:14:08 +08:00
Weblate (bot)
91696963ae i18n: Translations update from Hosted Weblate (#152)
* Translated using Weblate (Dutch)

Currently translated at 100.0% (164 of 164 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/nl/

* Translated using Weblate (Italian)

Currently translated at 100.0% (164 of 164 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

---------

Co-authored-by: Heimen Stoffels <vistausss@fastmail.com>
Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
2025-06-22 15:11:56 +08:00
1623ca315a feat: able to disable built-in close window animation 2025-06-22 15:04:15 +08:00
3cfb25db9a chore(CI): use Qt 6.9.1 2025-06-04 20:37:08 +08:00
36854d19f4 i18n: update ts files 2025-06-01 13:26:49 +08:00
3f7ebd2f6c chore: make use of Qt::Literals::StringLiterals u""_s
Migrate string literal handling to Qt’s built‐in `u""_s` literals for consistency and readability.
2025-05-31 13:10:21 +08:00
291a98ea97 fix(CI): macOS and Ubuntu CI FTBFS
macOS's CI uses conan to build exiv2, which seems still rely on
the exiv2lib target...
2025-05-24 23:19:26 +08:00
24a0b581f3 chore: drop Qt 5 support
The required exiv2 version is now 0.28.x as well since it was
keeped for Qt 5 build.

Due to exiv2ConfigVersion.cmake doesn't allow us write something
like find_package(exiv2 "0.28") to require version >= 0.28.0,
we simply don't put the required version number here for now.
2025-05-24 20:34:36 +08:00
369aa13be3 chore: correct feature list in release note 2025-05-11 13:56:38 +08:00
b964fdc77f chore: update release info to 1.0.0 2025-05-01 22:07:42 +08:00
d6d2703c93 chore: ensure could get correct locale on macOS 2025-04-28 00:51:17 +08:00
c6068ba23d fix: qmake build FTBFS 2025-04-26 17:23:56 +08:00
fbdd858fbd chore: merge Qt translations into app translations as well 2025-04-26 17:02:24 +08:00
8333f17199 chore(CI): add portable mode to qmake build
Resolve https://github.com/BLumia/pineapple-pictures/issues/148

This change is sponsored by @EdgarHartel.
2025-04-11 12:54:29 +08:00
30eb06cba7 chore: make use of the showMessageAndExit api in Qt 6.9 2025-04-09 19:24:27 +08:00
0a45cd7c22 chore: add the ability to know if it's the first loaded user media
This could make it easier to allow set “Keep Transform” mode at
start-up.

This change is sponsored by @EdgarHartel.

Related: https://github.com/BLumia/pineapple-pictures/issues/146#issuecomment-2778192785
2025-04-08 23:19:02 +08:00
fc417b30e5 chore(CI): bump msvc build AOM and libavif version 2025-04-04 17:35:59 +08:00
Weblate (bot)
8568f6d4ef i18n: Translations update from Hosted Weblate (#145)
* Translated using Weblate (Dutch)

Currently translated at 100.0% (163 of 163 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/nl/

* Translated using Weblate (Italian)

Currently translated at 100.0% (163 of 163 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

---------

Co-authored-by: Heimen Stoffels <vistausss@fastmail.com>
Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
2025-04-04 17:16:16 +08:00
8832c2daa9 chore(CI): bump Qt version to Qt 6.9.0 2025-04-02 19:39:20 +08:00
da9d7d6989 fix: add a small delay when file watcher triggers a reload
The file might still being write by other program, thus we add a
500ms delay to reload the image.
2025-03-31 01:28:03 +08:00
317d296507 chore(CI): AppVeyor FTBFS, bump GH Action Qt version 2025-03-30 00:16:40 +08:00
f24743e381 feat: reload image when current image gets updated
This feature is sponsored by @EdgarHartel.

Issue: https://github.com/BLumia/pineapple-pictures/issues/143
2025-03-29 13:41:55 +08:00
fd4af282af i18n: update ts files 2025-03-26 22:53:57 +08:00
4de03dd02e feat: support enforce windowed mode on start-up
This feature is sponsored by @EdgarHartel.

Issue: https://github.com/BLumia/pineapple-pictures/issues/143
2025-03-26 22:51:27 +08:00
Weblate (bot)
bfaf702606 i18n: Translated using Weblate (Japanese) (#144)
Currently translated at 100.0% (162 of 162 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ja/

Co-authored-by: mmahhi <mmahhi@users.noreply.hosted.weblate.org>
2025-03-26 22:50:36 +08:00
3203d7f598 chore(macOS): use native text for ShortcutEdit's label
This means that it will be shown translated and on Apple platforms
it will resemble a key sequence from the menu bar.
2025-03-08 00:31:49 +08:00
cbd006bae7 chore: update release info to 0.9.2 2025-02-26 20:58:16 +08:00
Pino Toscano
fc13a497d3 fix: refer to the right CMake module for Exiv2
The exiv2 library provides its own CMake config module, which is named
"exiv2". On case-sensitive systems (all the Unix systems by default)
trying to look for it as "Exiv2" does not work.

Hence properly look for "exiv2", and adapt the associated CMake
variables accoding to that.
2025-02-20 08:13:16 +01:00
183a61b2f6 i18n: update AppStream metainfo translation and translators.html 2025-02-16 13:34:41 +08:00
Weblate (bot)
ae07c5fe44 i18n: Translations update from Hosted Weblate (#140)
* Added translation using Weblate (Tamil)

* Added translation using Weblate (Tamil)

* Translated using Weblate (Tamil)

Currently translated at 100.0% (162 of 162 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ta/

* Translated using Weblate (Tamil)

Currently translated at 100.0% (7 of 7 strings)

Translation: pineapple-pictures/AppStream Metadata
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/appstream-metadata/ta/

---------

Co-authored-by: தமிழ்நேரம் <anishprabu.t@gmail.com>
2025-02-16 13:08:25 +08:00
a33381557b chore: sync playlistmanager changes from other project 2025-02-16 00:50:14 +08:00
6d8ec6a54a chore(CI): bump msvc windows CI Qt version to 6.8.2 2025-02-06 12:48:21 +08:00
dd3209e3ff chore(REUSE): convert from DEP5 to REUSE.toml 2025-02-02 12:50:44 +08:00
088066197f chore: update release info to 0.9.1 2025-01-20 20:06:59 +08:00
Weblate (bot)
3a8e907f28 i18n: Translations update from Hosted Weblate (#138)
* Translated using Weblate (Italian)

Currently translated at 100.0% (162 of 162 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

* Translated using Weblate (Turkish)

Currently translated at 99.3% (161 of 162 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/tr/

---------

Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
Co-authored-by: Sabri Ünal <yakushabb@gmail.com>
2025-01-20 19:55:55 +08:00
eb04ac362b fix: should center window according to available geometry 2025-01-04 13:36:01 +08:00
6d7d0e4e1d chore(macOS): change close-window behavior
On macOS, now closing the window will actually hide the window
instead of quit the application, thus it will match to some other
macOS application's behavior.

Additionally, since our binary is not signed, this could avoid
seeing the request permission dialogs everytime user attempts to
open an image file inside a private place (e.g. places like the
"Downloads" folder and "access data from other apps").
2025-01-03 18:57:25 +08:00
ff4f71c1e6 chore: hello 2025 2025-01-01 12:06:16 +08:00
101f111209 refactor: move file open event handling to standalone file 2024-12-31 10:57:21 +08:00
c227c74e23 chore(CI): bump appveyor CI to use Qt 6.8 2024-12-30 16:46:40 +08:00
32ff813609 chore(CI): macOS build with exiv2 support enabled 2024-12-29 18:44:27 +08:00
2de9ff810d feat: new TRANSLATION_RESOURCE_EMBEDDING build-time option 2024-12-24 22:37:16 +08:00
57354fc135 fix(macOS): should adjust window size when set as default viewer 2024-12-23 00:42:55 +08:00
07d0b0270e i18n: update ts files 2024-12-20 23:17:55 +08:00
Weblate (bot)
78e3e45a2e i18n: Translated using Weblate (Italian) (#137)
Currently translated at 100.0% (161 of 161 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
2024-12-20 23:08:23 +08:00
5a34441c72 feat: option to double-click to fullscreen
Resolve: BLumia/pineapple-pictures#129
2024-12-15 19:12:38 +08:00
b01601085b chore: update README and related docs 2024-12-04 20:07:15 +08:00
64c4d2e064 feat(macOS): support file open event for association 2024-12-03 23:37:53 +08:00
e64b871a2f feat: macOS bundle support 2024-12-03 01:15:20 +08:00
06af632914 chore(CI): msvc use Qt 6.8.1 2024-12-01 12:52:48 +08:00
99abf3b69d chore: bump minimum CMake version
- 3.16 is the actual lowest required version for Qt 6
- CMake versions <= 3.10 are deprecated since CMake 3.31
2024-12-01 00:02:29 +08:00
Weblate (bot)
42b6510877 i18n: Translated using Weblate (Spanish) (#134)
Currently translated at 100.0% (161 of 161 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/es/

Co-authored-by: gallegonovato <fran-carro@hotmail.es>
2024-11-30 23:11:59 +08:00
aa746721f0 i18n: update ts files 2024-11-07 00:15:59 +08:00
42e3d4c691 feat: animation pause and manually step to next frame
Resolve: https://github.com/BLumia/pineapple-pictures/issues/85
2024-11-06 20:28:39 +08:00
Weblate (bot)
a993437983 i18n: Translations update from Hosted Weblate (#133)
* Translated using Weblate (Korean)

Currently translated at 100.0% (152 of 152 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ko/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (157 of 157 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/tr/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (157 of 157 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/es/

* Translated using Weblate (Italian)

Currently translated at 100.0% (157 of 157 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

---------

Co-authored-by: VenusGirl <VenusGirl@outlook.com>
Co-authored-by: Sabri Ünal <yakushabb@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
2024-11-06 20:27:31 +08:00
8cce48e6b0 feat: check conflict shortcuts before saving 2024-11-03 00:46:21 +08:00
d0bdc71cf5 chore: shortcut-related code tweaks 2024-11-02 09:32:51 +08:00
2071e82e1d i18n: update ts files 2024-10-31 00:01:08 +08:00
b2f10b9193 chore: fix ubuntu 22.04 build ...again 2024-10-30 00:15:47 +08:00
9eb91dedf9 chore: fix ubuntu 22.04 build 2024-10-30 00:05:49 +08:00
6f3c30fc5b chore: fix qmake build 2024-10-29 23:44:48 +08:00
3eade9c3cf feat: support custom shortcut for existing actions
Resolve https://github.com/BLumia/pineapple-pictures/issues/128

Actually also https://github.com/BLumia/pineapple-pictures/issues/72
but not sure why that one is now a 404 page.
2024-10-29 23:28:27 +08:00
fad7a668e3 fix: not able to load translations 2024-10-27 13:49:24 +08:00
c68e82c7c8 chore: update release info to 0.8.2 2024-10-27 00:06:40 +08:00
7e04ba84eb chore(CI): msvc build with libavif 2024-10-26 15:18:54 +08:00
29355c7fc1 fix: actual proper fix for 471a3b1 2024-10-22 21:35:50 +08:00
Weblate (bot)
95f85374cf i18n: Translations update from Hosted Weblate (#125)
* Translated using Weblate (Japanese)

Currently translated at 98.6% (149 of 151 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ja/

* Translated using Weblate (Italian)

Currently translated at 100.0% (152 of 152 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (152 of 152 strings)

Translation: pineapple-pictures/Application
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/es/

---------

Co-authored-by: mmahhi <mmahhi@users.noreply.hosted.weblate.org>
Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
2024-10-22 00:38:29 +08:00
471a3b15ef fix: incorrect config location
This caused by the setting singleton instance (actually,
QStandardPath::writableLocation) was used before QApplication
was constructed, resulting it doesn't know the application
name. So we manually append the name to the path...
2024-10-21 22:27:57 +08:00
5d2ddc199a chore(CI): bump msvc build to use Qt 6.8.0 2024-10-12 19:57:27 +08:00
fa0b86a995 chore: fix incorrect syntax of COPY command in msvc-cmake-build.
- Fix incorrect syntax of COPY which cause we fail to copy LICENSE in final distribution package.
- Add workflow_dispatch condition in workflow files to allow manual trigger.
2024-10-12 14:25:28 +08:00
b880406474 i18n: update ts files 2024-10-11 00:30:13 +08:00
470a29c38c feat: option to use light checkerboard by default 2024-10-10 22:58:11 +08:00
3a5ead8cc2 fix(CI): qmake build 2024-09-17 19:48:03 +08:00
4dd3f22d88 chore: make use of CMake project version 2024-09-17 19:28:05 +08:00
3a4ea573f6 fix(dist): add last release info to AppStream 2024-09-16 10:56:10 +08:00
d574018a8e CI: bump dependencies version 2024-08-24 15:33:27 +08:00
Weblate (bot)
ae0f11c153 i18n: Translations update from Hosted Weblate (#124)
* Translated using Weblate (Spanish)

Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/es/

* Translated using Weblate (Turkish)

Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/tr/

* Translated using Weblate (Italian)

Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/it/

* Translated using Weblate (Japanese)

Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ja/

---------

Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
Co-authored-by: mmahhi <mmahhi@users.noreply.hosted.weblate.org>
2024-08-24 15:29:57 +08:00
2bca7bd691 fix: move to trash not reload current item 2024-07-31 20:21:10 +08:00
c2226ef5c7 chore: update translation strings 2024-07-31 19:41:51 +08:00
3596f9eac4 fix: window title not updated in some cases 2024-07-30 23:25:34 +08:00
a6e31a2c4d feat: cli argument to list supported image formats 2024-07-28 16:16:20 +08:00
cd01a05f23 chore: sync playlistmanager changes 2024-07-28 16:14:14 +08:00
f32cb998ae fix: crash caused by urlByIndex() with invalid model index
Also save a QVariant convert for QUrl
2024-07-21 00:52:32 +08:00
eb2e2e93f9 refactor(playlist): playlist itself as model
This could make state management easier, and also make it reusable
just in case we need to attach the playlist to a view.
2024-07-20 23:18:42 +08:00
4a095a0cfd chore: add jfif to supported formats 2024-07-20 13:53:29 +08:00
zhongyic00
d01297043e fix: playlist filter should consider plugins
setAutoLoadFilterSuffix with formats dynammically got from QImageReader, fix https://github.com/BLumia/pineapple-pictures/issues/120
2024-07-20 13:36:03 +08:00
Weblate (bot)
ae257ea567 i18n: Translations update from Hosted Weblate (#119)
* Translated using Weblate (Japanese)
* Translated using Weblate (Norwegian Bokmål)

Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/ja/
Translate-URL: https://hosted.weblate.org/projects/pineapple-pictures/application/nb_NO/

---------

Co-authored-by: mmahhi <masa10suda@gmail.com>
Co-authored-by: ovl-1 <ovl-002@mailinator.com>
2024-07-20 13:04:55 +08:00
edb1a84601 chore(CI): msvc build also build with exiv2 2024-07-13 15:59:13 +08:00
95 changed files with 11082 additions and 5827 deletions

3
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,3 @@
# .git-blame-ignore-revs
# CR LF to LF
ed5a6023326fd2ab420ded76976501be33e0b389

5
.gitattributes vendored Normal file
View File

@@ -0,0 +1,5 @@
*.txt text eol=lf
*.cpp text eol=lf
*.h text eol=lf
*.ui text eol=lf
*.qml text eol=lf

35
.github/workflows/deepin.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: deepin 25 CI
on: [push, pull_request, workflow_dispatch]
jobs:
build-deepin-25-deb:
runs-on: ubuntu-latest
container:
image: linuxdeepin/deepin:crimson
options: --user root
steps:
- name: Update package lists and install basic tools
run: |
apt update
apt install -y git ca-certificates curl file
- uses: actions/checkout@v4
- name: Get build dept.
run: |
apt install -y cmake qt6-base-dev qt6-svg-dev qt6-tools-dev libexiv2-dev
- name: Build it
run: |
git config --global --add safe.directory '*' # to avoid "fatal: detected dubious ownership in repository at xxx"
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .
cmake --build build -j
cd build
cpack -G DEB
- name: Try install it
run: |
cd build
apt install -y ./*.deb
- uses: actions/upload-artifact@v4
with:
name: deepin-25-deb-package
path: build/*.deb

View File

@@ -1,6 +1,6 @@
name: macOS CI name: macOS CI
on: [push, pull_request] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
build: build:
@@ -10,10 +10,30 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v4
with: with:
version: '6.4.2' version: '6.10.1'
- name: Run a qt project modules: 'qtimageformats'
cache: true
- name: Install Conan and Dependencies
id: conan
working-directory: ./
shell: bash
run: | run: |
cmake ./ -DPREFER_QT_5=OFF pip3 install wheel setuptools
make pip3 install conan --upgrade
conan --version
conan profile detect
conan install --requires=exiv2/0.28.3 --generator CMakeDeps --generator CMakeToolchain --build=missing
- name: Build
run: |
cmake . -DTRANSLATION_RESOURCE_EMBEDDING=ON --preset conan-release
cmake --build --preset conan-release
- name: Deploy
run: |
macdeployqt ./ppic.app -dmg
ls
- uses: actions/upload-artifact@v4
with:
name: "macos-bundle"
path: "*.dmg"

View File

@@ -7,9 +7,11 @@ name: REUSE Compliance Check
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
test: reuse-compliance-check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
uses: actions/checkout@v4
- name: REUSE Compliance Check - name: REUSE Compliance Check
uses: fsfe/reuse-action@v2 uses: fsfe/reuse-action@v5

View File

@@ -1,32 +1,8 @@
name: Ubuntu CI name: Ubuntu CI
on: [push, pull_request] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
ubuntu-22-04-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get build dept.
run: |
sudo apt update
sudo apt install cmake qtbase5-dev libqt5svg5-dev qttools5-dev libexiv2-dev
- name: Build it
run: |
mkdir build
cd build
cmake ../ -DPREFER_QT_5=ON
make
cpack -G DEB
- name: Try install it
run: |
cd build
sudo apt install ./*.deb
- uses: actions/upload-artifact@v4
with:
name: ubuntu-22.04-deb-package
path: build/*.deb
ubuntu-24-04-build: ubuntu-24-04-build:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
@@ -39,7 +15,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake ../ -DPREFER_QT_5=OFF cmake ../
make make
cpack -G DEB cpack -G DEB
- name: Try install it - name: Try install it

View File

@@ -1,24 +1,29 @@
name: Windows CI name: Windows CI
on: [push, pull_request] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
msvc-qmake-build: msvc-qmake-build:
strategy: strategy:
matrix: matrix:
vs: ['2022'] include:
msvc_arch: ['x64'] - qt_ver: '6.10.1'
vs: '2022'
aqt_arch: 'win64_msvc2022_64'
msvc_arch: 'x64'
runs-on: windows-2022 runs-on: windows-2022
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v4
with: with:
arch: 'win64_msvc2019_64' arch: ${{ matrix.aqt_arch }}
version: '6.7.2' version: ${{ matrix.qt_ver }}
modules: 'qtimageformats'
cache: true
- name: Build - name: Build
shell: cmd shell: cmd
run: | run: |
@@ -29,41 +34,108 @@ jobs:
qmake pineapple-pictures.pro qmake pineapple-pictures.pro
nmake nmake
nmake clean nmake clean
windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --skip-plugin-types tls,networkinformation release\ppic.exe windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types tls,networkinformation release\ppic.exe
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: windows-msvc2022-qt6.7.2-qmake-package name: "windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-qmake-package"
path: release/* path: release/*
msvc-cmake-build: msvc-cmake-build:
strategy: strategy:
matrix: matrix:
vs: ['2022'] include:
msvc_arch: ['x64'] - qt_ver: '6.10.1'
vs: '2022'
aqt_arch: 'win64_msvc2022_64'
msvc_arch: 'x64'
runs-on: windows-2022 runs-on: windows-2022
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v4
with: with:
arch: 'win64_msvc2019_64' arch: ${{ matrix.aqt_arch }}
version: '6.5.3' version: ${{ matrix.qt_ver }}
modules: 'qtimageformats'
cache: true
- name: Build - name: Build
shell: cmd shell: cmd
run: | run: |
:: ------ env ------
set PWD=%cd% set PWD=%cd%
set VS=${{ matrix.vs }} set VS=${{ matrix.vs }}
set VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" set VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
call %VCVARS% ${{ matrix.msvc_arch }} call %VCVARS% ${{ matrix.msvc_arch }}
cmake -Bbuild . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%PWD%\build\" :: ------ dep ------
set CMAKE_PREFIX_PATH=%PWD%/dependencies_bin
mkdir dependencies_src
echo ::group::===== exiv2 =====
curl -fsSL -o exiv2_bin.zip https://github.com/Exiv2/exiv2/releases/download/v0.28.7/exiv2-0.28.7-2022msvc-AMD64.zip
7z x exiv2_bin.zip -y
ren .\exiv2-0.28.7-2022msvc-AMD64 dependencies_bin
echo ::endgroup::
echo ::group::===== zlib =====
curl -fsSL -o zlib_src.zip https://zlib.net/zlib131.zip
7z x zlib_src.zip -y -o"dependencies_src"
ren .\dependencies_src\zlib-1.3.1 zlib || goto :error
cmake ./dependencies_src/zlib -Bbuild_dependencies/zlib -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
cmake --build build_dependencies/zlib --config Release --target=install || goto :error
echo ::endgroup::
echo ::group::===== AOM for libavif AVI decoding support =====
git clone -q -b v3.13.1 --depth 1 https://aomedia.googlesource.com/aom dependencies_src/aom
cmake ./dependencies_src/aom -Bbuild_dependencies/aom -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DENABLE_DOCS=OFF -DBUILD_SHARED_LIBS=ON -DAOM_TARGET_CPU=generic -DENABLE_TESTS=OFF -DENABLE_TESTDATA=OFF -DENABLE_TOOLS=OFF -DENABLE_EXAMPLES=0 || goto :error
cmake --build build_dependencies/aom --config Release --target=install || goto :error
echo ::endgroup::
echo ::group::===== libavif =====
curl -fsSL -o libavif-v1_3_0.zip https://github.com/AOMediaCodec/libavif/archive/v1.3.0.zip
7z x libavif-v1_3_0.zip -y -o"dependencies_src"
ren .\dependencies_src\libavif-1.3.0 libavif || goto :error
cmake ./dependencies_src/libavif -Bbuild_dependencies/libavif -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_AOM_DECODE=ON -DAVIF_CODEC_AOM_ENCODE=ON -DAVIF_LIBYUV=LOCAL
cmake --build build_dependencies/libavif --config Release --target=install || goto :error
echo ::endgroup::
echo ::group::===== expat =====
curl -fsSL -o expat_src.zip https://github.com/libexpat/libexpat/archive/R_2_7_3.zip
7z x expat_src.zip -y -o"dependencies_src"
ren .\dependencies_src\libexpat-R_2_7_3 expat || goto :error
cmake ./dependencies_src/expat/expat -Bbuild_dependencies/expat -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
cmake --build build_dependencies/expat --config Release --target=install || goto :error
echo ::endgroup::
echo ::group::===== ECM =====
git clone -q https://invent.kde.org/frameworks/extra-cmake-modules.git dependencies_src/extra-cmake-modules
cmake .\dependencies_src\extra-cmake-modules -Bbuild_dependencies/extra-cmake-modules -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DBUILD_TESTING=OFF || goto :error
cmake --build build_dependencies/extra-cmake-modules --config Release --target=install || goto :error
echo ::endgroup::
echo ::group::===== KArchive =====
git clone -q https://invent.kde.org/frameworks/karchive.git dependencies_src/karchive
cmake .\dependencies_src\karchive -Bbuild_dependencies/karchive -DBUILD_TESTING=OFF -DWITH_LIBZSTD=OFF -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
cmake --build build_dependencies/karchive --config Release --target=install || goto :error
echo ::endgroup::
echo ::group::===== KImageFormats =====
git clone -q https://invent.kde.org/frameworks/kimageformats.git dependencies_src/kimageformats
cmake .\dependencies_src\kimageformats -Bbuild_dependencies/kimageformats -DBUILD_TESTING=OFF -DKDE_INSTALL_QTPLUGINDIR=%QT_ROOT_DIR%\plugins || goto :error
cmake --build build_dependencies/kimageformats --config Release --target=install || goto :error
echo ::endgroup::
:: ------ app ------
echo ::group::===== App (Build'n'Install) =====
cmake -Bbuild .
cmake --build build --config Release cmake --build build --config Release
cmake --build build --config Release --target=install cmake --install build --config Release --prefix "%PWD%\build"
windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --skip-plugin-types tls,networkinformation build\bin\ppic.exe echo ::endgroup::
echo ::group::===== passoc stuff =====
curl -fsSL -o passoc-standalone.zip https://github.com/BLumia/pineapple-assoc-manager/releases/latest/download/pineapple-assoc-manager-qt${{ matrix.qt_ver }}-standalone.zip
7z x passoc-standalone.zip passoc.exe -y -o"build/bin"
echo ::endgroup::
:: ------ pkg ------
windeployqt --verbose=2 --no-compiler-runtime --no-quick-import --no-translations --no-network --no-opengl-sw --no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types tls,networkinformation build\bin\ppic.exe
robocopy ./dependencies_bin/bin build/bin *.dll
if ErrorLevel 8 (exit /B 1)
copy LICENSE build\bin
exit /B 0
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: windows-msvc2022-qt6.5.3-cmake-package name: "windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-cmake-package"
path: build/bin/* path: build/bin/*

9
.gitignore vendored
View File

@@ -2,12 +2,21 @@
*.user *.user
*.user.* *.user.*
# Why, macOS, why?
.DS_Store
# Translation files # Translation files
*.qm *.qm
*.mo *.mo
# Generic Build Dir # Generic Build Dir
[Bb]uild/ [Bb]uild/
cmake-build-*/
# IDE/Editor config folders # IDE/Editor config folders
.vscode/ .vscode/
.idea/
.qtcreator/
# Clangd cache
.cache/

View File

@@ -1,28 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Pineapple Pictures
Source: https://github.com/BLumia/pineapple-pictures
# Config files
Files: .gitignore appveyor.yml .github/*
Copyright: None
License: CC0-1.0
# README, resource files and Metadata files
Files: README*.md NEWS assets/*.rc assets/*.qrc dist/*
Copyright: None
License: CC0-1.0
# Translation files
# See assets/plain/translators.html for a list of translators
Files: app/translations/*.ts assets/plain/translators.html
Copyright: Translators from hosted.weblate.org
License: MIT
# Assets
Files: assets/icons/*.svg
Copyright: 2022 Gary Wang
License: MIT
Files: assets/icons/app-icon.*
Copyright: 2020 Lovelyblack
License: MIT

View File

@@ -1,49 +1,37 @@
# SPDX-FileCopyrightText: 2022 - 2024 Gary Wang <git@blumia.net> # SPDX-FileCopyrightText: 2022 - 2025 Gary Wang <git@blumia.net>
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
cmake_minimum_required (VERSION 3.9.5) cmake_minimum_required(VERSION 3.16)
project (pineapple-pictures) project(pineapple-pictures VERSION 1.3.0) # don't forget to update NEWS file and AppStream metadata.
include(GNUInstallDirs) include(GNUInstallDirs)
include(FeatureSummary) include(FeatureSummary)
option (EXIV2_METADATA_SUPPORT "Better image metadata support via libexiv2" ON) option (EXIV2_METADATA_SUPPORT "Better image metadata support via libexiv2" ON)
option (PREFER_QT_5 "Prefer to use Qt 5" OFF) option (TRANSLATION_RESOURCE_EMBEDDING "Embedding .qm translation files inside resource" OFF)
set (CMAKE_CXX_STANDARD 17) set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_AUTOMOC ON) set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTORCC ON) set (CMAKE_AUTORCC ON)
if (PREFER_QT_5)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core)
else ()
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core) find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
endif ()
if (${QT_VERSION_MAJOR} EQUAL "5")
set (QT_MINIMUM_VERSION "5.15.2")
else ()
set (QT_MINIMUM_VERSION "6.4") set (QT_MINIMUM_VERSION "6.4")
endif ()
find_package(Qt${QT_VERSION_MAJOR} ${QT_MINIMUM_VERSION} REQUIRED find_package(Qt${QT_VERSION_MAJOR} ${QT_MINIMUM_VERSION} REQUIRED
COMPONENTS Widgets Svg LinguistTools COMPONENTS Widgets Svg SvgWidgets LinguistTools
OPTIONAL_COMPONENTS DBus OPTIONAL_COMPONENTS DBus
) )
if (${QT_VERSION_MAJOR} EQUAL "6")
find_package(Qt${QT_DEFAULT_MAJOR_VERSION} ${QT_MINIMUM_VERSION} CONFIG REQUIRED SvgWidgets)
endif ()
if (EXIV2_METADATA_SUPPORT) if (EXIV2_METADATA_SUPPORT)
find_package(Exiv2) find_package(exiv2)
set_package_properties(Exiv2 PROPERTIES set_package_properties(exiv2 PROPERTIES
URL "https://www.exiv2.org" URL "https://www.exiv2.org"
DESCRIPTION "image metadata support" DESCRIPTION "image metadata support"
TYPE OPTIONAL TYPE RECOMMENDED
PURPOSE "Bring better image metadata support" PURPOSE "Bring better image metadata support"
) )
endif () endif ()
@@ -66,6 +54,8 @@ set (PPIC_CPP_FILES
app/metadatadialog.cpp app/metadatadialog.cpp
app/exiv2wrapper.cpp app/exiv2wrapper.cpp
app/playlistmanager.cpp app/playlistmanager.cpp
app/shortcutedit.cpp
app/fileopeneventhandler.cpp
) )
set (PPIC_HEADER_FILES set (PPIC_HEADER_FILES
@@ -85,6 +75,8 @@ set (PPIC_HEADER_FILES
app/metadatadialog.h app/metadatadialog.h
app/exiv2wrapper.h app/exiv2wrapper.h
app/playlistmanager.h app/playlistmanager.h
app/shortcutedit.h
app/fileopeneventhandler.h
) )
set (PPIC_QRC_FILES set (PPIC_QRC_FILES
@@ -102,43 +94,47 @@ file (GLOB PPIC_TS_FILES app/translations/*.ts)
set (PPIC_CPP_FILES_FOR_I18N ${PPIC_CPP_FILES}) set (PPIC_CPP_FILES_FOR_I18N ${PPIC_CPP_FILES})
if (WIN32) if (WIN32)
list(APPEND PPIC_RC_FILES assets/pineapple-pictures.rc) configure_file(assets/pineapple-pictures.rc.in pineapple-pictures.rc @ONLY)
list(APPEND PPIC_RC_FILES ${CMAKE_CURRENT_BINARY_DIR}/pineapple-pictures.rc)
endif () endif ()
add_executable (${EXE_NAME} WIN32 add_executable (${EXE_NAME}
${PPIC_HEADER_FILES} ${PPIC_HEADER_FILES}
${PPIC_CPP_FILES} ${PPIC_CPP_FILES}
${PPIC_QRC_FILES} ${PPIC_QRC_FILES}
${PPIC_RC_FILES} ${PPIC_RC_FILES}
) )
if (${QT_VERSION_MAJOR} EQUAL "6") set(ADD_TRANSLATIONS_ADDITIONAL_ARGS)
qt_add_translations(${EXE_NAME} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES)
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.9.0")
set(ADD_TRANSLATIONS_ADDITIONAL_ARGS MERGE_QT_TRANSLATIONS)
endif()
if (TRANSLATION_RESOURCE_EMBEDDING)
qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES})
else() else()
qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES)
endif() endif()
target_sources(${EXE_NAME} PRIVATE ${PPIC_QM_FILES}) target_sources(${EXE_NAME} PRIVATE ${PPIC_QM_FILES})
target_link_libraries (${EXE_NAME} Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg) target_link_libraries (${EXE_NAME} Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::SvgWidgets)
if (${QT_VERSION_MAJOR} EQUAL "6")
target_link_libraries (${EXE_NAME} Qt::SvgWidgets)
endif ()
if (Exiv2_FOUND) if (exiv2_FOUND)
if(NOT TARGET Exiv2::exiv2lib AND TARGET exiv2lib) if(NOT TARGET Exiv2::exiv2lib AND TARGET exiv2lib)
# for exiv2 0.27.x # for exiv2 0.27.x and (macOS?) conan build
add_library(Exiv2::exiv2lib ALIAS exiv2lib) add_library(Exiv2::exiv2lib ALIAS exiv2lib)
endif() endif()
target_link_libraries (${EXE_NAME} target_link_libraries (${EXE_NAME}
Exiv2::exiv2lib Exiv2::exiv2lib
) )
target_compile_definitions(${EXE_NAME} PRIVATE target_compile_definitions(${EXE_NAME} PRIVATE
HAVE_EXIV2_VERSION="${Exiv2_VERSION}" HAVE_EXIV2_VERSION="${exiv2_VERSION}"
) )
endif () endif ()
if (TARGET Qt5::DBus OR TARGET Qt6::DBus) if (TARGET Qt6::DBus)
target_link_libraries (${EXE_NAME} target_link_libraries (${EXE_NAME}
Qt${QT_VERSION_MAJOR}::DBus Qt${QT_VERSION_MAJOR}::DBus
) )
@@ -179,6 +175,7 @@ macro (ppic_set_version_via_describe _describe_long)
endmacro () endmacro ()
# Version setup # Version setup
target_compile_definitions(${EXE_NAME} PRIVATE PPIC_VERSION_STRING="${CMAKE_PROJECT_VERSION}")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git") if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
find_package(Git) find_package(Git)
set_package_properties(Git PROPERTIES TYPE OPTIONAL PURPOSE "Determine exact build version.") set_package_properties(Git PROPERTIES TYPE OPTIONAL PURPOSE "Determine exact build version.")
@@ -198,8 +195,24 @@ endif ()
# Install settings # Install settings
if (WIN32) if (WIN32)
# TODO: try to avoid install to a "bin" subfolder under windows... set_target_properties(${EXE_NAME} PROPERTIES
# when fixed, don't forget to update the CI config file... WIN32_EXECUTABLE TRUE
)
elseif (APPLE)
set_source_files_properties(assets/icons/app-icon.icns PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources"
)
target_sources(${EXE_NAME} PUBLIC assets/icons/app-icon.icns)
# See https://cmake.org/cmake/help/v3.15/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html
set_target_properties(${EXE_NAME} PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/dist/MacOSXBundleInfo.plist.in
MACOSX_BUNDLE_BUNDLE_NAME "Pineapple Pictures"
MACOSX_BUNDLE_GUI_IDENTIFIER net.blumia.pineapple-pictures
MACOSX_BUNDLE_ICON_FILE app-icon.icns # contains the .icns file name, *without* the path.
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)
elseif (UNIX) elseif (UNIX)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr) set(CMAKE_INSTALL_PREFIX /usr)
@@ -226,6 +239,7 @@ elseif (UNIX)
endif() endif()
set (INSTALL_TARGETS_DEFAULT_ARGS set (INSTALL_TARGETS_DEFAULT_ARGS
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Devel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Devel
@@ -236,19 +250,44 @@ install (
${INSTALL_TARGETS_DEFAULT_ARGS} ${INSTALL_TARGETS_DEFAULT_ARGS}
) )
if (WIN32) if (TRANSLATION_RESOURCE_EMBEDDING)
target_compile_definitions(${EXE_NAME}
PRIVATE TRANSLATION_RESOURCE_EMBEDDING
)
elseif (WIN32)
set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}/translations") set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}/translations")
else() else()
set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/pineapple-pictures/translations") set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/pineapple-pictures/translations")
target_compile_definitions(${EXE_NAME} target_compile_definitions(${EXE_NAME}
PRIVATE QM_FILE_INSTALL_DIR=${QM_FILE_INSTALL_DIR} PRIVATE QM_FILE_INSTALL_ABSOLUTE_DIR=${QM_FILE_INSTALL_DIR}
) )
endif() endif()
if (DEFINED QM_FILE_INSTALL_DIR)
install( install(
FILES ${PPIC_QM_FILES} FILES ${PPIC_QM_FILES}
DESTINATION ${QM_FILE_INSTALL_DIR} DESTINATION ${QM_FILE_INSTALL_DIR}
) )
endif()
if (WIN32)
install(
FILES dist/passoc/ppic.pacfg
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME default-assoc.pacfg
)
install(
FILES
dist/passoc/generic.ico
dist/passoc/jpeg.ico
dist/passoc/gif.ico
dist/passoc/svg.ico
dist/passoc/png.ico
dist/passoc/psd.ico
DESTINATION "${CMAKE_INSTALL_BINDIR}/icons"
)
endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
@@ -265,7 +304,7 @@ elseif (APPLE)
elseif (UNIX) elseif (UNIX)
set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "kimageformat-plugins") set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "kimageformat6-plugins")
endif() endif()
include(CPack) include(CPack)

View File

@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2020 BLumia Copyright (c) 2025 BLumia
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

181
NEWS
View File

@@ -1,3 +1,181 @@
Version 1.3.0
~~~~~~~~~~~~~
Released: 2025-12-20
Features:
* New option to limit SVG support to SVG Tiny 1.2 standard
* Windows: ship tools and configurations that help user associate image files to this program
Bugfixes:
* Fix window not appear at the screen that the mouse cursor is at
* Fix Windows prebuilt binary having AVIF plugin included but not actually support it
Miscellaneous:
* CPack DEB: will now recommend "kimageformat6-plugins" instead of the KF5 version
* Update translations
* Update exiv2 version for Windows binary build
Contributors:
VenusGirl, Andrey
Version 1.2.1
~~~~~~~~~~~~~
Released: 2025-11-22
Bugfixes:
* Fix incorrect color when display some CMYK images.
Miscellaneous:
* Now use Qt 6.10.1 for pre-built binary
* Update README description and AppStream metainfo
* Update translations
* Update libavif, AOM and expat version for Windows binary build
Contributors:
albanobattistella
Version 1.2.0
~~~~~~~~~~~~~
Released: 2025-09-21
Features:
* Long image mode that detect extra wide image and auto fit by its thin side
* Windows: Add product version to binary metadata / resource file
Miscellaneous:
* Update translations
* Update libavif version for Windows binary build
Contributors:
Heimen Stoffels, albanobattistella, Sabri Ünal
Version 1.1.1
~~~~~~~~~~~~~
Released: 2025-08-02
Features:
* Click dock icon should show window when it's hidden on macOS
Bugfixes:
* Ensure "Fit by Width" position the view to the beginning of the image
Miscellaneous:
* Update translations
* Update Exiv2 version for Windows binary build
Contributors:
Heimen Stoffels, VenusGirl, தமிழ்நேரம்
Version 1.1.0
~~~~~~~~~~~~~
Released: 2025-07-06
Features:
* New option to disable built-in close window animation
* New option to disable gallery looping
* Support load m3u8 as image gallery playlist
Miscellaneous:
* Drop Qt 5 support
Contributors:
Heimen Stoffels, albanobattistella, தமிழ்நேரம்
Version 1.0.0
~~~~~~~~~~~~~
Released: 2025-05-03
Features:
* Support enforces windowed mode on start-up
* Reload image automatically when current image gets updated
Bugfixes:
* Display correct text language on macOS
Miscellaneous:
* Use native text for shortcut editor's label
* Display native commandline message when possible
* Merge Qt translations into app applications as well
Contributors:
Heimen Stoffels, albanobattistella, mmahhi
Version 0.9.2
~~~~~~~~~~~~~
Released: 2025-03-05
Bugfixes:
* Refer to the right exiv2 CMake module so it can be found on Linux
Miscellaneous:
* Convert DEP5 to REUSE.toml for better REUSE compliance
* Update translations
Contributors:
Pino Toscano, TamilNeram
Version 0.9.1
~~~~~~~~~~~~~
Released: 2025-01-25
Features:
* Option to double-click to fullscreen
* Build-time option to embed translation resources
Bugfixes:
* Fix window size not adjusted when open file on macOS
* Should center window according to available screen geometry
Miscellaneous:
* Change close window bahavior on macOS
* Update translations
Contributors:
albanobattistella, Sabri Ünal
Version 0.9.0
~~~~~~~~~~~~~
Released: 2024-12-08
Features:
* Support custom shortcuts for existing actions
* Actions for frame-by-frame animated image playback support
Miscellaneous:
* Initial macOS bundle support
* bump minimum required CMake version to 3.16
* Update translations
Contributors:
albanobattistella, VenusGirl, gallegonovato, Sabri Ünal
Version 0.8.2.1
~~~~~~~~~~~~~
Released: 2024-10-27
Bugfixes:
* Cannot load translations caused by a change in 0.8.2
Version 0.8.2
~~~~~~~~~~~~~
Released: 2024-10-26
Features:
* New option to allow use light-color checkerboard by default
Contributors:
albanobattistella, mmahhi, gallegonovato
Version 0.8.1
~~~~~~~~~~~~~
Released: 2024-08-25
Features:
* New command line option to list all supported formats
Contributors:
albanobattistella, mmahhi, ovl-1, gallegonovato, Oğuz Ersen
Version 0.8.0 Version 0.8.0
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Released: 2024-06-29 Released: 2024-06-29
@@ -47,7 +225,7 @@ Version 0.7.1
Released: 2023-07-08 Released: 2023-07-08
Features: Features:
* TIF and TIFF format files in the same folder will now be automatedly added to the gallery * TIF and TIFF format files in the same folder will now be automatically added to the gallery
* Built-in window resizing now also supports Linux desktop. (macOS might also works as well) * Built-in window resizing now also supports Linux desktop. (macOS might also works as well)
Bugfixes: Bugfixes:
@@ -56,4 +234,3 @@ Bugfixes:
Contributors: Contributors:
yyc12345 yyc12345

View File

@@ -2,7 +2,7 @@ Yet another image viewer.
|CI|Build Status| |CI|Build Status|
|---|---| |---|---|
|Windows Build|[![Windows build status](https://ci.appveyor.com/api/projects/status/dbd8clww3cit6oa0/branch/master?svg=true)](https://ci.appveyor.com/project/BLumia/pineapplepictures/branch/master)| |Windows Build|[![Windows CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/windows.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/windows.yml)|
|macOS Build|[![macOS CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml)| |macOS Build|[![macOS CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml)|
|Ubuntu Build|[![Ubuntu CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml)| |Ubuntu Build|[![Ubuntu CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml)|
@@ -21,15 +21,24 @@ Pineapple Pictures is a lightweight image viewer that allows you view JPEG, PNG,
- Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/) - Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/)
- [Itch.io Store](https://blumia.itch.io/pineapple-pictures) - [Itch.io Store](https://blumia.itch.io/pineapple-pictures)
### Maintained by contributors / curtain distro's package maintainers ### Maintained by contributors / certain distro's package maintainers
- Debian (since bullseye) or Ubuntu (since 21.04): `sudo apt install pineapple-pictures` [![Packaging status](https://repology.org/badge/vertical-allrepos/pineapple-pictures.svg?columns=4)](https://repology.org/project/pineapple-pictures/versions)
- Nix / NixOS: [pineapple-pictures](https://search.nixos.org/packages?channel=unstable&show=pineapple-pictures&from=0&size=50&sort=relevance&type=packages&query=pineapple-pictures) (maintained by @wineee)
## Help Translation! ## Contribution
Beside feedback and code contribution, other contributions are also welcome!
### Help Translation!
[Translate this project on Weblate!](https://hosted.weblate.org/projects/pineapple-pictures/) [Translate this project on Weblate!](https://hosted.weblate.org/projects/pineapple-pictures/)
### Funding
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/blumia)
[![Afdian](https://static.afdiancdn.com/static/img/logo/logo.png)Afdian](https://afdian.com/a/BLumia)
## Build it manually: ## Build it manually:
Current state, we need: Current state, we need:
@@ -54,31 +63,11 @@ The project will try to build with `exiv2` when it's available at build time, if
Image formats supports rely on Qt's imageformats plugins, just get the plugins you need from your distro's package manager will be fine. For Windows user, you may need build and install the imageformats plugin manually, read the content below. Image formats supports rely on Qt's imageformats plugins, just get the plugins you need from your distro's package manager will be fine. For Windows user, you may need build and install the imageformats plugin manually, read the content below.
It's possible to build it under Windows, Linux, macOS, and maybe other desktop platforms that Qt is ported to. For platform specific build instructions, please read the [related wiki page](https://github.com/BLumia/pineapple-pictures/wiki/Platform-Specific-Build-Instructions).
> [!NOTE] > [!NOTE]
> Although there is a `pineapple-pictures.pro` file which can be used for QMake build, it's only for testing purpose and it doesn't have `exiv2` support included. Using QMake to build this project is NOT supported, please use CMake if possible. > Although there is a `pineapple-pictures.pro` file which can be used for QMake build, it's only for testing purpose and it doesn't have `exiv2` support included. Using QMake to build this project is NOT supported, please use CMake if possible.
### Linux
Just normal build process as other program will be fine. Nothing special ;)
For Archlinux there are also a [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pineapple-pictures-git) you can use.
For packaging to debian-based distro, the `CMakeLists.txt` provides some cpack configurations for generating a `.deb` package. After the build process, use `cpack -G DEB` to generate the package. You can also take `.github/workflows/ubuntu.yml` as a reference.
For this project, `DEB` is the only supported cpack generator in current state, feel free to submit a PR if you like improving `cpack` support for this project.
### Windows
The normal build steps for Linux is also applied to Windows, but since Windows doesn't have a decent package manager, so if you need any other image formats support other than the supported formats which Qt provided, you need to get and build these imageformats plugins manually and vendor it. It's optional and can be skipped if you don't need extra image formats support.
For the Windows binary I provided, kimageformats plugin is used (for formats like kra, xcf, psd and etc.). You can take `appveyor.yml` as a reference to learn what I did when building the Windows binary.
[KDE Craft](https://community.kde.org/Craft) environment also can be used to build and package this program. I did also created a blueprint for building this project that you can found it at [here](https://github.com/BearKidsTeam/craft-shmooprint-bkt). It's not the way I used to create the release binary, but still worth trying.
### macOS
I don't have a mac, so no support at all. There is also a GitHub Action (see `.github/workflows/macos.yml`) running macOS build though so at least it can build. Feel free to submit a PR if you would like to give some love to the macOS build ;P
## License ## License
Pineapple Pictures as a whole is licensed under MIT license. Individual files may have a different, but compatible license. Pineapple Pictures as a whole is licensed under MIT license. Individual files may have a different, but compatible license.

View File

@@ -2,7 +2,7 @@
|CI|构建状态| |CI|构建状态|
|---|---| |---|---|
|Windows Build|[![Windows build status](https://ci.appveyor.com/api/projects/status/dbd8clww3cit6oa0/branch/master?svg=true)](https://ci.appveyor.com/project/BLumia/pineapplepictures/branch/master)| |Windows Build|[![Windows CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/windows.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/windows.yml)|
|macOS Build|[![macOS CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml)| |macOS Build|[![macOS CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml)|
|Ubuntu Build|[![Ubuntu CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml)| |Ubuntu Build|[![Ubuntu CI](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml)|
@@ -16,7 +16,7 @@
### 由原作者维护 ### 由原作者维护
- [GitHub Release 页面](https://github.com/BLumia/pineapple-pictures/releases) | [gitee 发布页面](https://gitee.com/blumia/pineapple-pictures/releases) - [GitHub Release 页面](https://github.com/BLumia/pineapple-pictures/releases)
- [SourceForge](https://sourceforge.net/projects/pineapple-pictures/) - [SourceForge](https://sourceforge.net/projects/pineapple-pictures/)
- Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/) - Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/)
- [Itch.io 商店](https://blumia.itch.io/pineapple-pictures) - [Itch.io 商店](https://blumia.itch.io/pineapple-pictures)
@@ -24,13 +24,22 @@
### 由贡献者/对应发行版的打包人员维护 ### 由贡献者/对应发行版的打包人员维护
- Debian (自 bullseye 起) 或 Ubuntu (自 21.04 起): `sudo apt install pineapple-pictures` [![打包状态](https://repology.org/badge/vertical-allrepos/pineapple-pictures.svg?columns=4)](https://repology.org/project/pineapple-pictures/versions)
- Nix / NixOS: [pineapple-pictures](https://search.nixos.org/packages?channel=unstable&show=pineapple-pictures&from=0&size=50&sort=relevance&type=packages&query=pineapple-pictures) (由 [@wineee](https://github.com/wineee) 维护)
## 帮助翻译! ## 参与贡献
除了参与反馈和代码贡献外,也欢迎各种类型的贡献!
### 帮助翻译!
[在 Weblate 上帮助此项目翻译到更多语言!](https://hosted.weblate.org/projects/pineapple-pictures/) [在 Weblate 上帮助此项目翻译到更多语言!](https://hosted.weblate.org/projects/pineapple-pictures/)
### 打赏
[![Afdian](https://static.afdiancdn.com/static/img/logo/logo.png)Afdian | 爱发电](https://afdian.com/a/BLumia)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/blumia)
## 手动构建步骤: ## 手动构建步骤:
当前状态,我们需要先确保如下依赖可用: 当前状态,我们需要先确保如下依赖可用:
@@ -55,31 +64,11 @@ $ cmake --build . # 如果你使用 Makefile 作为 CMake 生成器,也可以
此应用的图片格式支持依赖于 Qt 的 imageformats 插件,直接从您所用的发行版获取对应的图像格式插件即可。对于 Windows 用户,您可能需要手动构建和使用图像格式插件。下方给出了进一步的说明。 此应用的图片格式支持依赖于 Qt 的 imageformats 插件,直接从您所用的发行版获取对应的图像格式插件即可。对于 Windows 用户,您可能需要手动构建和使用图像格式插件。下方给出了进一步的说明。
在 Windows、Linux 以及 macOS 系统均可构建此应用,其它有移植 Qt 支持的平台也可能可以进行构建。若要了解一些平台相关的构建指引,请参阅[相关的 Wiki 页面](https://github.com/BLumia/pineapple-pictures/wiki/Platform-Specific-Build-Instructions)。
> [!NOTE] > [!NOTE]
> 尽管存在一个可用于 QMake 构建的 `pineapple-pictures.pro` 文件,但其仅供简单测试所用且其并不包含 `exiv2` 支持。使用 QMake 构建此项目是 **不受支持** 的,请尽可能考虑使用 CMake。 > 尽管存在一个可用于 QMake 构建的 `pineapple-pictures.pro` 文件,但其仅供简单测试所用且其并不包含 `exiv2` 支持。使用 QMake 构建此项目是 **不受支持** 的,请尽可能考虑使用 CMake。
### Linux
常规的构建步骤即可完成构建,不需要额外的处理步骤 ;)
对于 Archlinux 发行版的用户,这里还有一个 [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pineapple-pictures-git) 可供使用和参考。
对于在基于 debian 的发行版中进行打包的需求, `CMakeLists.txt` 已经提供了一些基本的 cpack 配置以便生成一个有效的 `.deb` 软件包。在构建步骤完毕后,使用 `cpack -G DEB` 即可生成 DEB 软件包。您也可以参考 `.github/workflows/ubuntu.yml` 来查看当前正在使用的 CI 配置是如何进行打包的。
目前,`DEB` 是当前唯一受到直接支持的 cpack 生成目标。若希望为此项目添加其它的 cpack 目标支持,欢迎发起合并请求。
### Windows
上述的构建步骤在 Windows 中也适用,但由于 Windows 中不具备类如大多 Linux 发行版中所提供的方便的软件包管理机制,故如果您需要任何 Qt 官方支持之外的图像格式例如 psdxcfkra 等格式的支持,你就可能需要自行获取并构建对应的 imageformats 插件,并在您最终生成的可执行文件中一并提供这些插件。若您不需要这些额外的图像格式支持,这个步骤也可以直接跳过。
我们所提供的预编译好的 Windows 程序包含了 kimageformats 插件来提供额外kra, xcf, psd 等)格式的支持。您可以参考 `appveyor.yml` 来查看我们是如何构建并打包 Windows 可执行程序的。
[KDE Craft](https://community.kde.org/Craft) 环境也可以被用来构建此应用程序。我也创建了一个蓝图来进行此项目的构建和打包,可参见[这里](https://github.com/BearKidsTeam/craft-shmooprint-bkt)。尽管这不是我用于构建发布二进制所使用的方案,但仍值得一试。
### macOS
由于我没有 mac 设备,故 macOS 暂时不受任何支持。不过我们目前有一个 GitHub Action 来执行 macOS 环境下的构建(见 `.github/workflows/macos.yml`)所以至少 macOS 下是可以顺利进行构建的。如果您想完善对 macOS 的支持,也欢迎您创建合并请求 ;P
## 许可协议 ## 许可协议
菠萝看图整体使用 MIT 协议进行发布。项目所随的部分源文件可能具备不同但与之兼容的许可协议。 菠萝看图整体使用 MIT 协议进行发布。项目所随的部分源文件可能具备不同但与之兼容的许可协议。

39
REUSE.toml Normal file
View File

@@ -0,0 +1,39 @@
version = 1
SPDX-PackageName = "Pineapple Pictures"
SPDX-PackageDownloadLocation = "https://github.com/BLumia/pineapple-pictures"
[[annotations]]
path = [".gitattributes", ".git-blame-ignore-revs", ".gitignore", "appveyor.yml", ".github/**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = ["README**.md", "NEWS", "assets/**.rc.in", "assets/**.qrc", "dist/appstream/**", "dist/**.in", "dist/**.desktop"]
precedence = "aggregate"
SPDX-FileCopyrightText = "None"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
path = ["dist/passoc/**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 Gary Wang"
SPDX-License-Identifier = "MIT"
[[annotations]]
path = ["app/translations/**.ts", "assets/plain/translators.html"]
precedence = "aggregate"
SPDX-FileCopyrightText = "Translators from hosted.weblate.org"
SPDX-License-Identifier = "MIT"
[[annotations]]
path = "assets/icons/**.svg"
precedence = "aggregate"
SPDX-FileCopyrightText = "2022 Gary Wang"
SPDX-License-Identifier = "MIT"
[[annotations]]
path = "assets/icons/app-icon.**"
precedence = "aggregate"
SPDX-FileCopyrightText = "2020 Lovelyblack"
SPDX-License-Identifier = "MIT"

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com> // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -14,6 +14,8 @@
#include <QPushButton> #include <QPushButton>
#include <QFile> #include <QFile>
using namespace Qt::Literals::StringLiterals;
AboutDialog::AboutDialog(QWidget *parent) AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent) : QDialog(parent)
, m_tabWidget(new QTabWidget) , m_tabWidget(new QTabWidget)
@@ -27,56 +29,60 @@ AboutDialog::AboutDialog(QWidget *parent)
this->setWindowTitle(tr("About")); this->setWindowTitle(tr("About"));
const QStringList helpStr { const QStringList helpStr {
QStringLiteral("<p>%1</p>").arg(tr("Launch application with image file path as argument to load the file.")), u"<p>%1</p>"_s.arg(tr("Launch application with image file path as argument to load the file.")),
QStringLiteral("<p>%1</p>").arg(tr("Drag and drop image file onto the window is also supported.")), u"<p>%1</p>"_s.arg(tr("Drag and drop image file onto the window is also supported.")),
QStringLiteral("<p>%1</p>").arg(tr("None of the operations in this application will alter the pictures on disk.")), u"<p>%1</p>"_s.arg(tr("None of the operations in this application will alter the pictures on disk.")),
QStringLiteral("<p>%1</p>").arg(tr("Context menu option explanation:")), u"<p>%1</p>"_s.arg(tr("Context menu option explanation:")),
QStringLiteral("<ul>"), u"<ul>"_s,
// blumia: Chain two arg() here since it seems lupdate will remove one of them if we use // blumia: Chain two arg() here since it seems lupdate will remove one of them if we use
// the old `arg(QCoreApp::translate(), tr())` way, but it's worth to mention // the old `arg(QCoreApp::translate(), tr())` way, but it's worth to mention
// `arg(QCoreApp::translate(), this->tr())` works, but lupdate will complain about the usage. // `arg(QCoreApp::translate(), this->tr())` works, but lupdate will complain about the usage.
QStringLiteral("<li><b>%1</b>:<br/>%2</li>") u"<li><b>%1</b>:<br/>%2</li>"_s
.arg(QCoreApplication::translate("MainWindow", "Stay on top")) .arg(QCoreApplication::translate("MainWindow", "Stay on top"))
.arg(tr("Make window stay on top of all other windows.")), .arg(tr("Make window stay on top of all other windows.")),
QStringLiteral("<li><b>%1</b>:<br/>%2</li>") u"<li><b>%1</b>:<br/>%2</li>"_s
.arg(QCoreApplication::translate("MainWindow", "Protected mode")) .arg(QCoreApplication::translate("MainWindow", "Protected mode"))
.arg(tr("Avoid close window accidentally. (eg. by double clicking the window)")), .arg(tr("Avoid close window accidentally. (eg. by double clicking the window)")),
QStringLiteral("<li><b>%1</b>:<br/>%2</li>") u"<li><b>%1</b>:<br/>%2</li>"_s
.arg(QCoreApplication::translate("MainWindow", "Keep transformation", "The 'transformation' means the flip/rotation status that currently applied to the image view")) .arg(QCoreApplication::translate("MainWindow", "Keep transformation", "The 'transformation' means the flip/rotation status that currently applied to the image view"))
.arg(tr("Avoid resetting the zoom/rotation/flip state that was applied to the image view when switching between images.")), .arg(tr("Avoid resetting the zoom/rotation/flip state that was applied to the image view when switching between images.")),
QStringLiteral("</ul>") u"</ul>"_s
}; };
const QStringList aboutStr { const QStringList aboutStr {
QStringLiteral("<center><img width='128' height='128' src=':/icons/app-icon.svg'/><br/>"), u"<center><img width='128' height='128' src=':/icons/app-icon.svg'/><br/>"_s,
qApp->applicationDisplayName(), qApp->applicationDisplayName(),
(u"<br/>"_s + tr("Version: %1").arg(
#ifdef GIT_DESCRIBE_VERSION_STRING #ifdef GIT_DESCRIBE_VERSION_STRING
(QStringLiteral("<br/>") + tr("Version: %1").arg(GIT_DESCRIBE_VERSION_STRING)), GIT_DESCRIBE_VERSION_STRING
#else
qApp->applicationVersion()
#endif // GIT_DESCRIBE_VERSION_STRING #endif // GIT_DESCRIBE_VERSION_STRING
QStringLiteral("<hr/>"), )),
u"<hr/>"_s,
tr("Copyright (c) %1 %2", "%1 is year, %2 is the name of copyright holder(s)") tr("Copyright (c) %1 %2", "%1 is year, %2 is the name of copyright holder(s)")
.arg(QStringLiteral("2024"), QStringLiteral("<a href='https://github.com/BLumia'>@BLumia</a>")), .arg(u"2025"_s, u"<a href='https://github.com/BLumia'>@BLumia</a>"_s),
QStringLiteral("<br/>"), u"<br/>"_s,
tr("Logo designed by %1").arg(QStringLiteral("<a href='https://github.com/Lovelyblack'>@Lovelyblack</a>")), tr("Logo designed by %1").arg(u"<a href='https://github.com/Lovelyblack'>@Lovelyblack</a>"_s),
QStringLiteral("<hr/>"), u"<hr/>"_s,
tr("Built with Qt %1 (%2)").arg(QT_VERSION_STR, QSysInfo::buildCpuArchitecture()), tr("Built with Qt %1 (%2)").arg(QT_VERSION_STR, QSysInfo::buildCpuArchitecture()),
QStringLiteral("<br/><a href='%1'>%2</a>").arg("https://github.com/BLumia/pineapple-pictures", tr("Source code")), QStringLiteral("<br/><a href='%1'>%2</a>").arg("https://github.com/BLumia/pineapple-pictures", tr("Source code")),
QStringLiteral("</center>") u"</center>"_s
}; };
QFile translaterHtml(":/plain/translators.html"); QFile translaterHtml(u":/plain/translators.html"_s);
bool canOpenFile = translaterHtml.open(QIODevice::ReadOnly); bool canOpenFile = translaterHtml.open(QIODevice::ReadOnly);
const QByteArray & translatorList = canOpenFile ? translaterHtml.readAll() : QByteArrayLiteral(""); const QByteArray & translatorList = canOpenFile ? translaterHtml.readAll() : QByteArrayLiteral("");
const QStringList specialThanksStr { const QStringList specialThanksStr {
QStringLiteral("<h1 align='center'>%1</h1><a href='%2'>%3</a><p>%4</p>").arg( u"<h1 align='center'>%1</h1><a href='%2'>%3</a><p>%4</p>"_s.arg(
tr("Contributors"), tr("Contributors"),
QStringLiteral("https://github.com/BLumia/pineapple-pictures/graphs/contributors"), u"https://github.com/BLumia/pineapple-pictures/graphs/contributors"_s,
tr("List of contributors on GitHub"), tr("List of contributors on GitHub"),
tr("Thanks to all people who contributed to this project.") tr("Thanks to all people who contributed to this project.")
), ),
QStringLiteral("<h1 align='center'>%1</h1><p>%2</p>%3").arg( u"<h1 align='center'>%1</h1><p>%2</p>%3"_s.arg(
tr("Translators"), tr("Translators"),
tr("I would like to thank the following people who volunteered to translate this application."), tr("I would like to thank the following people who volunteered to translate this application."),
translatorList translatorList
@@ -84,22 +90,22 @@ AboutDialog::AboutDialog(QWidget *parent)
}; };
const QStringList licenseStr { const QStringList licenseStr {
QStringLiteral("<h1 align='center'><b>%1</b></h1>").arg(tr("Your Rights")), u"<h1 align='center'><b>%1</b></h1>"_s.arg(tr("Your Rights")),
QStringLiteral("<p>%1</p><p>%2</p><ul><li>%3</li><li>%4</li><li>%5</li><li>%6</li></ul>").arg( u"<p>%1</p><p>%2</p><ul><li>%3</li><li>%4</li><li>%5</li><li>%6</li></ul>"_s.arg(
tr("%1 is released under the MIT License."), // %1 tr("%1 is released under the MIT License."), // %1
tr("This license grants people a number of freedoms:"), // %2 tr("This license grants people a number of freedoms:"), // %2
tr("You are free to use %1, for any purpose"), // %3 tr("You are free to use %1, for any purpose"), // %3
tr("You are free to distribute %1"), // %4 tr("You are free to distribute %1"), // %4
tr("You can study how %1 works and change it"), // %5 tr("You can study how %1 works and change it"), // %5
tr("You can distribute changed versions of %1") // %6 tr("You can distribute changed versions of %1") // %6
).arg(QStringLiteral("<i>%1</i>")), ).arg(u"<i>%1</i>"_s),
QStringLiteral("<p>%1</p>").arg(tr("The MIT license guarantees you this freedom. Nobody is ever permitted to take it away.")), u"<p>%1</p>"_s.arg(tr("The MIT license guarantees you this freedom. Nobody is ever permitted to take it away.")),
QStringLiteral("<hr/><pre>%2</pre>") u"<hr/><pre>%2</pre>"_s
}; };
const QString mitLicense(QStringLiteral(R"(Expat/MIT License const QString mitLicense(QStringLiteral(R"(Expat/MIT License
Copyright (c) 2024 BLumia Copyright &copy; 2025 BLumia
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -121,14 +127,14 @@ SOFTWARE.
)")); )"));
const QStringList thirdPartyLibsStr { const QStringList thirdPartyLibsStr {
QStringLiteral("<h1 align='center'><b>%1</b></h1>").arg(tr("Third-party Libraries used by %1")), u"<h1 align='center'><b>%1</b></h1>"_s.arg(tr("Third-party Libraries used by %1")),
tr("%1 is built on the following free software libraries:", "Free as in freedom"), tr("%1 is built on the following free software libraries:", "Free as in freedom"),
QStringLiteral("<ul>"), u"<ul>"_s,
#ifdef HAVE_EXIV2_VERSION #ifdef HAVE_EXIV2_VERSION
QStringLiteral("<li><a href='%1'>%2</a>: %3</li>").arg("https://www.exiv2.org/", "Exiv2", "GPLv2"), u"<li><a href='%1'>%2</a>: %3</li>"_s.arg("https://www.exiv2.org/", "Exiv2", "GPLv2"),
#endif // EXIV2_VERSION #endif // EXIV2_VERSION
QStringLiteral("<li><a href='%1'>%2</a>: %3</li>").arg("https://www.qt.io/", "Qt", "GPLv2 + GPLv3 + LGPLv2.1 + LGPLv3"), u"<li><a href='%1'>%2</a>: %3</li>"_s.arg("https://www.qt.io/", "Qt", "GPLv2 + GPLv3 + LGPLv2.1 + LGPLv3"),
QStringLiteral("</ul>") u"</ul>"_s
}; };
m_helpTextEdit->setText(helpStr.join('\n')); m_helpTextEdit->setText(helpStr.join('\n'));
@@ -141,7 +147,7 @@ SOFTWARE.
m_licenseTextEdit->setText(licenseStr.join('\n').arg(qApp->applicationDisplayName(), mitLicense)); m_licenseTextEdit->setText(licenseStr.join('\n').arg(qApp->applicationDisplayName(), mitLicense));
m_3rdPartyLibsTextEdit->setText(thirdPartyLibsStr.join('\n').arg(QStringLiteral("<i>%1</i>").arg(qApp->applicationDisplayName()))); m_3rdPartyLibsTextEdit->setText(thirdPartyLibsStr.join('\n').arg(u"<i>%1</i>"_s).arg(qApp->applicationDisplayName()));
m_3rdPartyLibsTextEdit->setOpenExternalLinks(true); m_3rdPartyLibsTextEdit->setOpenExternalLinks(true);
m_tabWidget->addTab(m_helpTextEdit, tr("&Help")); m_tabWidget->addTab(m_helpTextEdit, tr("&Help"));

View File

@@ -16,16 +16,6 @@
#define ACTION_NAME(s) QStringLiteral(STRIFY(s)) #define ACTION_NAME(s) QStringLiteral(STRIFY(s))
#define STRIFY(s) #s #define STRIFY(s) #s
ActionManager::ActionManager()
{
}
ActionManager::~ActionManager()
{
}
QIcon ActionManager::loadHidpiIcon(const QString &resp, QSize sz) QIcon ActionManager::loadHidpiIcon(const QString &resp, QSize sz)
{ {
QSvgRenderer r(resp); QSvgRenderer r(resp);
@@ -57,13 +47,18 @@ void ActionManager::setupAction(MainWindow *mainWindow)
#define CREATE_NEW_ACTION(w, a) create_action(w, &a, QString(), ACTION_NAME(a)) #define CREATE_NEW_ACTION(w, a) create_action(w, &a, QString(), ACTION_NAME(a))
#define CREATE_NEW_THEMEICON_ACTION(w, a, i) create_action(w, &a, QLatin1String(STRIFY(i)), ACTION_NAME(a), true) #define CREATE_NEW_THEMEICON_ACTION(w, a, i) create_action(w, &a, QLatin1String(STRIFY(i)), ACTION_NAME(a), true)
CREATE_NEW_ACTION(mainWindow, actionRotateCounterClockwise);
CREATE_NEW_ACTION(mainWindow, actionPrevPicture); CREATE_NEW_ACTION(mainWindow, actionPrevPicture);
CREATE_NEW_ACTION(mainWindow, actionNextPicture); CREATE_NEW_ACTION(mainWindow, actionNextPicture);
CREATE_NEW_ACTION(mainWindow, actionTogglePauseAnimation);
CREATE_NEW_ACTION(mainWindow, actionAnimationNextFrame);
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionOpen, document-open); CREATE_NEW_THEMEICON_ACTION(mainWindow, actionOpen, document-open);
CREATE_NEW_ACTION(mainWindow, actionHorizontalFlip); CREATE_NEW_ACTION(mainWindow, actionHorizontalFlip);
CREATE_NEW_ACTION(mainWindow, actionFitInView); CREATE_NEW_ACTION(mainWindow, actionFitInView);
CREATE_NEW_ACTION(mainWindow, actionFitByWidth); CREATE_NEW_ACTION(mainWindow, actionFitByWidth);
CREATE_NEW_ACTION(mainWindow, actionFitLongImage);
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionCopyPixmap, edit-copy); CREATE_NEW_THEMEICON_ACTION(mainWindow, actionCopyPixmap, edit-copy);
CREATE_NEW_ACTION(mainWindow, actionCopyFilePath); CREATE_NEW_ACTION(mainWindow, actionCopyFilePath);
CREATE_NEW_THEMEICON_ACTION(mainWindow, actionPaste, edit-paste); CREATE_NEW_THEMEICON_ACTION(mainWindow, actionPaste, edit-paste);
@@ -96,13 +91,18 @@ void ActionManager::retranslateUi(MainWindow *mainWindow)
actionZoomOut->setText(QCoreApplication::translate("MainWindow", "Zoom out", nullptr)); actionZoomOut->setText(QCoreApplication::translate("MainWindow", "Zoom out", nullptr));
actionToggleCheckerboard->setText(QCoreApplication::translate("MainWindow", "Toggle Checkerboard", nullptr)); actionToggleCheckerboard->setText(QCoreApplication::translate("MainWindow", "Toggle Checkerboard", nullptr));
actionRotateClockwise->setText(QCoreApplication::translate("MainWindow", "Rotate right", nullptr)); actionRotateClockwise->setText(QCoreApplication::translate("MainWindow", "Rotate right", nullptr));
actionRotateCounterClockwise->setText(QCoreApplication::translate("MainWindow", "Rotate left", nullptr));
actionPrevPicture->setText(QCoreApplication::translate("MainWindow", "Previous image", nullptr)); actionPrevPicture->setText(QCoreApplication::translate("MainWindow", "Previous image", nullptr));
actionNextPicture->setText(QCoreApplication::translate("MainWindow", "Next image", nullptr)); actionNextPicture->setText(QCoreApplication::translate("MainWindow", "Next image", nullptr));
actionTogglePauseAnimation->setText(QCoreApplication::translate("MainWindow", "Pause/Resume Animation", nullptr));
actionAnimationNextFrame->setText(QCoreApplication::translate("MainWindow", "Animation Go to Next Frame", nullptr));
actionHorizontalFlip->setText(QCoreApplication::translate("MainWindow", "Flip &Horizontally", nullptr)); actionHorizontalFlip->setText(QCoreApplication::translate("MainWindow", "Flip &Horizontally", nullptr));
actionFitInView->setText("Fit in view"); // TODO: what should it called? actionFitInView->setText(QCoreApplication::translate("MainWindow", "Fit to view", nullptr));
actionFitByWidth->setText("Fit by width"); // TODO: what should it called? actionFitByWidth->setText(QCoreApplication::translate("MainWindow", "Fit to width", nullptr));
actionFitLongImage->setText(QCoreApplication::translate("MainWindow", "Fit long image", nullptr));
actionCopyPixmap->setText(QCoreApplication::translate("MainWindow", "Copy P&ixmap", nullptr)); actionCopyPixmap->setText(QCoreApplication::translate("MainWindow", "Copy P&ixmap", nullptr));
actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr)); actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr));
actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr)); actionPaste->setText(QCoreApplication::translate("MainWindow", "&Paste", nullptr));
@@ -128,10 +128,10 @@ void ActionManager::retranslateUi(MainWindow *mainWindow)
void ActionManager::setupShortcuts() void ActionManager::setupShortcuts()
{ {
actionOpen->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_O)); actionOpen->setShortcut(QKeySequence::Open);
actionActualSize->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0)); actionActualSize->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
actionZoomIn->setShortcut(QKeySequence(QKeySequence::ZoomIn)); actionZoomIn->setShortcut(QKeySequence::ZoomIn);
actionZoomOut->setShortcut(QKeySequence(QKeySequence::ZoomOut)); actionZoomOut->setShortcut(QKeySequence::ZoomOut);
actionPrevPicture->setShortcuts({ actionPrevPicture->setShortcuts({
QKeySequence(Qt::Key_PageUp), QKeySequence(Qt::Key_PageUp),
QKeySequence(Qt::Key_Left), QKeySequence(Qt::Key_Left),
@@ -141,7 +141,7 @@ void ActionManager::setupShortcuts()
QKeySequence(Qt::Key_Right), QKeySequence(Qt::Key_Right),
}); });
actionHorizontalFlip->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_R)); actionHorizontalFlip->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_R));
actionCopyPixmap->setShortcut(QKeySequence(QKeySequence::Copy)); actionCopyPixmap->setShortcut(QKeySequence::Copy);
actionPaste->setShortcut(QKeySequence::Paste); actionPaste->setShortcut(QKeySequence::Paste);
actionTrash->setShortcut(QKeySequence::Delete); actionTrash->setShortcut(QKeySequence::Delete);
actionHelp->setShortcut(QKeySequence::HelpContents); actionHelp->setShortcut(QKeySequence::HelpContents);

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com> // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -12,8 +12,8 @@ class MainWindow;
class ActionManager class ActionManager
{ {
public: public:
ActionManager(); explicit ActionManager() = default;
~ActionManager(); ~ActionManager() = default;
void setupAction(MainWindow * mainWindow); void setupAction(MainWindow * mainWindow);
void retranslateUi(MainWindow *MainWindow); void retranslateUi(MainWindow *MainWindow);
@@ -30,13 +30,18 @@ public:
QAction *actionZoomOut; QAction *actionZoomOut;
QAction *actionToggleCheckerboard; QAction *actionToggleCheckerboard;
QAction *actionRotateClockwise; QAction *actionRotateClockwise;
QAction *actionRotateCounterClockwise;
QAction *actionPrevPicture; QAction *actionPrevPicture;
QAction *actionNextPicture; QAction *actionNextPicture;
QAction *actionTogglePauseAnimation;
QAction *actionAnimationNextFrame;
QAction *actionHorizontalFlip; QAction *actionHorizontalFlip;
QAction *actionFitInView; QAction *actionFitInView;
QAction *actionFitByWidth; QAction *actionFitByWidth;
QAction *actionFitLongImage;
QAction *actionCopyPixmap; QAction *actionCopyPixmap;
QAction *actionCopyFilePath; QAction *actionCopyFilePath;
QAction *actionPaste; QAction *actionPaste;

View File

@@ -6,8 +6,6 @@
#include "opacityhelper.h" #include "opacityhelper.h"
#include <functional>
#include <QToolButton> #include <QToolButton>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QDebug> #include <QDebug>

View File

@@ -0,0 +1,22 @@
// SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net>
//
// SPDX-License-Identifier: MIT
#include "fileopeneventhandler.h"
#include <QFileOpenEvent>
FileOpenEventHandler::FileOpenEventHandler(QObject *parent)
: QObject(parent)
{
}
bool FileOpenEventHandler::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent *fileOpenEvent = static_cast<QFileOpenEvent *>(event);
emit fileOpen(fileOpenEvent->url());
return true;
}
return QObject::eventFilter(obj, event);
}

View File

@@ -0,0 +1,21 @@
// SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net>
//
// SPDX-License-Identifier: MIT
#pragma once
#include <QObject>
class FileOpenEventHandler : public QObject
{
Q_OBJECT
public:
explicit FileOpenEventHandler(QObject *parent = nullptr);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
signals:
void fileOpen(const QUrl &url);
};

View File

@@ -17,14 +17,7 @@ FramelessWindow::FramelessWindow(QWidget *parent)
, m_oldCursorShape(Qt::ArrowCursor) , m_oldCursorShape(Qt::ArrowCursor)
, m_oldEdges() , m_oldEdges()
{ {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinMaxButtonsHint); this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinMaxButtonsHint);
#else
// There is a bug in Qt 5 that will make pressing Meta+Up cause the app
// fullscreen under Windows, see QTBUG-91226 to learn more.
// The bug seems no longer exists in Qt 6 (I only tested it under Qt 6.3.0).
this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
this->setMouseTracking(true); this->setMouseTracking(true);
this->setAttribute(Qt::WA_Hover, true); this->setAttribute(Qt::WA_Hover, true);
this->installEventFilter(this); this->installEventFilter(this);
@@ -97,11 +90,7 @@ bool FramelessWindow::mousePress(QMouseEvent* event)
{ {
if (event->buttons() & Qt::LeftButton && !isMaximized() && !isFullScreen()) { if (event->buttons() & Qt::LeftButton && !isMaximized() && !isFullScreen()) {
QWindow* win = window()->windowHandle(); QWindow* win = window()->windowHandle();
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
Qt::Edges edges = this->getEdgesByPos(event->globalPosition().toPoint(), win->frameGeometry()); Qt::Edges edges = this->getEdgesByPos(event->globalPosition().toPoint(), win->frameGeometry());
#else
Qt::Edges edges = this->getEdgesByPos(event->globalPos(), win->frameGeometry());
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if (edges) { if (edges) {
win->startSystemResize(edges); win->startSystemResize(edges);
return true; return true;

View File

@@ -4,6 +4,8 @@
#include "graphicsscene.h" #include "graphicsscene.h"
#include "settings.h"
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#include <QMimeData> #include <QMimeData>
#include <QDebug> #include <QDebug>
@@ -21,6 +23,9 @@ public:
: QGraphicsPixmapItem(pixmap, parent) : QGraphicsPixmapItem(pixmap, parent)
{} {}
enum { Type = UserType + 1 };
int type() const override { return Type; }
void setScaleHint(float scaleHint) { void setScaleHint(float scaleHint) {
m_scaleHint = scaleHint; m_scaleHint = scaleHint;
} }
@@ -61,6 +66,9 @@ class PGraphicsMovieItem : public QGraphicsItem
public: public:
PGraphicsMovieItem(QGraphicsItem *parent = nullptr) : QGraphicsItem(parent) {} PGraphicsMovieItem(QGraphicsItem *parent = nullptr) : QGraphicsItem(parent) {}
enum { Type = UserType + 2 };
int type() const override { return Type; }
void setMovie(QMovie* movie) { void setMovie(QMovie* movie) {
if (m_movie) m_movie->disconnect(); if (m_movie) m_movie->disconnect();
m_movie.reset(movie); m_movie.reset(movie);
@@ -80,6 +88,10 @@ public:
} }
} }
inline QMovie * movie() const {
return m_movie.data();
}
private: private:
QScopedPointer<QMovie> m_movie; QScopedPointer<QMovie> m_movie;
}; };
@@ -120,10 +132,9 @@ void GraphicsScene::showSvg(const QString &filepath)
QGraphicsSvgItem * svgItem = new QGraphicsSvgItem(); QGraphicsSvgItem * svgItem = new QGraphicsSvgItem();
QSvgRenderer * render = new QSvgRenderer(svgItem); QSvgRenderer * render = new QSvgRenderer(svgItem);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
// Qt 6.7.0's SVG support is terrible caused by huge memory usage, see QTBUG-124287 if (Settings::instance()->svgTiny12Only()) {
// Qt 6.7.1's is somewhat better, memory issue seems fixed, but still laggy when zoom in
// Anyway let's disable it for now.
render->setOptions(QtSvg::Tiny12FeaturesOnly); render->setOptions(QtSvg::Tiny12FeaturesOnly);
}
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) #endif // QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
render->load(filepath); render->load(filepath);
svgItem->setSharedRenderer(render); svgItem->setSharedRenderer(render);
@@ -158,6 +169,29 @@ bool GraphicsScene::trySetTransformationMode(Qt::TransformationMode mode, float
return false; return false;
} }
bool GraphicsScene::togglePauseAnimation()
{
PGraphicsMovieItem * animatedItem = qgraphicsitem_cast<PGraphicsMovieItem *>(m_theThing);
if (animatedItem) {
animatedItem->movie()->setPaused(animatedItem->movie()->state() != QMovie::Paused);
return true;
}
return false;
}
bool GraphicsScene::skipAnimationFrame(int delta)
{
PGraphicsMovieItem * animatedItem = qgraphicsitem_cast<PGraphicsMovieItem *>(m_theThing);
if (animatedItem) {
const int frameCount = animatedItem->movie()->frameCount();
const int currentFrame = animatedItem->movie()->currentFrameNumber();
const int targetFrame = (currentFrame + delta) % frameCount;
animatedItem->movie()->setPaused(true);
return animatedItem->movie()->jumpToFrame(targetFrame);
}
return false;
}
QPixmap GraphicsScene::renderToPixmap() QPixmap GraphicsScene::renderToPixmap()
{ {
PGraphicsPixmapItem * pixmapItem = qgraphicsitem_cast<PGraphicsPixmapItem *>(m_theThing); PGraphicsPixmapItem * pixmapItem = qgraphicsitem_cast<PGraphicsPixmapItem *>(m_theThing);

View File

@@ -21,10 +21,13 @@ public:
bool trySetTransformationMode(Qt::TransformationMode mode, float scaleHint); bool trySetTransformationMode(Qt::TransformationMode mode, float scaleHint);
bool togglePauseAnimation();
bool skipAnimationFrame(int delta = 1);
QPixmap renderToPixmap(); QPixmap renderToPixmap();
private: private:
QGraphicsItem * m_theThing; QGraphicsItem * m_theThing = nullptr;
}; };
#endif // GRAPHICSSCENE_H #endif // GRAPHICSSCENE_H

View File

@@ -1,12 +1,14 @@
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com> // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "graphicsview.h" #include "graphicsview.h"
#include "graphicsscene.h" #include "graphicsscene.h"
#include "settings.h"
#include <QDebug> #include <QDebug>
#include <QColorSpace>
#include <QMouseEvent> #include <QMouseEvent>
#include <QScrollBar> #include <QScrollBar>
#include <QMimeData> #include <QMimeData>
@@ -23,14 +25,14 @@ GraphicsView::GraphicsView(QWidget *parent)
setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setStyleSheet("background-color: rgba(0, 0, 0, 220);" setStyleSheet("background-color: rgba(0, 0, 0, 220);"
"border-radius: 3px;"); "border-radius: 3px;");
setAcceptDrops(true); setAcceptDrops(false);
setCheckerboardEnabled(false); setCheckerboardEnabled(false);
connect(horizontalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged); connect(horizontalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged);
connect(verticalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged); connect(verticalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged);
} }
void GraphicsView::showFileFromPath(const QString &filePath, bool doRequestGallery) void GraphicsView::showFileFromPath(const QString &filePath)
{ {
emit navigatorViewRequired(false, transform()); emit navigatorViewRequired(false, transform());
@@ -40,36 +42,40 @@ void GraphicsView::showFileFromPath(const QString &filePath, bool doRequestGalle
QImageReader imageReader(filePath); QImageReader imageReader(filePath);
imageReader.setAutoTransform(true); imageReader.setAutoTransform(true);
imageReader.setDecideFormatFromContent(true); imageReader.setDecideFormatFromContent(true);
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
imageReader.setAllocationLimit(0); imageReader.setAllocationLimit(0);
#endif //QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
// Since if the image format / plugin does not support this feature, imageFormat() will returns an invalid format. // Since if the image format / plugin does not support this feature, imageFormat() will returns an invalid format.
// So we cannot use imageFormat() and check if it returns QImage::Format_Invalid to detect if we support the file. // So we cannot use imageFormat() and check if it returns QImage::Format_Invalid to detect if we support the file.
// QImage::Format imageFormat = imageReader.imageFormat(); // QImage::Format imageFormat = imageReader.imageFormat();
if (imageReader.format().isEmpty()) { if (imageReader.format().isEmpty()) {
doRequestGallery = false;
showText(tr("File is not a valid image")); showText(tr("File is not a valid image"));
} else if (imageReader.supportsAnimation() && imageReader.imageCount() > 1) { } else if (imageReader.supportsAnimation() && imageReader.imageCount() > 1) {
showAnimated(filePath); showAnimated(filePath);
} else if (!imageReader.canRead()) { } else if (!imageReader.canRead()) {
doRequestGallery = false;
showText(tr("Image data is invalid or currently unsupported")); showText(tr("Image data is invalid or currently unsupported"));
} else { } else {
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
QImage && img = imageReader.read();
if (img.isNull()) {
showText(tr("Image data is invalid or currently unsupported"));
} else {
if (img.format() == QImage::Format_CMYK8888) {
img.convertToColorSpace(QColorSpace::SRgb);
}
img.setDevicePixelRatio(devicePixelRatioF());
showImage(img);
}
#else
QPixmap && pixmap = QPixmap::fromImageReader(&imageReader); QPixmap && pixmap = QPixmap::fromImageReader(&imageReader);
if (pixmap.isNull()) { if (pixmap.isNull()) {
doRequestGallery = false;
showText(tr("Image data is invalid or currently unsupported")); showText(tr("Image data is invalid or currently unsupported"));
} else { } else {
pixmap.setDevicePixelRatio(devicePixelRatioF()); pixmap.setDevicePixelRatio(devicePixelRatioF());
showImage(pixmap); showImage(pixmap);
} }
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
} }
} }
if (doRequestGallery) {
emit requestGallery(filePath);
}
} }
void GraphicsView::showImage(const QPixmap &pixmap) void GraphicsView::showImage(const QPixmap &pixmap)
@@ -124,7 +130,7 @@ qreal GraphicsView::scaleFactor() const
void GraphicsView::resetTransform() void GraphicsView::resetTransform()
{ {
if (!m_avoidResetTransform) { if (!shouldAvoidTransform()) {
QGraphicsView::resetTransform(); QGraphicsView::resetTransform();
} }
} }
@@ -132,6 +138,7 @@ void GraphicsView::resetTransform()
void GraphicsView::zoomView(qreal scaleFactor) void GraphicsView::zoomView(qreal scaleFactor)
{ {
m_enableFitInView = false; m_enableFitInView = false;
m_longImageMode = false;
scale(scaleFactor, scaleFactor); scale(scaleFactor, scaleFactor);
applyTransformationModeByScaleFactor(); applyTransformationModeByScaleFactor();
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform()); emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
@@ -148,6 +155,10 @@ void GraphicsView::rotateView(bool clockwise)
0, 0, 1); 0, 0, 1);
tf = transform() * tf; tf = transform() * tf;
setTransform(tf); setTransform(tf);
// Apply transformation mode but don't emit navigator signal here
// Let displayScene() handle the navigator visibility correctly
applyTransformationModeByScaleFactor();
} }
void GraphicsView::flipView(bool horizontal) void GraphicsView::flipView(bool horizontal)
@@ -179,39 +190,149 @@ void GraphicsView::fitByOrientation(Qt::Orientation ori, bool scaleDownOnly)
{ {
resetScale(); resetScale();
QRectF viewRect = this->viewport()->rect().adjusted(2, 2, -2, -2); QRectF viewRect = this->viewport()->rect();
QRectF imageRect = transform().mapRect(sceneRect()); QRectF imageRect = transform().mapRect(sceneRect());
QSize viewSize = viewRect.size().toSize();
qreal ratio; qreal ratio;
if (ori == Qt::Horizontal) { if (ori == Qt::Horizontal) {
// Horizontal fit means fit by width
if (scaleDownOnly && imageRect.width() <= viewSize.width()) {
// Image width already fits, no scaling needed
ratio = 1;
} else {
ratio = viewRect.width() / imageRect.width(); ratio = viewRect.width() / imageRect.width();
}
} else {
// Vertical fit means fit by height
if (scaleDownOnly && imageRect.height() <= viewSize.height()) {
// Image height already fits, no scaling needed
ratio = 1;
} else { } else {
ratio = viewRect.height() / imageRect.height(); ratio = viewRect.height() / imageRect.height();
} }
}
if (scaleDownOnly && ratio > 1) ratio = 1; if (ratio != 1) {
scale(ratio, ratio); scale(ratio, ratio);
centerOn(imageRect.top(), 0); }
// Position the image correctly based on orientation with rotation consideration
QRectF originalScene = sceneRect();
QTransform currentTransform = transform();
if (ori == Qt::Horizontal) {
// For horizontal fit (fit by width), position at top (for tall images)
// Find the scene point that corresponds to the top-center of the transformed image
QPointF sceneTopCenter;
if (qFuzzyIsNull(currentTransform.m12()) && qFuzzyIsNull(currentTransform.m21())) {
// 0° or 180° rotation
if (currentTransform.m11() > 0 && currentTransform.m22() > 0) {
// 0° rotation: use original top-center
sceneTopCenter = QPointF(originalScene.center().x(), originalScene.top());
} else {
// 180° rotation: the visual "top" is now at the scene bottom
sceneTopCenter = QPointF(originalScene.center().x(), originalScene.bottom());
}
} else {
// 90/270 degree rotation: the "top" in view corresponds to left/right in scene
if (currentTransform.m12() > 0) {
// 90 degree: top in view = left in scene
sceneTopCenter = QPointF(originalScene.left(), originalScene.center().y());
} else {
// 270 degree: top in view = right in scene
sceneTopCenter = QPointF(originalScene.right(), originalScene.center().y());
}
}
centerOn(sceneTopCenter);
} else {
// For vertical fit (fit by height), position at left (for wide images)
// Find the scene point that corresponds to the left-center of the transformed image
QPointF sceneLeftCenter;
if (qFuzzyIsNull(currentTransform.m12()) && qFuzzyIsNull(currentTransform.m21())) {
// 0° or 180° rotation
if (currentTransform.m11() > 0 && currentTransform.m22() > 0) {
// 0° rotation: use original left-center
sceneLeftCenter = QPointF(originalScene.left(), originalScene.center().y());
} else {
// 180° rotation: the visual "left" is now at the scene right
sceneLeftCenter = QPointF(originalScene.right(), originalScene.center().y());
}
} else {
// 90/270 degree rotation: the "left" in view corresponds to top/bottom in scene
if (currentTransform.m21() > 0) {
// 90 degree: left in view = top in scene
sceneLeftCenter = QPointF(originalScene.center().x(), originalScene.top());
} else {
// 270 degree: left in view = bottom in scene
sceneLeftCenter = QPointF(originalScene.center().x(), originalScene.bottom());
}
}
centerOn(sceneLeftCenter);
}
m_enableFitInView = false; m_enableFitInView = false;
applyTransformationModeByScaleFactor(); applyTransformationModeByScaleFactor();
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform()); emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
} }
bool GraphicsView::isLongImage() const
{
// Get the transformed image size (considering rotation and other transforms)
QRectF transformedRect = transform().mapRect(sceneRect());
QSizeF imageSize = transformedRect.size();
if (imageSize.isEmpty()) return false;
qreal aspectRatio = imageSize.width() / imageSize.height();
// Check if aspect ratio exceeds 5:2 (wide) or 2:5 (tall)
return aspectRatio > 2.5 || aspectRatio < 0.4;
}
void GraphicsView::fitLongImage()
{
QRectF transformedRect = transform().mapRect(sceneRect());
if (transformedRect.width() < transformedRect.height()) {
fitByOrientation(Qt::Horizontal, true);
} else {
fitByOrientation(Qt::Vertical, true);
}
}
void GraphicsView::displayScene() void GraphicsView::displayScene()
{ {
if (m_avoidResetTransform) { if (shouldAvoidTransform()) {
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform()); emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
return; return;
} }
if (isSceneBiggerThanView()) { // Check if should apply long image mode
fitInView(sceneRect(), Qt::KeepAspectRatio); if (Settings::instance()->autoLongImageMode() && isLongImage()) {
m_longImageMode = true;
m_firstUserMediaLoaded = true;
if (isSceneBiggerThanView()) fitLongImage();
return;
} }
if (isSceneBiggerThanView()) {
// Do fit-in-view
fitInView(sceneRect(), Qt::KeepAspectRatio);
// After fitInView, the image should fit the window, so hide navigator
emit navigatorViewRequired(false, transform());
} else {
// Image is already smaller than window, no navigator needed
emit navigatorViewRequired(false, transform());
}
m_longImageMode = false;
m_enableFitInView = true; m_enableFitInView = true;
m_firstUserMediaLoaded = true;
} }
bool GraphicsView::isSceneBiggerThanView() const bool GraphicsView::isSceneBiggerThanView() const
@@ -229,6 +350,11 @@ void GraphicsView::setEnableAutoFitInView(bool enable)
m_enableFitInView = enable; m_enableFitInView = enable;
} }
void GraphicsView::setLongImageMode(bool enable)
{
m_longImageMode = enable;
}
bool GraphicsView::avoidResetTransform() const bool GraphicsView::avoidResetTransform() const
{ {
return m_avoidResetTransform; return m_avoidResetTransform;
@@ -301,7 +427,12 @@ void GraphicsView::wheelEvent(QWheelEvent *event)
void GraphicsView::resizeEvent(QResizeEvent *event) void GraphicsView::resizeEvent(QResizeEvent *event)
{ {
if (m_enableFitInView) { if (m_longImageMode) {
// In long image mode, reapply long image logic on resize
// We directly apply the long image mode logic without rechecking
// if we should enter long image mode, as the mode is already active
fitLongImage();
} else if (m_enableFitInView) {
bool originalSizeSmallerThanWindow = isThingSmallerThanWindowWith(resetScale(transform())); bool originalSizeSmallerThanWindow = isThingSmallerThanWindowWith(resetScale(transform()));
if (originalSizeSmallerThanWindow && scaleFactor() >= 1) { if (originalSizeSmallerThanWindow && scaleFactor() >= 1) {
// no longer need to do fitInView() // no longer need to do fitInView()
@@ -318,55 +449,6 @@ void GraphicsView::resizeEvent(QResizeEvent *event)
return QGraphicsView::resizeEvent(event); return QGraphicsView::resizeEvent(event);
} }
void GraphicsView::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasUrls() || event->mimeData()->hasImage() || event->mimeData()->hasText()) {
event->acceptProposedAction();
} else {
event->ignore();
}
// qDebug() << event->mimeData() << "Drag Enter Event"
// << event->mimeData()->hasUrls() << event->mimeData()->hasImage()
// << event->mimeData()->formats() << event->mimeData()->hasFormat("text/uri-list");
return QGraphicsView::dragEnterEvent(event);
}
void GraphicsView::dragMoveEvent(QDragMoveEvent *event)
{
Q_UNUSED(event)
// by default, QGraphicsView/Scene will ignore the action if there are no QGraphicsItem under cursor.
// We actually doesn't care and would like to keep the drag event as-is, so just do nothing here.
}
void GraphicsView::dropEvent(QDropEvent *event)
{
event->acceptProposedAction();
const QMimeData * mimeData = event->mimeData();
if (mimeData->hasUrls()) {
const QList<QUrl> &urls = mimeData->urls();
if (urls.isEmpty()) {
showText(tr("File url list is empty"));
} else {
showFileFromPath(urls.first().toLocalFile(), true);
}
} else if (mimeData->hasImage()) {
QImage img = qvariant_cast<QImage>(mimeData->imageData());
QPixmap pixmap = QPixmap::fromImage(img);
if (pixmap.isNull()) {
showText(tr("Image data is invalid"));
} else {
showImage(pixmap);
}
} else if (mimeData->hasText()) {
showText(mimeData->text());
} else {
showText(tr("Not supported mimedata: %1").arg(mimeData->formats().first()));
}
}
bool GraphicsView::isThingSmallerThanWindowWith(const QTransform &transform) const bool GraphicsView::isThingSmallerThanWindowWith(const QTransform &transform) const
{ {
return rect().size().expandedTo(transform.mapRect(sceneRect()).size().toSize()) return rect().size().expandedTo(transform.mapRect(sceneRect()).size().toSize())
@@ -394,16 +476,16 @@ bool GraphicsView::shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) con
void GraphicsView::setCheckerboardEnabled(bool enabled, bool invertColor) void GraphicsView::setCheckerboardEnabled(bool enabled, bool invertColor)
{ {
m_checkerboardEnabled = enabled; m_checkerboardEnabled = enabled;
m_isLastCheckerboardColorInverted = invertColor; bool isLightCheckerboard = Settings::instance()->useLightCheckerboard() ^ invertColor;
if (m_checkerboardEnabled) { if (m_checkerboardEnabled) {
// Prepare background check-board pattern // Prepare background check-board pattern
QPixmap tilePixmap(0x20, 0x20); QPixmap tilePixmap(0x20, 0x20);
tilePixmap.fill(invertColor ? QColor(220, 220, 220, 170) : QColor(35, 35, 35, 170)); tilePixmap.fill(isLightCheckerboard ? QColor(220, 220, 220, 170) : QColor(35, 35, 35, 170));
QPainter tilePainter(&tilePixmap); QPainter tilePainter(&tilePixmap);
constexpr QColor color(45, 45, 45, 170); constexpr QColor color(45, 45, 45, 170);
constexpr QColor invertedColor(210, 210, 210, 170); constexpr QColor invertedColor(210, 210, 210, 170);
tilePainter.fillRect(0, 0, 0x10, 0x10, invertColor ? invertedColor : color); tilePainter.fillRect(0, 0, 0x10, 0x10, isLightCheckerboard ? invertedColor : color);
tilePainter.fillRect(0x10, 0x10, 0x10, 0x10, invertColor ? invertedColor : color); tilePainter.fillRect(0x10, 0x10, 0x10, 0x10, isLightCheckerboard ? invertedColor : color);
tilePainter.end(); tilePainter.end();
setBackgroundBrush(tilePixmap); setBackgroundBrush(tilePixmap);
@@ -420,3 +502,8 @@ void GraphicsView::applyTransformationModeByScaleFactor()
scene()->trySetTransformationMode(Qt::FastTransformation, this->scaleFactor()); scene()->trySetTransformationMode(Qt::FastTransformation, this->scaleFactor());
} }
} }
bool GraphicsView::shouldAvoidTransform() const
{
return m_firstUserMediaLoaded && m_avoidResetTransform;
}

View File

@@ -15,7 +15,7 @@ class GraphicsView : public QGraphicsView
public: public:
GraphicsView(QWidget *parent = nullptr); GraphicsView(QWidget *parent = nullptr);
void showFileFromPath(const QString &filePath, bool requestGallery = false); void showFileFromPath(const QString &filePath);
void showImage(const QPixmap &pixmap); void showImage(const QPixmap &pixmap);
void showImage(const QImage &image); void showImage(const QImage &image);
@@ -39,16 +39,20 @@ public:
void displayScene(); void displayScene();
bool isSceneBiggerThanView() const; bool isSceneBiggerThanView() const;
void setEnableAutoFitInView(bool enable = true); void setEnableAutoFitInView(bool enable = true);
void setLongImageMode(bool enable = true);
bool avoidResetTransform() const; bool avoidResetTransform() const;
void setAvoidResetTransform(bool avoidReset); void setAvoidResetTransform(bool avoidReset);
static QTransform resetScale(const QTransform & orig); static QTransform resetScale(const QTransform & orig);
// Long image mode support
bool isLongImage() const;
void fitLongImage();
signals: signals:
void navigatorViewRequired(bool required, QTransform transform); void navigatorViewRequired(bool required, QTransform transform);
void viewportRectChanged(); void viewportRectChanged();
void requestGallery(const QString &filePath);
public slots: public slots:
void toggleCheckerboard(bool invertCheckerboardColor = false); void toggleCheckerboard(bool invertCheckerboardColor = false);
@@ -60,22 +64,22 @@ private:
void wheelEvent(QWheelEvent *event) override; void wheelEvent(QWheelEvent *event) override;
void resizeEvent(QResizeEvent *event) override; void resizeEvent(QResizeEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dropEvent(QDropEvent *event) override;
bool isThingSmallerThanWindowWith(const QTransform &transform) const; bool isThingSmallerThanWindowWith(const QTransform &transform) const;
bool shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) const; bool shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) const;
void setCheckerboardEnabled(bool enabled, bool invertColor = false); void setCheckerboardEnabled(bool enabled, bool invertColor = false);
void applyTransformationModeByScaleFactor(); void applyTransformationModeByScaleFactor();
inline bool shouldAvoidTransform() const;
// Consider switch to 3 state for "no fit", "always fit" and "fit when view is smaller"? // Consider switch to 3 state for "no fit", "always fit" and "fit when view is smaller"?
// ... or even more? e.g. "fit/snap width" things... // ... or even more? e.g. "fit/snap width" things...
// Currently it's "no fit" when it's false and "fit when view is smaller" when it's true. // Currently it's "no fit" when it's false and "fit when view is smaller" when it's true.
bool m_enableFitInView = false; bool m_enableFitInView = false;
bool m_longImageMode = false;
bool m_avoidResetTransform = false; bool m_avoidResetTransform = false;
bool m_checkerboardEnabled = false; bool m_checkerboardEnabled = false;
bool m_isLastCheckerboardColorInverted = false; bool m_useLightCheckerboard = false;
bool m_firstUserMediaLoaded = false;
}; };
#endif // GRAPHICSVIEW_H #endif // GRAPHICSVIEW_H

View File

@@ -7,49 +7,89 @@
#include "playlistmanager.h" #include "playlistmanager.h"
#include "settings.h" #include "settings.h"
#ifdef Q_OS_MACOS
#include "fileopeneventhandler.h"
#endif // Q_OS_MACOS
#include <QApplication> #include <QApplication>
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QDir> #include <QDir>
#include <QTranslator> #include <QTranslator>
#include <QUrl> #include <QUrl>
// QM_FILE_INSTALL_DIR should be defined from the CMakeLists file. using namespace Qt::Literals::StringLiterals;
#ifndef QM_FILE_INSTALL_DIR
#define QM_FILE_INSTALL_DIR ":/i18n/"
#endif // QM_FILE_INSTALL_DIR
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QCoreApplication::setApplicationName(u"Pineapple Pictures"_s);
QCoreApplication::setApplicationVersion(PPIC_VERSION_STRING);
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Settings::instance()->hiDpiScaleFactorBehavior()); QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Settings::instance()->hiDpiScaleFactorBehavior());
QApplication a(argc, argv); QApplication a(argc, argv);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
a.setAttribute(Qt::ApplicationAttribute::AA_UseHighDpiPixmaps);
#endif
QTranslator translator; QTranslator translator;
QString qmDir; #if defined(TRANSLATION_RESOURCE_EMBEDDING)
#ifdef _WIN32 const QString qmDir = u":/i18n/"_s;
qmDir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("translations"); #elif defined(QM_FILE_INSTALL_ABSOLUTE_DIR)
const QString qmDir = QT_STRINGIFY(QM_FILE_INSTALL_ABSOLUTE_DIR);
#else #else
qmDir = QT_STRINGIFY(QM_FILE_INSTALL_DIR); const QString qmDir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("translations");
#endif #endif
if (translator.load(QLocale(), QLatin1String("PineapplePictures"), QLatin1String("_"), qmDir)) { if (translator.load(QLocale(), u"PineapplePictures"_s, u"_"_s, qmDir)) {
a.installTranslator(&translator); QCoreApplication::installTranslator(&translator);
} }
a.setApplicationName("Pineapple Pictures");
a.setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
QGuiApplication::setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
// commandline options
QCommandLineOption supportedImageFormats(u"supported-image-formats"_s, QCoreApplication::translate("main", "List supported image format suffixes, and quit program."));
// parse commandline arguments // parse commandline arguments
QCommandLineParser parser; QCommandLineParser parser;
parser.addOption(supportedImageFormats);
parser.addPositionalArgument("File list", QCoreApplication::translate("main", "File list.")); parser.addPositionalArgument("File list", QCoreApplication::translate("main", "File list."));
parser.addHelpOption(); parser.addHelpOption();
parser.process(a); parser.process(a);
if (parser.isSet(supportedImageFormats)) {
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
fputs(qPrintable(MainWindow::supportedImageFormats().join(QChar('\n'))), stdout);
::exit(EXIT_SUCCESS);
#else
QCommandLineParser::showMessageAndExit(QCommandLineParser::MessageType::Information,
MainWindow::supportedImageFormats().join(QChar('\n')));
#endif
}
MainWindow w; MainWindow w;
w.show(); w.show();
#ifdef Q_OS_MACOS
FileOpenEventHandler * fileOpenEventHandler = new FileOpenEventHandler(&a);
a.installEventFilter(fileOpenEventHandler);
a.connect(fileOpenEventHandler, &FileOpenEventHandler::fileOpen, [&w](const QUrl & url){
if (w.isHidden()) {
w.setWindowOpacity(1);
w.showNormal();
} else {
w.activateWindow();
}
w.showUrls({url});
w.initWindowSize();
});
// Handle dock icon clicks to show hidden window
a.connect(&a, &QApplication::applicationStateChanged, [&w](Qt::ApplicationState state) {
if (state == Qt::ApplicationActive && w.isHidden()) {
w.showUrls({});
w.galleryCurrent(true, true);
w.setWindowOpacity(1);
w.showNormal();
w.raise();
w.activateWindow();
}
});
#endif // Q_OS_MACOS
QStringList urlStrList = parser.positionalArguments(); QStringList urlStrList = parser.positionalArguments();
QList<QUrl> && urlList = PlaylistManager::convertToUrlList(urlStrList); QList<QUrl> && urlList = PlaylistManager::convertToUrlList(urlStrList);
@@ -59,5 +99,5 @@ int main(int argc, char *argv[])
w.initWindowSize(); w.initWindowSize();
return a.exec(); return QApplication::exec();
} }

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com> // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -32,7 +32,9 @@
#include <QFile> #include <QFile>
#include <QTimer> #include <QTimer>
#include <QFileDialog> #include <QFileDialog>
#include <QFileSystemWatcher>
#include <QStandardPaths> #include <QStandardPaths>
#include <QStringBuilder>
#include <QProcess> #include <QProcess>
#include <QDesktopServices> #include <QDesktopServices>
#include <QMessageBox> #include <QMessageBox>
@@ -42,10 +44,13 @@
#include <QDBusConnectionInterface> #include <QDBusConnectionInterface>
#endif // HAVE_QTDBUS #endif // HAVE_QTDBUS
using namespace Qt::Literals::StringLiterals;
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: FramelessWindow(parent) : FramelessWindow(parent)
, m_am(new ActionManager) , m_am(new ActionManager)
, m_pm(new PlaylistManager(PlaylistManager::PL_SAMEFOLDER, this)) , m_pm(new PlaylistManager(this))
, m_fileSystemWatcher(new QFileSystemWatcher(this))
{ {
if (Settings::instance()->stayOnTop()) { if (Settings::instance()->stayOnTop()) {
this->setWindowFlag(Qt::WindowStaysOnTopHint); this->setWindowFlag(Qt::WindowStaysOnTopHint);
@@ -53,27 +58,24 @@ MainWindow::MainWindow(QWidget *parent)
this->setAttribute(Qt::WA_TranslucentBackground, true); this->setAttribute(Qt::WA_TranslucentBackground, true);
this->setMinimumSize(350, 330); this->setMinimumSize(350, 330);
this->setWindowIcon(QIcon(":/icons/app-icon.svg")); this->setWindowIcon(QIcon(u":/icons/app-icon.svg"_s));
this->setMouseTracking(true); this->setMouseTracking(true);
this->setAcceptDrops(true);
m_pm->setAutoLoadFilterSuffix({ m_pm->setAutoLoadFilterSuffixes(supportedImageFormats());
"*.jpg", "*.jpeg", "*.jfif",
"*.png", "*.gif", "*.svg", "*.bmp", "*.webp",
"*.tif", "*.tiff"
});
m_fadeOutAnimation = new QPropertyAnimation(this, "windowOpacity"); m_fadeOutAnimation = new QPropertyAnimation(this, "windowOpacity"_ba);
m_fadeOutAnimation->setDuration(300); m_fadeOutAnimation->setDuration(300);
m_fadeOutAnimation->setStartValue(1); m_fadeOutAnimation->setStartValue(1);
m_fadeOutAnimation->setEndValue(0); m_fadeOutAnimation->setEndValue(0);
m_floatUpAnimation = new QPropertyAnimation(this, "geometry"); m_floatUpAnimation = new QPropertyAnimation(this, "geometry"_ba);
m_floatUpAnimation->setDuration(300); m_floatUpAnimation->setDuration(300);
m_floatUpAnimation->setEasingCurve(QEasingCurve::OutCirc); m_floatUpAnimation->setEasingCurve(QEasingCurve::OutCirc);
m_exitAnimationGroup = new QParallelAnimationGroup(this); m_exitAnimationGroup = new QParallelAnimationGroup(this);
m_exitAnimationGroup->addAnimation(m_fadeOutAnimation); m_exitAnimationGroup->addAnimation(m_fadeOutAnimation);
m_exitAnimationGroup->addAnimation(m_floatUpAnimation); m_exitAnimationGroup->addAnimation(m_floatUpAnimation);
connect(m_exitAnimationGroup, &QParallelAnimationGroup::finished, connect(m_exitAnimationGroup, &QParallelAnimationGroup::finished,
this, &QWidget::close); this, &MainWindow::doCloseWindow);
GraphicsScene * scene = new GraphicsScene(this); GraphicsScene * scene = new GraphicsScene(this);
@@ -88,7 +90,7 @@ MainWindow::MainWindow(QWidget *parent)
m_gv->fitInView(m_gv->sceneRect(), Qt::KeepAspectRatio); m_gv->fitInView(m_gv->sceneRect(), Qt::KeepAspectRatio);
connect(m_graphicsView, &GraphicsView::navigatorViewRequired, connect(m_graphicsView, &GraphicsView::navigatorViewRequired,
this, [ = ](bool required, const QTransform & tf){ this, [this](bool required, const QTransform & tf){
m_gv->setTransform(GraphicsView::resetScale(tf)); m_gv->setTransform(GraphicsView::resetScale(tf));
m_gv->fitInView(m_gv->sceneRect(), Qt::KeepAspectRatio); m_gv->fitInView(m_gv->sceneRect(), Qt::KeepAspectRatio);
m_gv->setVisible(required); m_gv->setVisible(required);
@@ -98,9 +100,6 @@ MainWindow::MainWindow(QWidget *parent)
connect(m_graphicsView, &GraphicsView::viewportRectChanged, connect(m_graphicsView, &GraphicsView::viewportRectChanged,
m_gv, &NavigatorView::updateMainViewportRegion); m_gv, &NavigatorView::updateMainViewportRegion);
connect(m_graphicsView, &GraphicsView::requestGallery,
this, &MainWindow::loadGalleryBySingleLocalFile);
m_closeButton = new ToolButton(true, m_graphicsView); m_closeButton = new ToolButton(true, m_graphicsView);
m_closeButton->setIconSize(QSize(32, 32)); m_closeButton->setIconSize(QSize(32, 32));
m_closeButton->setFixedSize(QSize(50, 50)); m_closeButton->setFixedSize(QSize(50, 50));
@@ -140,18 +139,13 @@ MainWindow::MainWindow(QWidget *parent)
m_gv->setOpacity(0, false); m_gv->setOpacity(0, false);
m_closeButton->setOpacity(0, false); m_closeButton->setOpacity(0, false);
connect(m_pm, &PlaylistManager::loaded, this, [this](int galleryFileCount) { connect(m_pm, &PlaylistManager::totalCountChanged, this, &MainWindow::updateGalleryButtonsVisibility);
m_prevButton->setVisible(galleryFileCount > 1);
m_nextButton->setVisible(galleryFileCount > 1);
});
connect(m_pm, &PlaylistManager::currentIndexChanged, this, [this]() { connect(m_pm->model(), &PlaylistModel::modelReset, this, std::bind(&MainWindow::galleryCurrent, this, false, false));
int index; connect(m_pm, &PlaylistManager::currentIndexChanged, this, std::bind(&MainWindow::galleryCurrent, this, true, false));
QUrl url;
std::tie(index, url) = m_pm->currentFileUrl(); connect(m_fileSystemWatcher, &QFileSystemWatcher::fileChanged, this, [this](){
if (index != -1) { QTimer::singleShot(500, this, std::bind(&MainWindow::galleryCurrent, this, false, true));
this->setWindowTitle(url.fileName());
}
}); });
QShortcut * fullscreenShorucut = new QShortcut(QKeySequence(QKeySequence::FullScreen), this); QShortcut * fullscreenShorucut = new QShortcut(QKeySequence(QKeySequence::FullScreen), this);
@@ -162,6 +156,7 @@ MainWindow::MainWindow(QWidget *parent)
QTimer::singleShot(0, this, [this](){ QTimer::singleShot(0, this, [this](){
m_am->setupShortcuts(); m_am->setupShortcuts();
Settings::instance()->applyUserShortcuts(this);
}); });
// allow some mouse events can go through these widgets for resizing window. // allow some mouse events can go through these widgets for resizing window.
@@ -180,15 +175,20 @@ MainWindow::~MainWindow()
void MainWindow::showUrls(const QList<QUrl> &urls) void MainWindow::showUrls(const QList<QUrl> &urls)
{ {
if (!urls.isEmpty()) { if (!urls.isEmpty()) {
const QUrl & firstUrl = urls.first();
if (urls.count() == 1) { if (urls.count() == 1) {
m_graphicsView->showFileFromPath(urls.first().toLocalFile(), true); const QString lowerCaseUrlPath(firstUrl.path().toLower());
} else { if (lowerCaseUrlPath.endsWith(".m3u8") || lowerCaseUrlPath.endsWith(".m3u")) {
m_graphicsView->showFileFromPath(urls.first().toLocalFile(), false); m_pm->loadM3U8Playlist(firstUrl);
m_pm->setPlaylist(urls); galleryCurrent(true, true);
m_pm->setCurrentIndex(0); return;
} }
}
m_graphicsView->showFileFromPath(firstUrl.toLocalFile());
m_pm->loadPlaylist(urls);
} else { } else {
m_graphicsView->showText(tr("File url list is empty")); m_graphicsView->showText(tr("File url list is empty"));
m_pm->setPlaylist(urls);
return; return;
} }
@@ -204,6 +204,9 @@ void MainWindow::initWindowSize()
case Settings::WindowSizeBehavior::Maximized: case Settings::WindowSizeBehavior::Maximized:
showMaximized(); showMaximized();
break; break;
case Settings::WindowSizeBehavior::Windowed:
showNormal();
break;
default: default:
adjustWindowSizeBySceneRect(); adjustWindowSizeBySceneRect();
break; break;
@@ -212,7 +215,7 @@ void MainWindow::initWindowSize()
void MainWindow::adjustWindowSizeBySceneRect() void MainWindow::adjustWindowSizeBySceneRect()
{ {
if (m_pm->count() < 1) return; if (m_pm->totalCount() < 1) return;
QSize sceneSize = m_graphicsView->sceneRect().toRect().size(); QSize sceneSize = m_graphicsView->sceneRect().toRect().size();
QSize sceneSizeWithMargins = sceneSize + QSize(130, 125); QSize sceneSizeWithMargins = sceneSize + QSize(130, 125);
@@ -243,58 +246,68 @@ void MainWindow::adjustWindowSizeBySceneRect()
// can be empty if it is NOT from a local file. // can be empty if it is NOT from a local file.
QUrl MainWindow::currentImageFileUrl() const QUrl MainWindow::currentImageFileUrl() const
{ {
QUrl url; return m_pm->urlByIndex(m_pm->curIndex());
std::tie(std::ignore, url) = m_pm->currentFileUrl();
return url;
} }
void MainWindow::clearGallery() void MainWindow::clearGallery()
{ {
m_pm->clear(); m_pm->setPlaylist({});
}
void MainWindow::loadGalleryBySingleLocalFile(const QString &path)
{
m_pm->setCurrentFile(path);
} }
void MainWindow::galleryPrev() void MainWindow::galleryPrev()
{ {
int index; const bool loopGallery = Settings::instance()->loopGallery();
QString filePath; if (!loopGallery && m_pm->isFirstIndex()) return;
std::tie(index, filePath) = m_pm->previousFile();
if (index >= 0) { QModelIndex index = m_pm->previousIndex();
m_graphicsView->showFileFromPath(filePath, false); if (index.isValid()) {
m_pm->setCurrentIndex(index); m_pm->setCurrentIndex(index);
m_graphicsView->showFileFromPath(m_pm->localFileByIndex(index));
} }
} }
void MainWindow::galleryNext() void MainWindow::galleryNext()
{ {
int index; const bool loopGallery = Settings::instance()->loopGallery();
QString filePath; if (!loopGallery && m_pm->isLastIndex()) return;
std::tie(index, filePath) = m_pm->nextFile();
if (index >= 0) { QModelIndex index = m_pm->nextIndex();
m_graphicsView->showFileFromPath(filePath, false); if (index.isValid()) {
m_pm->setCurrentIndex(index); m_pm->setCurrentIndex(index);
m_graphicsView->showFileFromPath(m_pm->localFileByIndex(index));
} }
} }
// If playlist (or its index) get changed, use this method to "reload" the current file. // Only use this to update minor information.
void MainWindow::galleryCurrent() void MainWindow::galleryCurrent(bool showLoadImageHintWhenEmpty, bool reloadImage)
{ {
int index; QModelIndex index = m_pm->curIndex();
QString filePath; bool shouldResetfileWatcher = true;
std::tie(index, filePath) = m_pm->currentFile(); if (index.isValid()) {
const QString & localFilePath(m_pm->localFileByIndex(index));
if (index >= 0) { if (reloadImage) m_graphicsView->showFileFromPath(localFilePath);
m_graphicsView->showFileFromPath(filePath, false); shouldResetfileWatcher = !updateFileWatcher(localFilePath);
} else { setWindowTitle(m_pm->urlByIndex(index).fileName());
} else if (showLoadImageHintWhenEmpty && m_pm->totalCount() <= 0) {
m_graphicsView->showText(QCoreApplication::translate("GraphicsScene", "Drag image here")); m_graphicsView->showText(QCoreApplication::translate("GraphicsScene", "Drag image here"));
} }
updateGalleryButtonsVisibility();
if (shouldResetfileWatcher) updateFileWatcher();
}
QStringList MainWindow::supportedImageFormats()
{
QStringList formatFilters {
#if QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
QStringLiteral("*.jfif")
#endif // QT_VERSION < QT_VERSION_CHECK(6, 8, 0)
};
for (const QByteArray &item : QImageReader::supportedImageFormats()) {
formatFilters.append(QStringLiteral("*.") % QString::fromLocal8Bit(item));
}
return formatFilters;
} }
void MainWindow::showEvent(QShowEvent *event) void MainWindow::showEvent(QShowEvent *event)
@@ -304,7 +317,7 @@ void MainWindow::showEvent(QShowEvent *event)
return FramelessWindow::showEvent(event); return FramelessWindow::showEvent(event);
} }
void MainWindow::enterEvent(QT_ENTER_EVENT *event) void MainWindow::enterEvent(QEnterEvent *event)
{ {
m_bottomButtonGroup->setOpacity(1); m_bottomButtonGroup->setOpacity(1);
m_gv->setOpacity(1); m_gv->setOpacity(1);
@@ -345,11 +358,7 @@ void MainWindow::mouseMoveEvent(QMouseEvent *event)
{ {
if (event->buttons() & Qt::LeftButton && m_clickedOnWindow && !isMaximized() && !isFullScreen()) { if (event->buttons() & Qt::LeftButton && m_clickedOnWindow && !isMaximized() && !isFullScreen()) {
if (!window()->windowHandle()->startSystemMove()) { if (!window()->windowHandle()->startSystemMove()) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
move(event->globalPosition().toPoint() - m_oldMousePos); move(event->globalPosition().toPoint() - m_oldMousePos);
#else
move(event->globalPos() - m_oldMousePos);
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
} }
event->accept(); event->accept();
} }
@@ -390,6 +399,10 @@ void MainWindow::mouseDoubleClickEvent(QMouseEvent *event)
toggleMaximize(); toggleMaximize();
event->accept(); event->accept();
break; break;
case Settings::DoubleClickBehavior::FullScreen:
toggleFullscreen();
event->accept();
break;
case Settings::DoubleClickBehavior::Ignore: case Settings::DoubleClickBehavior::Ignore:
break; break;
} }
@@ -447,13 +460,11 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
QMenu * menu = new QMenu; QMenu * menu = new QMenu;
QMenu * copyMenu = new QMenu(tr("&Copy")); QMenu * copyMenu = new QMenu(tr("&Copy"));
QUrl currentFileUrl = currentImageFileUrl(); QUrl currentFileUrl = currentImageFileUrl();
QImage clipboardImage;
QUrl clipboardFileUrl;
QAction * copyPixmap = m_am->actionCopyPixmap; QAction * copyPixmap = m_am->actionCopyPixmap;
QAction * copyFilePath = m_am->actionCopyFilePath; QAction * copyFilePath = m_am->actionCopyFilePath;
copyMenu->setIcon(QIcon::fromTheme(QLatin1String("edit-copy"))); copyMenu->setIcon(QIcon::fromTheme(u"edit-copy"_s));
copyMenu->addAction(copyPixmap); copyMenu->addAction(copyPixmap);
if (currentFileUrl.isValid()) { if (currentFileUrl.isValid()) {
copyMenu->addAction(copyFilePath); copyMenu->addAction(copyFilePath);
@@ -522,6 +533,50 @@ void MainWindow::contextMenuEvent(QContextMenuEvent *event)
return FramelessWindow::contextMenuEvent(event); return FramelessWindow::contextMenuEvent(event);
} }
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasUrls() || event->mimeData()->hasImage() || event->mimeData()->hasText()) {
event->acceptProposedAction();
} else {
event->ignore();
}
return FramelessWindow::dragEnterEvent(event);
}
void MainWindow::dragMoveEvent(QDragMoveEvent *event)
{
Q_UNUSED(event)
}
void MainWindow::dropEvent(QDropEvent *event)
{
event->acceptProposedAction();
const QMimeData * mimeData = event->mimeData();
if (mimeData->hasUrls()) {
const QList<QUrl> &urls = mimeData->urls();
if (urls.isEmpty()) {
m_graphicsView->showText(tr("File url list is empty"));
} else {
showUrls(urls);
}
} else if (mimeData->hasImage()) {
QImage img = qvariant_cast<QImage>(mimeData->imageData());
QPixmap pixmap = QPixmap::fromImage(img);
if (pixmap.isNull()) {
m_graphicsView->showText(tr("Image data is invalid"));
} else {
m_graphicsView->showImage(pixmap);
}
} else if (mimeData->hasText()) {
m_graphicsView->showText(mimeData->text());
} else {
m_graphicsView->showText(tr("Not supported mimedata: %1").arg(mimeData->formats().first()));
}
}
void MainWindow::centerWindow() void MainWindow::centerWindow()
{ {
this->setGeometry( this->setGeometry(
@@ -529,19 +584,23 @@ void MainWindow::centerWindow()
Qt::LeftToRight, Qt::LeftToRight,
Qt::AlignCenter, Qt::AlignCenter,
this->size(), this->size(),
qApp->screenAt(QCursor::pos())->geometry() qApp->screenAt(QCursor::pos())->availableGeometry()
) )
); );
} }
void MainWindow::closeWindow() void MainWindow::closeWindow()
{ {
if (Settings::instance()->useBuiltInCloseAnimation()) {
QRect windowRect(this->geometry()); QRect windowRect(this->geometry());
m_floatUpAnimation->setStartValue(windowRect); m_floatUpAnimation->setStartValue(windowRect);
m_floatUpAnimation->setEndValue(windowRect.adjusted(0, -80, 0, 0)); m_floatUpAnimation->setEndValue(windowRect.adjusted(0, -80, 0, 0));
m_floatUpAnimation->setStartValue(QRect(this->geometry().x(), this->geometry().y(), this->geometry().width(), this->geometry().height())); m_floatUpAnimation->setStartValue(QRect(this->geometry().x(), this->geometry().y(), this->geometry().width(), this->geometry().height()));
m_floatUpAnimation->setEndValue(QRect(this->geometry().x(), this->geometry().y()-80, this->geometry().width(), this->geometry().height())); m_floatUpAnimation->setEndValue(QRect(this->geometry().x(), this->geometry().y()-80, this->geometry().width(), this->geometry().height()));
m_exitAnimationGroup->start(); m_exitAnimationGroup->start();
} else {
doCloseWindow();
}
} }
void MainWindow::updateWidgetsPosition() void MainWindow::updateWidgetsPosition()
@@ -559,8 +618,7 @@ void MainWindow::toggleProtectedMode()
{ {
m_protectedMode = !m_protectedMode; m_protectedMode = !m_protectedMode;
m_closeButton->setVisible(!m_protectedMode); m_closeButton->setVisible(!m_protectedMode);
m_prevButton->setVisible(!m_protectedMode); updateGalleryButtonsVisibility();
m_nextButton->setVisible(!m_protectedMode);
} }
void MainWindow::toggleStayOnTop() void MainWindow::toggleStayOnTop()
@@ -642,6 +700,7 @@ void MainWindow::on_actionActualSize_triggered()
{ {
m_graphicsView->resetScale(); m_graphicsView->resetScale();
m_graphicsView->setEnableAutoFitInView(false); m_graphicsView->setEnableAutoFitInView(false);
m_graphicsView->setLongImageMode(false);
} }
void MainWindow::on_actionToggleMaximize_triggered() void MainWindow::on_actionToggleMaximize_triggered()
@@ -670,6 +729,7 @@ void MainWindow::on_actionFitInView_triggered()
{ {
m_graphicsView->fitInView(m_gv->sceneRect(), Qt::KeepAspectRatio); m_graphicsView->fitInView(m_gv->sceneRect(), Qt::KeepAspectRatio);
m_graphicsView->setEnableAutoFitInView(m_graphicsView->scaleFactor() <= 1); m_graphicsView->setEnableAutoFitInView(m_graphicsView->scaleFactor() <= 1);
m_graphicsView->setLongImageMode(false);
} }
void MainWindow::on_actionFitByWidth_triggered() void MainWindow::on_actionFitByWidth_triggered()
@@ -677,6 +737,12 @@ void MainWindow::on_actionFitByWidth_triggered()
m_graphicsView->fitByOrientation(); m_graphicsView->fitByOrientation();
} }
void MainWindow::on_actionFitLongImage_triggered()
{
m_graphicsView->setLongImageMode(true);
m_graphicsView->fitLongImage();
}
void MainWindow::on_actionCopyPixmap_triggered() void MainWindow::on_actionCopyPixmap_triggered()
{ {
QClipboard *cb = QApplication::clipboard(); QClipboard *cb = QApplication::clipboard();
@@ -714,23 +780,21 @@ void MainWindow::on_actionPaste_triggered()
} }
if (!clipboardImage.isNull()) { if (!clipboardImage.isNull()) {
setWindowTitle(tr("Image From Clipboard"));
m_graphicsView->showImage(clipboardImage); m_graphicsView->showImage(clipboardImage);
clearGallery(); clearGallery();
} else if (clipboardFileUrl.isValid()) { } else if (clipboardFileUrl.isValid()) {
QString localFile(clipboardFileUrl.toLocalFile()); m_graphicsView->showFileFromPath(clipboardFileUrl.toLocalFile());
m_graphicsView->showFileFromPath(localFile, true); m_pm->loadPlaylist(clipboardFileUrl);
m_pm->setCurrentFile(localFile);
} }
} }
void MainWindow::on_actionTrash_triggered() void MainWindow::on_actionTrash_triggered()
{ {
int currentFileIndex; QModelIndex index = m_pm->curIndex();
QUrl currentFileUrl; if (!m_pm->urlByIndex(index).isLocalFile()) return;
std::tie(currentFileIndex, currentFileUrl) = m_pm->currentFileUrl();
if (!currentFileUrl.isLocalFile()) return;
QFile file(currentFileUrl.toLocalFile()); QFile file(m_pm->localFileByIndex(index));
QFileInfo fileInfo(file.fileName()); QFileInfo fileInfo(file.fileName());
QMessageBox::StandardButton result = QMessageBox::question(this, tr("Move to Trash"), QMessageBox::StandardButton result = QMessageBox::question(this, tr("Move to Trash"),
@@ -738,11 +802,11 @@ void MainWindow::on_actionTrash_triggered()
if (result == QMessageBox::Yes) { if (result == QMessageBox::Yes) {
bool succ = file.moveToTrash(); bool succ = file.moveToTrash();
if (!succ) { if (!succ) {
QMessageBox::warning(this, "Failed to move file to trash", QMessageBox::warning(this, tr("Failed to move file to trash"),
tr("Move to trash failed, it might caused by file permission issue, file system limitation, or platform limitation.")); tr("Move to trash failed, it might caused by file permission issue, file system limitation, or platform limitation."));
} else { } else {
m_pm->removeFileAt(currentFileIndex); m_pm->removeAt(index);
galleryCurrent(); galleryCurrent(true, true);
} }
} }
} }
@@ -757,7 +821,12 @@ void MainWindow::on_actionRotateClockwise_triggered()
{ {
m_graphicsView->rotateView(); m_graphicsView->rotateView();
m_graphicsView->displayScene(); m_graphicsView->displayScene();
m_gv->setVisible(false); }
void MainWindow::on_actionRotateCounterClockwise_triggered()
{
m_graphicsView->rotateView(false);
m_graphicsView->displayScene();
} }
void MainWindow::on_actionPrevPicture_triggered() void MainWindow::on_actionPrevPicture_triggered()
@@ -770,6 +839,16 @@ void MainWindow::on_actionNextPicture_triggered()
galleryNext(); galleryNext();
} }
void MainWindow::on_actionTogglePauseAnimation_triggered()
{
m_graphicsView->scene()->togglePauseAnimation();
}
void MainWindow::on_actionAnimationNextFrame_triggered()
{
m_graphicsView->scene()->skipAnimationFrame(1);
}
void MainWindow::on_actionToggleStayOnTop_triggered() void MainWindow::on_actionToggleStayOnTop_triggered()
{ {
toggleStayOnTop(); toggleStayOnTop();
@@ -832,9 +911,9 @@ void MainWindow::on_actionLocateInFileManager_triggered()
QDesktopServices::openUrl(folderUrl); QDesktopServices::openUrl(folderUrl);
return; return;
} }
QDBusInterface fm1Iface(QStringLiteral("org.freedesktop.FileManager1"), QDBusInterface fm1Iface(u"org.freedesktop.FileManager1"_s,
QStringLiteral("/org/freedesktop/FileManager1"), u"/org/freedesktop/FileManager1"_s,
QStringLiteral("org.freedesktop.FileManager1")); u"org.freedesktop.FileManager1"_s);
fm1Iface.setTimeout(1000); fm1Iface.setTimeout(1000);
fm1Iface.callWithArgumentList(QDBus::Block, "ShowItems", { fm1Iface.callWithArgumentList(QDBus::Block, "ShowItems", {
QStringList{currentFileUrl.toString()}, QStringList{currentFileUrl.toString()},
@@ -852,3 +931,29 @@ void MainWindow::on_actionQuitApp_triggered()
{ {
quitAppAction(false); quitAppAction(false);
} }
void MainWindow::doCloseWindow()
{
#ifdef Q_OS_MAC
this->hide();
#else
this->close();
#endif
}
bool MainWindow::updateFileWatcher(const QString &basePath)
{
m_fileSystemWatcher->removePaths(m_fileSystemWatcher->files());
if (!basePath.isEmpty()) return m_fileSystemWatcher->addPath(basePath);
return false;
}
void MainWindow::updateGalleryButtonsVisibility()
{
const int galleryFileCount = m_pm->totalCount();
const bool loopGallery = Settings::instance()->loopGallery();
m_prevButton->setVisible(!m_protectedMode && galleryFileCount > 1);
m_nextButton->setVisible(!m_protectedMode && galleryFileCount > 1);
m_prevButton->setEnabled(loopGallery || !m_pm->isFirstIndex());
m_nextButton->setEnabled(loopGallery || !m_pm->isLastIndex());
}

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com> // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -11,15 +11,10 @@
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QPushButton> #include <QPushButton>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
typedef QEnterEvent QT_ENTER_EVENT;
#else
typedef QEvent QT_ENTER_EVENT;
#endif // QT_VERSION_CHECK(6, 0, 0)
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QGraphicsOpacityEffect; class QGraphicsOpacityEffect;
class QGraphicsView; class QGraphicsView;
class QFileSystemWatcher;
QT_END_NAMESPACE QT_END_NAMESPACE
class ActionManager; class ActionManager;
@@ -42,14 +37,15 @@ public:
QUrl currentImageFileUrl() const; QUrl currentImageFileUrl() const;
void clearGallery(); void clearGallery();
void loadGalleryBySingleLocalFile(const QString &path);
void galleryPrev(); void galleryPrev();
void galleryNext(); void galleryNext();
void galleryCurrent(); void galleryCurrent(bool showLoadImageHintWhenEmpty, bool reloadImage);
static QStringList supportedImageFormats();
protected slots: protected slots:
void showEvent(QShowEvent *event) override; void showEvent(QShowEvent *event) override;
void enterEvent(QT_ENTER_EVENT *event) override; void enterEvent(QEnterEvent *event) override;
void leaveEvent(QEvent *event) override; void leaveEvent(QEvent *event) override;
void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override;
@@ -58,6 +54,9 @@ protected slots:
void wheelEvent(QWheelEvent *event) override; void wheelEvent(QWheelEvent *event) override;
void resizeEvent(QResizeEvent *event) override; void resizeEvent(QResizeEvent *event) override;
void contextMenuEvent(QContextMenuEvent *event) override; void contextMenuEvent(QContextMenuEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dropEvent(QDropEvent *event) override;
void centerWindow(); void centerWindow();
void closeWindow(); void closeWindow();
@@ -83,13 +82,18 @@ private slots:
void on_actionZoomOut_triggered(); void on_actionZoomOut_triggered();
void on_actionToggleCheckerboard_triggered(); void on_actionToggleCheckerboard_triggered();
void on_actionRotateClockwise_triggered(); void on_actionRotateClockwise_triggered();
void on_actionRotateCounterClockwise_triggered();
void on_actionPrevPicture_triggered(); void on_actionPrevPicture_triggered();
void on_actionNextPicture_triggered(); void on_actionNextPicture_triggered();
void on_actionTogglePauseAnimation_triggered();
void on_actionAnimationNextFrame_triggered();
void on_actionHorizontalFlip_triggered(); void on_actionHorizontalFlip_triggered();
void on_actionFitInView_triggered(); void on_actionFitInView_triggered();
void on_actionFitByWidth_triggered(); void on_actionFitByWidth_triggered();
void on_actionFitLongImage_triggered();
void on_actionCopyPixmap_triggered(); void on_actionCopyPixmap_triggered();
void on_actionCopyFilePath_triggered(); void on_actionCopyFilePath_triggered();
void on_actionPaste_triggered(); void on_actionPaste_triggered();
@@ -103,6 +107,12 @@ private slots:
void on_actionLocateInFileManager_triggered(); void on_actionLocateInFileManager_triggered();
void on_actionQuitApp_triggered(); void on_actionQuitApp_triggered();
void doCloseWindow();
private:
bool updateFileWatcher(const QString & basePath = QString());
void updateGalleryButtonsVisibility();
private: private:
ActionManager *m_am; ActionManager *m_am;
PlaylistManager *m_pm; PlaylistManager *m_pm;
@@ -111,6 +121,7 @@ private:
QPropertyAnimation *m_fadeOutAnimation; QPropertyAnimation *m_fadeOutAnimation;
QPropertyAnimation *m_floatUpAnimation; QPropertyAnimation *m_floatUpAnimation;
QParallelAnimationGroup *m_exitAnimationGroup; QParallelAnimationGroup *m_exitAnimationGroup;
QFileSystemWatcher *m_fileSystemWatcher;
ToolButton *m_closeButton; ToolButton *m_closeButton;
ToolButton *m_prevButton; ToolButton *m_prevButton;
ToolButton *m_nextButton; ToolButton *m_nextButton;

View File

@@ -11,6 +11,8 @@
#include <QFileInfo> #include <QFileInfo>
#include <QImageReader> #include <QImageReader>
using namespace Qt::Literals::StringLiterals;
MetadataModel::MetadataModel(QObject *parent) MetadataModel::MetadataModel(QObject *parent)
: QAbstractItemModel(parent) : QAbstractItemModel(parent)
{ {
@@ -37,131 +39,131 @@ void MetadataModel::setFile(const QString &imageFilePath)
const QString & imageDimensionsString = imageSize(imgReader.size()); const QString & imageDimensionsString = imageSize(imgReader.size());
const QString & imageRatioString = imageSizeRatio(imgReader.size()); const QString & imageRatioString = imageSizeRatio(imgReader.size());
appendSection(QStringLiteral("Description"), tr("Description", "Section name.")); appendSection(u"Description"_s, tr("Description", "Section name."));
appendSection(QStringLiteral("Origin"), tr("Origin", "Section name.")); appendSection(u"Origin"_s, tr("Origin", "Section name."));
appendSection(QStringLiteral("Image"), tr("Image", "Section name.")); appendSection(u"Image"_s, tr("Image", "Section name."));
appendSection(QStringLiteral("Camera"), tr("Camera", "Section name.")); appendSection(u"Camera"_s, tr("Camera", "Section name."));
appendSection(QStringLiteral("AdvancedPhoto"), tr("Advanced photo", "Section name.")); appendSection(u"AdvancedPhoto"_s, tr("Advanced photo", "Section name."));
appendSection(QStringLiteral("GPS"), tr("GPS", "Section name.")); appendSection(u"GPS"_s, tr("GPS", "Section name."));
appendSection(QStringLiteral("File"), tr("File", "Section name.")); appendSection(u"File"_s, tr("File", "Section name."));
if (imgReader.supportsOption(QImageIOHandler::Size)) { if (imgReader.supportsOption(QImageIOHandler::Size)) {
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.Dimensions"), appendProperty(u"Image"_s, u"Image.Dimensions"_s,
tr("Dimensions"), imageDimensionsString); tr("Dimensions"), imageDimensionsString);
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.SizeRatio"), appendProperty(u"Image"_s, u"Image.SizeRatio"_s,
tr("Aspect ratio"), imageRatioString); tr("Aspect ratio"), imageRatioString);
} }
if (imgReader.supportsAnimation() && imgReader.imageCount() > 1) { if (imgReader.supportsAnimation() && imgReader.imageCount() > 1) {
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.FrameCount"), appendProperty(u"Image"_s, u"Image.FrameCount"_s,
tr("Frame count"), QString::number(imgReader.imageCount())); tr("Frame count"), QString::number(imgReader.imageCount()));
} }
appendProperty(QStringLiteral("File"), QStringLiteral("File.Name"), appendProperty(u"File"_s, u"File.Name"_s,
tr("Name"), fileInfo.fileName()); tr("Name"), fileInfo.fileName());
appendProperty(QStringLiteral("File"), QStringLiteral("File.ItemType"), appendProperty(u"File"_s, u"File.ItemType"_s,
tr("Item type"), itemTypeString); tr("Item type"), itemTypeString);
appendProperty(QStringLiteral("File"), QStringLiteral("File.Path"), appendProperty(u"File"_s, u"File.Path"_s,
tr("Folder path"), QDir::toNativeSeparators(fileInfo.path())); tr("Folder path"), QDir::toNativeSeparators(fileInfo.path()));
appendProperty(QStringLiteral("File"), QStringLiteral("File.Size"), appendProperty(u"File"_s, u"File.Size"_s,
tr("Size"), sizeString); tr("Size"), sizeString);
appendProperty(QStringLiteral("File"), QStringLiteral("File.CreatedTime"), appendProperty(u"File"_s, u"File.CreatedTime"_s,
tr("Date created"), birthTimeString); tr("Date created"), birthTimeString);
appendProperty(QStringLiteral("File"), QStringLiteral("File.LastModified"), appendProperty(u"File"_s, u"File.LastModified"_s,
tr("Date modified"), lastModifiedTimeString); tr("Date modified"), lastModifiedTimeString);
Exiv2Wrapper wrapper; Exiv2Wrapper wrapper;
if (wrapper.load(imageFilePath)) { if (wrapper.load(imageFilePath)) {
wrapper.cacheSections(); wrapper.cacheSections();
appendExivPropertyIfExist(wrapper, QStringLiteral("Description"), appendExivPropertyIfExist(wrapper, u"Description"_s,
QStringLiteral("Xmp.dc.title"), tr("Title"), true); u"Xmp.dc.title"_s, tr("Title"), true);
appendExivPropertyIfExist(wrapper, QStringLiteral("Description"), appendExivPropertyIfExist(wrapper, u"Description"_s,
QStringLiteral("Exif.Image.ImageDescription"), tr("Subject"), true); u"Exif.Image.ImageDescription"_s, tr("Subject"), true);
appendExivPropertyIfExist(wrapper, QStringLiteral("Description"), appendExivPropertyIfExist(wrapper, u"Description"_s,
QStringLiteral("Exif.Image.Rating"), tr("Rating")); u"Exif.Image.Rating"_s, tr("Rating"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Description"), appendExivPropertyIfExist(wrapper, u"Description"_s,
QStringLiteral("Xmp.dc.subject"), tr("Tags")); u"Xmp.dc.subject"_s, tr("Tags"));
appendPropertyIfNotEmpty(QStringLiteral("Description"), QStringLiteral("Description.Comments"), appendPropertyIfNotEmpty(u"Description"_s, u"Description.Comments"_s,
tr("Comments"), wrapper.comment()); tr("Comments"), wrapper.comment());
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), appendExivPropertyIfExist(wrapper, u"Origin"_s,
QStringLiteral("Exif.Image.Artist"), tr("Authors")); u"Exif.Image.Artist"_s, tr("Authors"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), appendExivPropertyIfExist(wrapper, u"Origin"_s,
QStringLiteral("Exif.Photo.DateTimeOriginal"), tr("Date taken")); u"Exif.Photo.DateTimeOriginal"_s, tr("Date taken"));
// FIXME: We may fetch the same type of metadata from different metadata collection. // FIXME: We may fetch the same type of metadata from different metadata collection.
// Current implementation is not pretty and may need to do a rework... // Current implementation is not pretty and may need to do a rework...
// appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), // appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"),
// QStringLiteral("Xmp.xmp.CreatorTool"), tr("Program name")); // QStringLiteral("Xmp.xmp.CreatorTool"), tr("Program name"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), appendExivPropertyIfExist(wrapper, u"Origin"_s,
QStringLiteral("Exif.Image.Software"), tr("Program name")); u"Exif.Image.Software"_s, tr("Program name"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), appendExivPropertyIfExist(wrapper, u"Origin"_s,
QStringLiteral("Exif.Image.Copyright"), tr("Copyright")); u"Exif.Image.Copyright"_s, tr("Copyright"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), appendExivPropertyIfExist(wrapper, u"Image"_s,
QStringLiteral("Exif.Image.XResolution"), tr("Horizontal resolution")); u"Exif.Image.XResolution"_s, tr("Horizontal resolution"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), appendExivPropertyIfExist(wrapper, u"Image"_s,
QStringLiteral("Exif.Image.YResolution"), tr("Vertical resolution")); u"Exif.Image.YResolution"_s, tr("Vertical resolution"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), appendExivPropertyIfExist(wrapper, u"Image"_s,
QStringLiteral("Exif.Image.ResolutionUnit"), tr("Resolution unit")); u"Exif.Image.ResolutionUnit"_s, tr("Resolution unit"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), appendExivPropertyIfExist(wrapper, u"Image"_s,
QStringLiteral("Exif.Photo.ColorSpace"), tr("Colour representation")); u"Exif.Photo.ColorSpace"_s, tr("Colour representation"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Image.Make"), tr("Camera maker")); u"Exif.Image.Make"_s, tr("Camera maker"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Image.Model"), tr("Camera model")); u"Exif.Image.Model"_s, tr("Camera model"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.FNumber"), tr("F-stop")); u"Exif.Photo.FNumber"_s, tr("F-stop"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.ExposureTime"), tr("Exposure time")); u"Exif.Photo.ExposureTime"_s, tr("Exposure time"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.ISOSpeedRatings"), tr("ISO speed")); u"Exif.Photo.ISOSpeedRatings"_s, tr("ISO speed"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.ExposureBiasValue"), tr("Exposure bias")); u"Exif.Photo.ExposureBiasValue"_s, tr("Exposure bias"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.FocalLength"), tr("Focal length")); u"Exif.Photo.FocalLength"_s, tr("Focal length"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.MaxApertureValue"), tr("Max aperture")); u"Exif.Photo.MaxApertureValue"_s, tr("Max aperture"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.MeteringMode"), tr("Metering mode")); u"Exif.Photo.MeteringMode"_s, tr("Metering mode"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.SubjectDistance"), tr("Subject distance")); u"Exif.Photo.SubjectDistance"_s, tr("Subject distance"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.Flash"), tr("Flash mode")); u"Exif.Photo.Flash"_s, tr("Flash mode"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), appendExivPropertyIfExist(wrapper, u"Camera"_s,
QStringLiteral("Exif.Photo.FocalLengthIn35mmFilm"), tr("35mm focal length")); u"Exif.Photo.FocalLengthIn35mmFilm"_s, tr("35mm focal length"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.LensModel"), tr("Lens model")); u"Exif.Photo.LensModel"_s, tr("Lens model"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.Contrast"), tr("Contrast")); u"Exif.Photo.Contrast"_s, tr("Contrast"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.BrightnessValue"), tr("Brightness")); u"Exif.Photo.BrightnessValue"_s, tr("Brightness"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.ExposureProgram"), tr("Exposure program")); u"Exif.Photo.ExposureProgram"_s, tr("Exposure program"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.Saturation"), tr("Saturation")); u"Exif.Photo.Saturation"_s, tr("Saturation"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.Sharpness"), tr("Sharpness")); u"Exif.Photo.Sharpness"_s, tr("Sharpness"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.WhiteBalance"), tr("White balance")); u"Exif.Photo.WhiteBalance"_s, tr("White balance"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.DigitalZoomRatio"), tr("Digital zoom")); u"Exif.Photo.DigitalZoomRatio"_s, tr("Digital zoom"));
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
QStringLiteral("Exif.Photo.ExifVersion"), tr("EXIF version")); u"Exif.Photo.ExifVersion"_s, tr("EXIF version"));
appendExivPropertyIfExist(wrapper, QStringLiteral("GPS"), appendExivPropertyIfExist(wrapper, u"GPS"_s,
QStringLiteral("Exif.GPSInfo.GPSLatitudeRef"), tr("Latitude reference")); u"Exif.GPSInfo.GPSLatitudeRef"_s, tr("Latitude reference"));
appendExivPropertyIfExist(wrapper, QStringLiteral("GPS"), appendExivPropertyIfExist(wrapper, u"GPS"_s,
QStringLiteral("Exif.GPSInfo.GPSLatitude"), tr("Latitude")); u"Exif.GPSInfo.GPSLatitude"_s, tr("Latitude"));
appendExivPropertyIfExist(wrapper, QStringLiteral("GPS"), appendExivPropertyIfExist(wrapper, u"GPS"_s,
QStringLiteral("Exif.GPSInfo.GPSLongitudeRef"), tr("Longitude reference")); u"Exif.GPSInfo.GPSLongitudeRef"_s, tr("Longitude reference"));
appendExivPropertyIfExist(wrapper, QStringLiteral("GPS"), appendExivPropertyIfExist(wrapper, u"GPS"_s,
QStringLiteral("Exif.GPSInfo.GPSLongitude"), tr("Longitude")); u"Exif.GPSInfo.GPSLongitude"_s, tr("Longitude"));
appendExivPropertyIfExist(wrapper, QStringLiteral("GPS"), appendExivPropertyIfExist(wrapper, u"GPS"_s,
QStringLiteral("Exif.GPSInfo.GPSAltitudeRef"), tr("Altitude reference")); u"Exif.GPSInfo.GPSAltitudeRef"_s, tr("Altitude reference"));
appendExivPropertyIfExist(wrapper, QStringLiteral("GPS"), appendExivPropertyIfExist(wrapper, u"GPS"_s,
QStringLiteral("Exif.GPSInfo.GPSAltitude"), tr("Altitude")); u"Exif.GPSInfo.GPSAltitude"_s, tr("Altitude"));
} }
} }

View File

@@ -9,6 +9,7 @@
#include <QMouseEvent> #include <QMouseEvent>
#include <QDebug> #include <QDebug>
#include <QTimer>
NavigatorView::NavigatorView(QWidget *parent) NavigatorView::NavigatorView(QWidget *parent)
: QGraphicsView (parent) : QGraphicsView (parent)
@@ -34,10 +35,14 @@ void NavigatorView::setOpacity(qreal opacity, bool animated)
void NavigatorView::updateMainViewportRegion() void NavigatorView::updateMainViewportRegion()
{ {
// Use QTimer::singleShot with lambda to delay the update
// This ensures all geometry updates are complete before calculating viewport region
QTimer::singleShot(0, [this]() {
if (m_mainView != nullptr) { if (m_mainView != nullptr) {
m_viewportRegion = mapFromScene(m_mainView->mapToScene(m_mainView->rect())); m_viewportRegion = mapFromScene(m_mainView->mapToScene(m_mainView->rect()));
update(); update();
} }
});
} }
void NavigatorView::mousePressEvent(QMouseEvent *event) void NavigatorView::mousePressEvent(QMouseEvent *event)

View File

@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com> // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -9,63 +9,46 @@
#include <QFileInfo> #include <QFileInfo>
#include <QUrl> #include <QUrl>
PlaylistManager::PlaylistManager(PlaylistType type, QObject *parent) PlaylistModel::PlaylistModel(QObject *parent)
: QObject(parent) : QAbstractListModel(parent)
, m_type(type)
{ {
} }
PlaylistManager::~PlaylistManager() PlaylistModel::~PlaylistModel()
{ = default;
} void PlaylistModel::setPlaylist(const QList<QUrl> &urls)
void PlaylistManager::setPlaylistType(PlaylistManager::PlaylistType type)
{
m_type = type;
}
PlaylistManager::PlaylistType PlaylistManager::playlistType() const
{
return m_type;
}
QStringList PlaylistManager::autoLoadFilterSuffix() const
{
return m_autoLoadSuffix;
}
void PlaylistManager::setAutoLoadFilterSuffix(const QStringList & nameFilters)
{
m_autoLoadSuffix = nameFilters;
}
void PlaylistManager::clear()
{
m_currentIndex = -1;
m_playlist.clear();
}
void PlaylistManager::setPlaylist(const QList<QUrl> &urls)
{ {
beginResetModel();
m_playlist = urls; m_playlist = urls;
endResetModel();
} }
void PlaylistManager::setCurrentFile(const QString & filePath) QModelIndex PlaylistModel::loadPlaylist(const QList<QUrl> & urls)
{ {
QFileInfo info(filePath); if (urls.isEmpty()) return {};
if (urls.count() == 1) {
return loadPlaylist(urls.constFirst());
} else {
setPlaylist(urls);
return index(0);
}
}
QModelIndex PlaylistModel::loadPlaylist(const QUrl &url)
{
QFileInfo info(url.toLocalFile());
QDir dir(info.path()); QDir dir(info.path());
QString && currentFileName = info.fileName(); QString && currentFileName = info.fileName();
switch (playlistType()) {
case PL_SAMEFOLDER: {
if (dir.path() == m_currentDir) { if (dir.path() == m_currentDir) {
int index = indexOf(filePath); int idx = indexOf(url);
m_currentIndex = index == -1 ? appendFile(filePath) : index; return idx == -1 ? appendToPlaylist(url) : index(idx);
} else { }
QStringList entryList = dir.entryList( QStringList entryList = dir.entryList(
m_autoLoadSuffix, m_autoLoadSuffixes,
QDir::Files | QDir::NoSymLinks, QDir::NoSort); QDir::Files | QDir::NoSymLinks, QDir::NoSort);
QCollator collator; QCollator collator;
@@ -73,102 +56,217 @@ void PlaylistManager::setCurrentFile(const QString & filePath)
std::sort(entryList.begin(), entryList.end(), collator); std::sort(entryList.begin(), entryList.end(), collator);
clear(); QList<QUrl> playlist;
int index = -1; int idx = -1;
for (int i = 0; i < entryList.count(); i++) { for (int i = 0; i < entryList.count(); i++) {
const QString & fileName = entryList.at(i); const QString & fileName = entryList.at(i);
const QString & oneEntry = dir.absoluteFilePath(fileName); const QString & oneEntry = dir.absoluteFilePath(fileName);
const QUrl & url = QUrl::fromLocalFile(oneEntry); const QUrl & url = QUrl::fromLocalFile(oneEntry);
m_playlist.append(url); playlist.append(url);
if (fileName == currentFileName) { if (fileName == currentFileName) {
index = i; idx = i;
} }
} }
m_currentIndex = index == -1 ? appendFile(filePath) : index; if (idx == -1) {
idx = playlist.count();
playlist.append(url);
}
m_currentDir = dir.path(); m_currentDir = dir.path();
}
break; setPlaylist(playlist);
}
case PL_USERPLAYLIST:{ return index(idx);
int index = indexOf(filePath);
m_currentIndex = index == -1 ? appendFile(filePath) : index;
break;
}
default:
break;
} }
emit currentIndexChanged(m_currentIndex); QModelIndex PlaylistModel::appendToPlaylist(const QUrl &url)
emit loaded(m_playlist.count());
}
void PlaylistManager::setCurrentIndex(int index)
{ {
if (index < 0 || index >= m_playlist.count()) return; const int lastIndex = rowCount();
m_currentIndex = index; beginInsertRows(QModelIndex(), lastIndex, lastIndex);
emit currentIndexChanged(m_currentIndex); m_playlist.append(url);
endInsertRows();
return index(lastIndex);
} }
int PlaylistManager::appendFile(const QString &filePath) bool PlaylistModel::removeAt(int index)
{
int index = m_playlist.length();
m_playlist.append(QUrl::fromLocalFile(filePath));
return index;
}
// Note: this will only remove file out of the list, this will NOT delete the file
void PlaylistManager::removeFileAt(int index)
{ {
if (index < 0 || index >= rowCount()) return false;
beginRemoveRows(QModelIndex(), index, index);
m_playlist.removeAt(index); m_playlist.removeAt(index);
endRemoveRows();
if (m_playlist.count() <= m_currentIndex) { return true;
m_currentIndex--;
}
} }
int PlaylistManager::indexOf(const QString &filePath) int PlaylistModel::indexOf(const QUrl &url) const
{ {
const QUrl & url = QUrl::fromLocalFile(filePath);
return m_playlist.indexOf(url); return m_playlist.indexOf(url);
} }
int PlaylistManager::count() const QUrl PlaylistModel::urlByIndex(int index) const
{
return m_playlist.value(index);
}
QStringList PlaylistModel::autoLoadFilterSuffixes() const
{
return m_autoLoadSuffixes;
}
QHash<int, QByteArray> PlaylistModel::roleNames() const
{
QHash<int, QByteArray> result = QAbstractListModel::roleNames();
result.insert(UrlRole, "url");
return result;
}
int PlaylistModel::rowCount(const QModelIndex &parent) const
{ {
return m_playlist.count(); return m_playlist.count();
} }
std::tuple<int, QString> PlaylistManager::previousFile() const QVariant PlaylistModel::data(const QModelIndex &index, int role) const
{ {
int count = m_playlist.count(); if (!index.isValid()) return {};
if (count == 0) return std::make_tuple(-1, QString());
int index = m_currentIndex - 1 < 0 ? count - 1 : m_currentIndex - 1; switch (role) {
return std::make_tuple(index, m_playlist.at(index).toLocalFile()); case Qt::DisplayRole:
return m_playlist.at(index.row()).fileName();
case UrlRole:
return m_playlist.at(index.row());
} }
std::tuple<int, QString> PlaylistManager::nextFile() const return {};
{
int count = m_playlist.count();
if (count == 0) return std::make_tuple(-1, QString());
int index = m_currentIndex + 1 == count ? 0 : m_currentIndex + 1;
return std::make_tuple(index, m_playlist.at(index).toLocalFile());
} }
std::tuple<int, QString> PlaylistManager::currentFile() const PlaylistManager::PlaylistManager(QObject *parent)
: QObject(parent)
{ {
if (m_playlist.count() == 0) return std::make_tuple(-1, QString()); connect(&m_model, &PlaylistModel::rowsRemoved, this,
[this](const QModelIndex &, int, int) {
if (m_model.rowCount() <= m_currentIndex) {
setProperty("currentIndex", m_currentIndex - 1);
}
});
return std::make_tuple(m_currentIndex, m_playlist.at(m_currentIndex).toLocalFile()); auto onRowCountChanged = [this](){
emit totalCountChanged(m_model.rowCount());
};
connect(&m_model, &PlaylistModel::rowsInserted, this, onRowCountChanged);
connect(&m_model, &PlaylistModel::rowsRemoved, this, onRowCountChanged);
connect(&m_model, &PlaylistModel::modelReset, this, onRowCountChanged);
} }
std::tuple<int, QUrl> PlaylistManager::currentFileUrl() const PlaylistManager::~PlaylistManager()
{ {
if (m_playlist.count() == 0) return std::make_tuple(-1, QUrl());
return std::make_tuple(m_currentIndex, m_playlist.at(m_currentIndex)); }
PlaylistModel *PlaylistManager::model()
{
return &m_model;
}
void PlaylistManager::setPlaylist(const QList<QUrl> &urls)
{
m_model.setPlaylist(urls);
}
QModelIndex PlaylistManager::loadPlaylist(const QList<QUrl> &urls)
{
QModelIndex idx = m_model.loadPlaylist(urls);
setProperty("currentIndex", idx.row());
return idx;
}
QModelIndex PlaylistManager::loadPlaylist(const QUrl &url)
{
QModelIndex idx = m_model.loadPlaylist(url);
setProperty("currentIndex", idx.row());
return idx;
}
QModelIndex PlaylistManager::loadM3U8Playlist(const QUrl &url)
{
QFile file(url.toLocalFile());
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QList<QUrl> urls;
while (!file.atEnd()) {
QString line = file.readLine();
if (line.startsWith('#')) {
continue;
}
QFileInfo fileInfo(file);
QUrl item = QUrl::fromUserInput(line, fileInfo.absolutePath());
urls.append(item);
}
return loadPlaylist(urls);
} else {
return {};
}
}
int PlaylistManager::totalCount() const
{
return m_model.rowCount();
}
QModelIndex PlaylistManager::previousIndex() const
{
int count = totalCount();
if (count == 0) return {};
return m_model.index(isFirstIndex() ? count - 1 : m_currentIndex - 1);
}
QModelIndex PlaylistManager::nextIndex() const
{
int count = totalCount();
if (count == 0) return {};
return m_model.index(isLastIndex() ? 0 : m_currentIndex + 1);
}
QModelIndex PlaylistManager::curIndex() const
{
return m_model.index(m_currentIndex);
}
bool PlaylistManager::isFirstIndex() const
{
return m_currentIndex == 0;
}
bool PlaylistManager::isLastIndex() const
{
return m_currentIndex + 1 == totalCount();
}
void PlaylistManager::setCurrentIndex(const QModelIndex &index)
{
if (index.isValid() && index.row() >= 0 && index.row() < totalCount()) {
setProperty("currentIndex", index.row());
}
}
QUrl PlaylistManager::urlByIndex(const QModelIndex &index)
{
return m_model.urlByIndex(index.row());
}
QString PlaylistManager::localFileByIndex(const QModelIndex &index)
{
return urlByIndex(index).toLocalFile();
}
bool PlaylistManager::removeAt(const QModelIndex &index)
{
return m_model.removeAt(index.row());
}
void PlaylistManager::setAutoLoadFilterSuffixes(const QStringList &nameFilters)
{
m_model.setProperty("autoLoadFilterSuffixes", nameFilters);
} }
QList<QUrl> PlaylistManager::convertToUrlList(const QStringList &files) QList<QUrl> PlaylistManager::convertToUrlList(const QStringList &files)

View File

@@ -1,58 +1,88 @@
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com> // SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
#include <QObject> #include <QUrl>
#include <QAbstractListModel>
class PlaylistModel : public QAbstractListModel
{
Q_OBJECT
public:
enum PlaylistRole {
UrlRole = Qt::UserRole
};
Q_ENUM(PlaylistRole)
Q_PROPERTY(QStringList autoLoadFilterSuffixes MEMBER m_autoLoadSuffixes NOTIFY autoLoadFilterSuffixesChanged)
explicit PlaylistModel(QObject *parent = nullptr);
~PlaylistModel() override;
void setPlaylist(const QList<QUrl> & urls);
QModelIndex loadPlaylist(const QList<QUrl> & urls);
QModelIndex loadPlaylist(const QUrl & url);
QModelIndex appendToPlaylist(const QUrl & url);
bool removeAt(int index);
int indexOf(const QUrl & url) const;
QUrl urlByIndex(int index) const;
QStringList autoLoadFilterSuffixes() const;
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
signals:
void autoLoadFilterSuffixesChanged(QStringList suffixes);
private:
// model data
QList<QUrl> m_playlist;
// properties
QStringList m_autoLoadSuffixes = {};
// internal
QString m_currentDir;
};
class PlaylistManager : public QObject class PlaylistManager : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
Q_PROPERTY(int currentIndex MEMBER m_currentIndex NOTIFY currentIndexChanged) Q_PROPERTY(int currentIndex MEMBER m_currentIndex NOTIFY currentIndexChanged)
Q_PROPERTY(QStringList autoLoadFilterSuffixes WRITE setAutoLoadFilterSuffixes)
Q_PROPERTY(PlaylistModel * model READ model CONSTANT)
enum PlaylistType { explicit PlaylistManager(QObject *parent = nullptr);
PL_USERPLAYLIST, // Regular playlist, managed by user.
PL_SAMEFOLDER // PlaylistManager managed playlist, loaded from files from same folder.
};
explicit PlaylistManager(PlaylistType type = PL_USERPLAYLIST, QObject *parent = nullptr);
~PlaylistManager(); ~PlaylistManager();
void setPlaylistType(PlaylistType type); PlaylistModel * model();
PlaylistType playlistType() const;
QStringList autoLoadFilterSuffix() const; void setPlaylist(const QList<QUrl> & url);
void setAutoLoadFilterSuffix(const QStringList &nameFilters); Q_INVOKABLE QModelIndex loadPlaylist(const QList<QUrl> & urls);
Q_INVOKABLE QModelIndex loadPlaylist(const QUrl & url);
Q_INVOKABLE QModelIndex loadM3U8Playlist(const QUrl & url);
void clear(); int totalCount() const;
QModelIndex previousIndex() const;
QModelIndex nextIndex() const;
QModelIndex curIndex() const;
bool isFirstIndex() const;
bool isLastIndex() const;
void setCurrentIndex(const QModelIndex & index);
QUrl urlByIndex(const QModelIndex & index);
QString localFileByIndex(const QModelIndex & index);
bool removeAt(const QModelIndex & index);
void setPlaylist(const QList<QUrl> & urls); void setAutoLoadFilterSuffixes(const QStringList &nameFilters);
void setCurrentFile(const QString & filePath);
void setCurrentIndex(int index);
int appendFile(const QString & filePath);
void removeFileAt(int index);
int indexOf(const QString & filePath);
int count() const;
std::tuple<int, QString> previousFile() const;
std::tuple<int, QString> nextFile() const;
std::tuple<int, QString> currentFile() const;
std::tuple<int, QUrl> currentFileUrl() const;
static QList<QUrl> convertToUrlList(const QStringList & files); static QList<QUrl> convertToUrlList(const QStringList & files);
signals: signals:
void loaded(int length);
void currentIndexChanged(int index); void currentIndexChanged(int index);
void totalCountChanged(int count);
private: private:
QList<QUrl> m_playlist;
PlaylistType m_type;
QString m_currentDir;
int m_currentIndex = -1; int m_currentIndex = -1;
QStringList m_autoLoadSuffix = {}; PlaylistModel m_model;
}; };

View File

@@ -8,6 +8,9 @@
#include <QStandardPaths> #include <QStandardPaths>
#include <QDebug> #include <QDebug>
#include <QDir> #include <QDir>
#include <QAction>
#include <QWidget>
#include <QKeySequence>
#include <QMetaEnum> #include <QMetaEnum>
namespace QEnumHelper namespace QEnumHelper
@@ -42,11 +45,44 @@ Settings *Settings::instance()
return m_settings_instance; return m_settings_instance;
} }
bool Settings::stayOnTop() bool Settings::stayOnTop() const
{ {
return m_qsettings->value("stay_on_top", true).toBool(); return m_qsettings->value("stay_on_top", true).toBool();
} }
bool Settings::useBuiltInCloseAnimation() const
{
return m_qsettings->value("use_built_in_close_animation", true).toBool();
}
bool Settings::useLightCheckerboard() const
{
return m_qsettings->value("use_light_checkerboard", false).toBool();
}
bool Settings::loopGallery() const
{
return m_qsettings->value("loop_gallery", true).toBool();
}
bool Settings::autoLongImageMode() const
{
return m_qsettings->value("auto_long_image_mode", true).toBool();
}
bool Settings::svgTiny12Only() const
{
// Qt 6.7.0's SVG support is terrible caused by huge memory usage, see QTBUG-124287
// Qt 6.7.1's is somewhat better, memory issue seems fixed, but still laggy when zoom in, see QTBUG-126771.
// Qt 6.9.3 and Qt 6.10.1 seems no longer have the laggy issue, so let's make the default value different
// based on Qt version.
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 3)
return m_qsettings->value("svg_tiny12_only", true).toBool();
#else
return m_qsettings->value("svg_tiny12_only", false).toBool();
#endif // QT_VERSION < QT_VERSION_CHECK(6, 9, 3)
}
Settings::DoubleClickBehavior Settings::doubleClickBehavior() const Settings::DoubleClickBehavior Settings::doubleClickBehavior() const
{ {
QString result = m_qsettings->value("double_click_behavior", "Close").toString(); QString result = m_qsettings->value("double_click_behavior", "Close").toString();
@@ -81,6 +117,36 @@ void Settings::setStayOnTop(bool on)
m_qsettings->sync(); m_qsettings->sync();
} }
void Settings::setUseBuiltInCloseAnimation(bool on)
{
m_qsettings->setValue("use_built_in_close_animation", on);
m_qsettings->sync();
}
void Settings::setUseLightCheckerboard(bool light)
{
m_qsettings->setValue("use_light_checkerboard", light);
m_qsettings->sync();
}
void Settings::setLoopGallery(bool on)
{
m_qsettings->setValue("loop_gallery", on);
m_qsettings->sync();
}
void Settings::setAutoLongImageMode(bool on)
{
m_qsettings->setValue("auto_long_image_mode", on);
m_qsettings->sync();
}
void Settings::setSvgTiny12Only(bool on)
{
m_qsettings->setValue("svg_tiny12_only", on);
m_qsettings->sync();
}
void Settings::setDoubleClickBehavior(DoubleClickBehavior dcb) void Settings::setDoubleClickBehavior(DoubleClickBehavior dcb)
{ {
m_qsettings->setValue("double_click_behavior", QEnumHelper::toString(dcb)); m_qsettings->setValue("double_click_behavior", QEnumHelper::toString(dcb));
@@ -105,6 +171,47 @@ void Settings::setHiDpiScaleFactorBehavior(Qt::HighDpiScaleFactorRoundingPolicy
m_qsettings->sync(); m_qsettings->sync();
} }
void Settings::applyUserShortcuts(QWidget *widget)
{
m_qsettings->beginGroup("shortcuts");
const QStringList shortcutNames = m_qsettings->allKeys();
for (const QString & name : shortcutNames) {
QList<QKeySequence> shortcuts = m_qsettings->value(name).value<QList<QKeySequence>>();
setShortcutsForAction(widget, name, shortcuts, false);
}
m_qsettings->endGroup();
}
bool Settings::setShortcutsForAction(QWidget *widget, const QString &objectName,
QList<QKeySequence> shortcuts, bool writeConfig)
{
QAction * targetAction = nullptr;
for (QAction * action : widget->actions()) {
if (action->objectName() == objectName) {
targetAction = action;
} else {
for (const QKeySequence & shortcut : std::as_const(shortcuts)) {
if (action->shortcuts().contains(shortcut)) {
return false;
}
}
}
}
if (targetAction) {
targetAction->setShortcuts(shortcuts);
}
if (targetAction && writeConfig) {
m_qsettings->beginGroup("shortcuts");
m_qsettings->setValue(objectName, QVariant::fromValue(shortcuts));
m_qsettings->endGroup();
m_qsettings->sync();
}
return true;
}
#if defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN) #if defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN)
#include <windows.h> #include <windows.h>
// QCoreApplication::applicationDirPath() parses the "applicationDirPath" from arg0, which... // QCoreApplication::applicationDirPath() parses the "applicationDirPath" from arg0, which...
@@ -138,10 +245,12 @@ Settings::Settings()
#endif // defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN) #endif // defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN)
if (configPath.isEmpty()) { if (configPath.isEmpty()) {
// %LOCALAPPDATA%\<APPNAME> under Windows, ~/.config/<APPNAME> under Linux. // Should be %LOCALAPPDATA%\<APPNAME> under Windows, ~/.config/<APPNAME> under Linux.
configPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); configPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
} }
m_qsettings = new QSettings(QDir(configPath).absoluteFilePath("config.ini"), QSettings::IniFormat, this); m_qsettings = new QSettings(QDir(configPath).absoluteFilePath("config.ini"), QSettings::IniFormat, this);
qRegisterMetaType<QList<QKeySequence>>();
} }

View File

@@ -15,6 +15,7 @@ public:
Ignore, Ignore,
Close, Close,
Maximize, Maximize,
FullScreen,
}; };
Q_ENUM(DoubleClickBehavior) Q_ENUM(DoubleClickBehavior)
@@ -27,23 +28,38 @@ public:
enum WindowSizeBehavior { enum WindowSizeBehavior {
Auto, Auto,
Maximized, Maximized,
Windowed,
}; };
Q_ENUM(WindowSizeBehavior) Q_ENUM(WindowSizeBehavior)
static Settings *instance(); static Settings *instance();
bool stayOnTop(); bool stayOnTop() const;
bool useBuiltInCloseAnimation() const;
bool useLightCheckerboard() const;
bool loopGallery() const;
bool autoLongImageMode() const;
bool svgTiny12Only() const;
DoubleClickBehavior doubleClickBehavior() const; DoubleClickBehavior doubleClickBehavior() const;
MouseWheelBehavior mouseWheelBehavior() const; MouseWheelBehavior mouseWheelBehavior() const;
WindowSizeBehavior initWindowSizeBehavior() const; WindowSizeBehavior initWindowSizeBehavior() const;
Qt::HighDpiScaleFactorRoundingPolicy hiDpiScaleFactorBehavior() const; Qt::HighDpiScaleFactorRoundingPolicy hiDpiScaleFactorBehavior() const;
void setStayOnTop(bool on); void setStayOnTop(bool on);
void setUseBuiltInCloseAnimation(bool on);
void setUseLightCheckerboard(bool light);
void setLoopGallery(bool on);
void setAutoLongImageMode(bool on);
void setSvgTiny12Only(bool on);
void setDoubleClickBehavior(DoubleClickBehavior dcb); void setDoubleClickBehavior(DoubleClickBehavior dcb);
void setMouseWheelBehavior(MouseWheelBehavior mwb); void setMouseWheelBehavior(MouseWheelBehavior mwb);
void setInitWindowSizeBehavior(WindowSizeBehavior wsb); void setInitWindowSizeBehavior(WindowSizeBehavior wsb);
void setHiDpiScaleFactorBehavior(Qt::HighDpiScaleFactorRoundingPolicy hidpi); void setHiDpiScaleFactorBehavior(Qt::HighDpiScaleFactorRoundingPolicy hidpi);
void applyUserShortcuts(QWidget * widget);
bool setShortcutsForAction(QWidget * widget, const QString & objectName,
QList<QKeySequence> shortcuts, bool writeConfig = true);
private: private:
Settings(); Settings();
@@ -55,4 +71,3 @@ signals:
public slots: public slots:
}; };

View File

@@ -5,15 +5,26 @@
#include "settingsdialog.h" #include "settingsdialog.h"
#include "settings.h" #include "settings.h"
#include "shortcutedit.h"
#include <QAction>
#include <QCheckBox> #include <QCheckBox>
#include <QComboBox> #include <QComboBox>
#include <QFormLayout> #include <QFormLayout>
#include <QKeySequenceEdit>
#include <QScrollArea>
#include <QSplitter>
#include <QStringListModel> #include <QStringListModel>
#include <QMessageBox>
SettingsDialog::SettingsDialog(QWidget *parent) SettingsDialog::SettingsDialog(QWidget *parent)
: QDialog(parent) : QDialog(parent)
, m_stayOnTop(new QCheckBox) , m_stayOnTop(new QCheckBox)
, m_useBuiltInCloseAnimation(new QCheckBox)
, m_useLightCheckerboard(new QCheckBox)
, m_loopGallery(new QCheckBox)
, m_autoLongImageMode(new QCheckBox)
, m_svgTiny12Only(new QCheckBox)
, m_doubleClickBehavior(new QComboBox) , m_doubleClickBehavior(new QComboBox)
, m_mouseWheelBehavior(new QComboBox) , m_mouseWheelBehavior(new QComboBox)
, m_initWindowSizeBehavior(new QComboBox) , m_initWindowSizeBehavior(new QComboBox)
@@ -21,12 +32,55 @@ SettingsDialog::SettingsDialog(QWidget *parent)
{ {
this->setWindowTitle(tr("Settings")); this->setWindowTitle(tr("Settings"));
QFormLayout * settingsForm = new QFormLayout(this); QHBoxLayout * mainLayout = new QHBoxLayout(this);
QTabWidget * settingsTabs = new QTabWidget(this);
mainLayout->addWidget(settingsTabs);
QWidget * settingsFormHolder = new QWidget;
QFormLayout * settingsForm = new QFormLayout(settingsFormHolder);
settingsTabs->addTab(settingsFormHolder, tr("Options"));
QSplitter * shortcutEditorSplitter = new QSplitter;
shortcutEditorSplitter->setOrientation(Qt::Vertical);
shortcutEditorSplitter->setChildrenCollapsible(false);
QScrollArea * shortcutScrollArea = new QScrollArea;
shortcutEditorSplitter->addWidget(shortcutScrollArea);
shortcutScrollArea->setWidgetResizable(true);
shortcutScrollArea->setMinimumHeight(200);
QWidget * shortcutsFormHolder = new QWidget;
QFormLayout * shortcutsForm = new QFormLayout(shortcutsFormHolder);
shortcutScrollArea->setWidget(shortcutsFormHolder);
settingsTabs->addTab(shortcutEditorSplitter, tr("Shortcuts"));
for (const QAction * action : parent->actions()) {
ShortcutEdit * shortcutEdit = new ShortcutEdit;
shortcutEdit->setObjectName(QLatin1String("shortcut_") + action->objectName());
shortcutEdit->setShortcuts(action->shortcuts());
shortcutsForm->addRow(action->text(), shortcutEdit);
connect(shortcutEdit, &ShortcutEdit::editButtonClicked, this, [=](){
if (shortcutEditorSplitter->count() == 1) shortcutEditorSplitter->addWidget(new QWidget);
ShortcutEditor * shortcutEditor = new ShortcutEditor(shortcutEdit);
shortcutEditor->setDescription(tr("Editing shortcuts for action \"%1\":").arg(action->text()));
QWidget * oldEditor = shortcutEditorSplitter->replaceWidget(1, shortcutEditor);
shortcutEditorSplitter->setSizes({shortcutEditorSplitter->height(), 1});
oldEditor->deleteLater();
});
connect(shortcutEdit, &ShortcutEdit::applyShortcutsRequested, this, [=](QList<QKeySequence> newShortcuts){
bool succ = Settings::instance()->setShortcutsForAction(parent, shortcutEdit->objectName().mid(9),
newShortcuts);
if (!succ) {
QMessageBox::warning(this, tr("Failed to set shortcuts"),
tr("Please check if shortcuts are duplicated with existing shortcuts."));
}
shortcutEdit->setShortcuts(action->shortcuts());
});
}
static QList< QPair<Settings::DoubleClickBehavior, QString> > _dc_options { static QList< QPair<Settings::DoubleClickBehavior, QString> > _dc_options {
{ Settings::DoubleClickBehavior::Ignore, tr("Do nothing") }, { Settings::DoubleClickBehavior::Ignore, tr("Do nothing") },
{ Settings::DoubleClickBehavior::Close, tr("Close the window") }, { Settings::DoubleClickBehavior::Close, tr("Close the window") },
{ Settings::DoubleClickBehavior::Maximize, tr("Toggle maximize") } { Settings::DoubleClickBehavior::Maximize, tr("Toggle maximize") },
{ Settings::DoubleClickBehavior::FullScreen, tr("Toggle fullscreen") }
}; };
static QList< QPair<Settings::MouseWheelBehavior, QString> > _mw_options { static QList< QPair<Settings::MouseWheelBehavior, QString> > _mw_options {
@@ -36,7 +90,8 @@ SettingsDialog::SettingsDialog(QWidget *parent)
static QList< QPair<Settings::WindowSizeBehavior, QString> > _iws_options { static QList< QPair<Settings::WindowSizeBehavior, QString> > _iws_options {
{ Settings::WindowSizeBehavior::Auto, tr("Auto size") }, { Settings::WindowSizeBehavior::Auto, tr("Auto size") },
{ Settings::WindowSizeBehavior::Maximized, tr("Maximized") } { Settings::WindowSizeBehavior::Maximized, tr("Maximized") },
{ Settings::WindowSizeBehavior::Windowed, tr("Windowed") }
}; };
static QList< QPair<Qt::HighDpiScaleFactorRoundingPolicy, QString> > _hidpi_options { static QList< QPair<Qt::HighDpiScaleFactorRoundingPolicy, QString> > _hidpi_options {
@@ -67,12 +122,22 @@ SettingsDialog::SettingsDialog(QWidget *parent)
} }
settingsForm->addRow(tr("Stay on top when start-up"), m_stayOnTop); settingsForm->addRow(tr("Stay on top when start-up"), m_stayOnTop);
settingsForm->addRow(tr("Use built-in close window animation"), m_useBuiltInCloseAnimation);
settingsForm->addRow(tr("Use light-color checkerboard"), m_useLightCheckerboard);
settingsForm->addRow(tr("Loop the loaded gallery"), m_loopGallery);
settingsForm->addRow(tr("Auto long image mode"), m_autoLongImageMode);
settingsForm->addRow(tr("Limit SVG support to SVG Tiny 1.2"), m_svgTiny12Only);
settingsForm->addRow(tr("Double-click behavior"), m_doubleClickBehavior); settingsForm->addRow(tr("Double-click behavior"), m_doubleClickBehavior);
settingsForm->addRow(tr("Mouse wheel behavior"), m_mouseWheelBehavior); settingsForm->addRow(tr("Mouse wheel behavior"), m_mouseWheelBehavior);
settingsForm->addRow(tr("Default window size"), m_initWindowSizeBehavior); settingsForm->addRow(tr("Default window size"), m_initWindowSizeBehavior);
settingsForm->addRow(tr("HiDPI scale factor rounding policy"), m_hiDpiRoundingPolicyBehavior); settingsForm->addRow(tr("HiDPI scale factor rounding policy"), m_hiDpiRoundingPolicyBehavior);
m_stayOnTop->setChecked(Settings::instance()->stayOnTop()); m_stayOnTop->setChecked(Settings::instance()->stayOnTop());
m_useBuiltInCloseAnimation->setChecked(Settings::instance()->useBuiltInCloseAnimation());
m_useLightCheckerboard->setChecked(Settings::instance()->useLightCheckerboard());
m_loopGallery->setChecked(Settings::instance()->loopGallery());
m_autoLongImageMode->setChecked(Settings::instance()->autoLongImageMode());
m_svgTiny12Only->setChecked(Settings::instance()->svgTiny12Only());
m_doubleClickBehavior->setModel(new QStringListModel(dcbDropDown)); m_doubleClickBehavior->setModel(new QStringListModel(dcbDropDown));
Settings::DoubleClickBehavior dcb = Settings::instance()->doubleClickBehavior(); Settings::DoubleClickBehavior dcb = Settings::instance()->doubleClickBehavior();
m_doubleClickBehavior->setCurrentIndex(static_cast<int>(dcb)); m_doubleClickBehavior->setCurrentIndex(static_cast<int>(dcb));
@@ -91,10 +156,38 @@ SettingsDialog::SettingsDialog(QWidget *parent)
} }
} }
connect(m_stayOnTop, &QCheckBox::stateChanged, this, [ = ](int state){ #if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
# define QCHECKBOX_CHECKSTATECHANGED QCheckBox::checkStateChanged
# define QT_CHECKSTATE Qt::CheckState
#else
# define QCHECKBOX_CHECKSTATECHANGED QCheckBox::stateChanged
# define QT_CHECKSTATE int
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
connect(m_stayOnTop, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
Settings::instance()->setStayOnTop(state == Qt::Checked); Settings::instance()->setStayOnTop(state == Qt::Checked);
}); });
connect(m_useBuiltInCloseAnimation, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
Settings::instance()->setUseBuiltInCloseAnimation(state == Qt::Checked);
});
connect(m_useLightCheckerboard, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
Settings::instance()->setUseLightCheckerboard(state == Qt::Checked);
});
connect(m_loopGallery, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
Settings::instance()->setLoopGallery(state == Qt::Checked);
});
connect(m_autoLongImageMode, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
Settings::instance()->setAutoLongImageMode(state == Qt::Checked);
});
connect(m_svgTiny12Only, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
Settings::instance()->setSvgTiny12Only(state == Qt::Checked);
});
connect(m_doubleClickBehavior, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [ = ](int index){ connect(m_doubleClickBehavior, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [ = ](int index){
Settings::instance()->setDoubleClickBehavior(_dc_options.at(index).first); Settings::instance()->setDoubleClickBehavior(_dc_options.at(index).first);
}); });

View File

@@ -23,6 +23,11 @@ public slots:
private: private:
QCheckBox * m_stayOnTop = nullptr; QCheckBox * m_stayOnTop = nullptr;
QCheckBox * m_useBuiltInCloseAnimation = nullptr;
QCheckBox * m_useLightCheckerboard = nullptr;
QCheckBox * m_loopGallery = nullptr;
QCheckBox * m_autoLongImageMode = nullptr;
QCheckBox * m_svgTiny12Only = nullptr;
QComboBox * m_doubleClickBehavior = nullptr; QComboBox * m_doubleClickBehavior = nullptr;
QComboBox * m_mouseWheelBehavior = nullptr; QComboBox * m_mouseWheelBehavior = nullptr;
QComboBox * m_initWindowSizeBehavior = nullptr; QComboBox * m_initWindowSizeBehavior = nullptr;

126
app/shortcutedit.cpp Normal file
View File

@@ -0,0 +1,126 @@
// SPDX-FileCopyrightText: 2024 Gary Wang <opensource@blumia.net>
//
// SPDX-License-Identifier: MIT
#include "shortcutedit.h"
#include <QLabel>
#include <QToolButton>
#include <QHBoxLayout>
#include <QFormLayout>
#include <QDialogButtonBox>
#include <QKeySequenceEdit>
ShortcutEditor::ShortcutEditor(ShortcutEdit * shortcutEdit, QWidget * parent)
: QWidget(parent)
, m_descriptionLabel(new QLabel)
, m_shortcutEdit(shortcutEdit)
, m_shortcutLayout(new QFormLayout)
{
Q_CHECK_PTR(m_shortcutEdit);
QDialogButtonBox * buttons = new QDialogButtonBox(QDialogButtonBox::Apply | QDialogButtonBox::Discard);
QVBoxLayout * layout = new QVBoxLayout(this);
layout->addWidget(m_descriptionLabel);
layout->addLayout(m_shortcutLayout);
layout->addWidget(buttons);
connect(buttons, &QDialogButtonBox::clicked, this, [=](QAbstractButton *button){
if ((QPushButton *)button == buttons->button(QDialogButtonBox::Apply)) {
applyShortcuts();
} else {
reloadShortcuts();
}
});
connect(shortcutEdit, &ShortcutEdit::shortcutsChanged, this, &ShortcutEditor::reloadShortcuts);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
reloadShortcuts();
}
void ShortcutEditor::setDescription(const QString &desc)
{
m_descriptionLabel->setText(desc);
}
void ShortcutEditor::reloadShortcuts()
{
if (!m_keySequenceEdits.isEmpty()) {
for (QKeySequenceEdit * keyseqEdit : m_keySequenceEdits) {
m_shortcutLayout->removeRow(keyseqEdit);
}
m_keySequenceEdits.clear();
}
QList<QKeySequence> shortcuts = m_shortcutEdit->shortcuts();
shortcuts.append(QKeySequence());
for (const QKeySequence & shortcut : shortcuts) {
QKeySequenceEdit * keyseqEdit = new QKeySequenceEdit(this);
keyseqEdit->setClearButtonEnabled(true);
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
keyseqEdit->setMaximumSequenceLength(1);
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
keyseqEdit->setKeySequence(shortcut);
m_keySequenceEdits.append(keyseqEdit);
}
for (int i = 0; i < m_keySequenceEdits.count(); i++) {
m_shortcutLayout->addRow(tr("Shortcut #%1").arg(i + 1), m_keySequenceEdits.at(i));
}
}
void ShortcutEditor::applyShortcuts()
{
QList<QKeySequence> shortcuts;
for (const QKeySequenceEdit * keyseqEdit : m_keySequenceEdits) {
if (!keyseqEdit->keySequence().isEmpty() && !shortcuts.contains(keyseqEdit->keySequence())) {
shortcuts.append(keyseqEdit->keySequence());
}
}
emit m_shortcutEdit->applyShortcutsRequested(shortcuts);
}
// ----------------------------------------
ShortcutEdit::ShortcutEdit(QWidget *parent)
: QWidget(parent)
, m_shortcutsLabel(new QLabel(this))
, m_setShortcutButton(new QToolButton(this))
{
m_setShortcutButton->setText("...");
QHBoxLayout * layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_shortcutsLabel, 1);
layout->addWidget(m_setShortcutButton);
connect(this, &ShortcutEdit::shortcutsChanged, this, [=](){
QStringList shortcutTexts;
for (const QKeySequence & shortcut : std::as_const(m_shortcuts)) {
shortcutTexts.append(shortcut.toString(QKeySequence::NativeText));
}
m_shortcutsLabel->setText(shortcutTexts.isEmpty() ? tr("No shortcuts") : shortcutTexts.join(", "));
m_shortcutsLabel->setDisabled(shortcutTexts.isEmpty());
});
connect(m_setShortcutButton, &QToolButton::clicked, this, &ShortcutEdit::editButtonClicked);
adjustSize();
}
ShortcutEdit::~ShortcutEdit()
{
}
QList<QKeySequence> ShortcutEdit::shortcuts() const
{
return m_shortcuts;
}
void ShortcutEdit::setShortcuts(const QList<QKeySequence> &shortcuts)
{
m_shortcuts = shortcuts;
emit shortcutsChanged();
}

55
app/shortcutedit.h Normal file
View File

@@ -0,0 +1,55 @@
// SPDX-FileCopyrightText: 2024 Gary Wang <opensource@blumia.net>
//
// SPDX-License-Identifier: MIT
#pragma once
#include <QWidget>
#include <QList>
#include <QKeySequence>
class QLabel;
class QFormLayout;
class QToolButton;
class QKeySequenceEdit;
class ShortcutEdit;
class ShortcutEditor : public QWidget
{
Q_OBJECT
public:
explicit ShortcutEditor(ShortcutEdit * shortcutEdit, QWidget * parent = nullptr);
~ShortcutEditor() = default;
void setDescription(const QString & desc);
void reloadShortcuts();
void applyShortcuts();
private:
QLabel * m_descriptionLabel;
ShortcutEdit * m_shortcutEdit;
QFormLayout * m_shortcutLayout;
QList<QKeySequenceEdit *> m_keySequenceEdits;
};
class ShortcutEdit : public QWidget
{
Q_OBJECT
Q_PROPERTY(QList<QKeySequence> shortcuts MEMBER m_shortcuts WRITE setShortcuts NOTIFY shortcutsChanged)
public:
explicit ShortcutEdit(QWidget * parent = nullptr);
~ShortcutEdit();
QList<QKeySequence> shortcuts() const;
void setShortcuts(const QList<QKeySequence> &shortcuts);
signals:
void shortcutsChanged();
void editButtonClicked();
void applyShortcutsRequested(QList<QKeySequence> newShortcuts);
private:
QList<QKeySequence> m_shortcuts;
QLabel * m_shortcutsLabel;
QToolButton * m_setShortcutButton;
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4,169 +4,169 @@
<context> <context>
<name>AboutDialog</name> <name>AboutDialog</name>
<message> <message>
<location filename="../aboutdialog.cpp" line="27"/> <location filename="../aboutdialog.cpp" line="29"/>
<source>About</source> <source>About</source>
<translation>بارے</translation> <translation>بارے</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="30"/> <location filename="../aboutdialog.cpp" line="32"/>
<source>Launch application with image file path as argument to load the file.</source> <source>Launch application with image file path as argument to load the file.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="31"/> <location filename="../aboutdialog.cpp" line="33"/>
<source>Drag and drop image file onto the window is also supported.</source> <source>Drag and drop image file onto the window is also supported.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="32"/> <location filename="../aboutdialog.cpp" line="34"/>
<source>None of the operations in this application will alter the pictures on disk.</source> <source>None of the operations in this application will alter the pictures on disk.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="33"/> <location filename="../aboutdialog.cpp" line="35"/>
<source>Context menu option explanation:</source> <source>Context menu option explanation:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="40"/> <location filename="../aboutdialog.cpp" line="42"/>
<source>Make window stay on top of all other windows.</source> <source>Make window stay on top of all other windows.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="43"/> <location filename="../aboutdialog.cpp" line="45"/>
<source>Avoid close window accidentally. (eg. by double clicking the window)</source> <source>Avoid close window accidentally. (eg. by double clicking the window)</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="46"/> <location filename="../aboutdialog.cpp" line="48"/>
<source>Avoid resetting the zoom/rotation/flip state that was applied to the image view when switching between images.</source> <source>Avoid resetting the zoom/rotation/flip state that was applied to the image view when switching between images.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="54"/> <location filename="../aboutdialog.cpp" line="55"/>
<source>Version: %1</source> <source>Version: %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="60"/> <location filename="../aboutdialog.cpp" line="66"/>
<source>Logo designed by %1</source> <source>Logo designed by %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="62"/> <location filename="../aboutdialog.cpp" line="68"/>
<source>Built with Qt %1 (%2)</source> <source>Built with Qt %1 (%2)</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="63"/> <location filename="../aboutdialog.cpp" line="69"/>
<source>Source code</source> <source>Source code</source>
<translation>سروت دا کوڈ</translation> <translation>سروت دا کوڈ</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="73"/> <location filename="../aboutdialog.cpp" line="79"/>
<source>Contributors</source> <source>Contributors</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="75"/> <location filename="../aboutdialog.cpp" line="81"/>
<source>List of contributors on GitHub</source> <source>List of contributors on GitHub</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="76"/> <location filename="../aboutdialog.cpp" line="82"/>
<source>Thanks to all people who contributed to this project.</source> <source>Thanks to all people who contributed to this project.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="80"/> <location filename="../aboutdialog.cpp" line="86"/>
<source>Translators</source> <source>Translators</source>
<translation>ترجمے والے</translation> <translation>ترجمے والے</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="81"/> <location filename="../aboutdialog.cpp" line="87"/>
<source>I would like to thank the following people who volunteered to translate this application.</source> <source>I would like to thank the following people who volunteered to translate this application.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="125"/> <location filename="../aboutdialog.cpp" line="131"/>
<source>%1 is built on the following free software libraries:</source> <source>%1 is built on the following free software libraries:</source>
<comment>Free as in freedom</comment> <comment>Free as in freedom</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="149"/> <location filename="../aboutdialog.cpp" line="155"/>
<source>&amp;Special Thanks</source> <source>&amp;Special Thanks</source>
<translation>شکریئے</translation> <translation>شکریئے</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="151"/> <location filename="../aboutdialog.cpp" line="157"/>
<source>&amp;Third-party Libraries</source> <source>&amp;Third-party Libraries</source>
<translation>تیجی پارٹی سوفٹویر</translation> <translation>تیجی پارٹی سوفٹویر</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="87"/> <location filename="../aboutdialog.cpp" line="93"/>
<source>Your Rights</source> <source>Your Rights</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="57"/> <location filename="../aboutdialog.cpp" line="63"/>
<source>Copyright (c) %1 %2</source> <source>Copyright (c) %1 %2</source>
<comment>%1 is year, %2 is the name of copyright holder(s)</comment> <comment>%1 is year, %2 is the name of copyright holder(s)</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="89"/> <location filename="../aboutdialog.cpp" line="95"/>
<source>%1 is released under the MIT License.</source> <source>%1 is released under the MIT License.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="90"/> <location filename="../aboutdialog.cpp" line="96"/>
<source>This license grants people a number of freedoms:</source> <source>This license grants people a number of freedoms:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="91"/> <location filename="../aboutdialog.cpp" line="97"/>
<source>You are free to use %1, for any purpose</source> <source>You are free to use %1, for any purpose</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="92"/> <location filename="../aboutdialog.cpp" line="98"/>
<source>You are free to distribute %1</source> <source>You are free to distribute %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="93"/> <location filename="../aboutdialog.cpp" line="99"/>
<source>You can study how %1 works and change it</source> <source>You can study how %1 works and change it</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="94"/> <location filename="../aboutdialog.cpp" line="100"/>
<source>You can distribute changed versions of %1</source> <source>You can distribute changed versions of %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="96"/> <location filename="../aboutdialog.cpp" line="102"/>
<source>The MIT license guarantees you this freedom. Nobody is ever permitted to take it away.</source> <source>The MIT license guarantees you this freedom. Nobody is ever permitted to take it away.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="124"/> <location filename="../aboutdialog.cpp" line="130"/>
<source>Third-party Libraries used by %1</source> <source>Third-party Libraries used by %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="147"/> <location filename="../aboutdialog.cpp" line="153"/>
<source>&amp;Help</source> <source>&amp;Help</source>
<translation>مدد</translation> <translation>مدد</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="148"/> <location filename="../aboutdialog.cpp" line="154"/>
<source>&amp;About</source> <source>&amp;About</source>
<translation>بارے</translation> <translation>بارے</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="150"/> <location filename="../aboutdialog.cpp" line="156"/>
<source>&amp;License</source> <source>&amp;License</source>
<translation>لائیسنس</translation> <translation>لائیسنس</translation>
</message> </message>
@@ -174,8 +174,8 @@
<context> <context>
<name>GraphicsScene</name> <name>GraphicsScene</name>
<message> <message>
<location filename="../graphicsscene.cpp" line="89"/> <location filename="../mainwindow.cpp" line="292"/>
<location filename="../mainwindow.cpp" line="296"/> <location filename="../graphicsscene.cpp" line="102"/>
<source>Drag image here</source> <source>Drag image here</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@@ -183,51 +183,58 @@
<context> <context>
<name>GraphicsView</name> <name>GraphicsView</name>
<message> <message>
<location filename="../graphicsview.cpp" line="351"/> <location filename="../graphicsview.cpp" line="51"/>
<source>File url list is empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphicsview.cpp" line="52"/>
<source>File is not a valid image</source> <source>File is not a valid image</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../graphicsview.cpp" line="57"/> <location filename="../graphicsview.cpp" line="55"/>
<location filename="../graphicsview.cpp" line="62"/> <location filename="../graphicsview.cpp" line="60"/>
<location filename="../graphicsview.cpp" line="71"/>
<source>Image data is invalid or currently unsupported</source> <source>Image data is invalid or currently unsupported</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="../graphicsview.cpp" line="359"/>
<source>Image data is invalid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../graphicsview.cpp" line="366"/>
<source>Not supported mimedata: %1</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="../mainwindow.cpp" line="191"/> <location filename="../mainwindow.cpp" line="190"/>
<location filename="../mainwindow.cpp" line="561"/>
<source>File url list is empty</source> <source>File url list is empty</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="448"/> <location filename="../mainwindow.cpp" line="461"/>
<source>&amp;Copy</source> <source>&amp;Copy</source>
<translation>کاپی کرو</translation> <translation>کاپی کرو</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="737"/> <location filename="../mainwindow.cpp" line="569"/>
<source>Image data is invalid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="576"/>
<source>Not supported mimedata: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="783"/>
<source>Image From Clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="801"/>
<source>Are you sure you want to move &quot;%1&quot; to recycle bin?</source> <source>Are you sure you want to move &quot;%1&quot; to recycle bin?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="742"/> <location filename="../mainwindow.cpp" line="805"/>
<source>Failed to move file to trash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="806"/>
<source>Move to trash failed, it might caused by file permission issue, file system limitation, or platform limitation.</source> <source>Move to trash failed, it might caused by file permission issue, file system limitation, or platform limitation.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@@ -247,82 +254,112 @@
<translation>وشیشتاواں</translation> <translation>وشیشتاواں</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="39"/>
<location filename="../actionmanager.cpp" line="110"/> <location filename="../actionmanager.cpp" line="110"/>
<location filename="../aboutdialog.cpp" line="41"/>
<source>Stay on top</source> <source>Stay on top</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="42"/>
<location filename="../actionmanager.cpp" line="111"/> <location filename="../actionmanager.cpp" line="111"/>
<location filename="../aboutdialog.cpp" line="44"/>
<source>Protected mode</source> <source>Protected mode</source>
<translation>سرکھیات سیٹنگ</translation> <translation>سرکھیات سیٹنگ</translation>
</message> </message>
<message> <message>
<location filename="../aboutdialog.cpp" line="45"/>
<location filename="../actionmanager.cpp" line="112"/> <location filename="../actionmanager.cpp" line="112"/>
<location filename="../aboutdialog.cpp" line="47"/>
<source>Keep transformation</source> <source>Keep transformation</source>
<comment>The &apos;transformation&apos; means the flip/rotation status that currently applied to the image view</comment> <comment>The &apos;transformation&apos; means the flip/rotation status that currently applied to the image view</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="95"/> <location filename="../actionmanager.cpp" line="90"/>
<source>Zoom in</source> <source>Zoom in</source>
<translation>وڈا کرو</translation> <translation>وڈا کرو</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="96"/> <location filename="../actionmanager.cpp" line="91"/>
<source>Zoom out</source> <source>Zoom out</source>
<translation>چھوٹا کرو</translation> <translation>چھوٹا کرو</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="103"/> <location filename="../actionmanager.cpp" line="99"/>
<source>Pause/Resume Animation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="100"/>
<source>Animation Go to Next Frame</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="102"/>
<source>Flip &amp;Horizontally</source> <source>Flip &amp;Horizontally</source>
<translation>لیٹویں اُلٹاؤ</translation> <translation>لیٹویں اُلٹاؤ</translation>
</message> </message>
<message>
<location filename="../actionmanager.cpp" line="103"/>
<source>Fit to view</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="104"/>
<source>Fit to width</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="105"/>
<source>Fit long image</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<location filename="../actionmanager.cpp" line="108"/> <location filename="../actionmanager.cpp" line="108"/>
<source>&amp;Paste</source> <source>&amp;Paste</source>
<translation>پیسٹ کرو</translation> <translation>پیسٹ کرو</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="97"/> <location filename="../actionmanager.cpp" line="92"/>
<source>Toggle Checkerboard</source> <source>Toggle Checkerboard</source>
<translation>چیکبورڈ چالو بدلو</translation> <translation>چیکبورڈ چالو بدلو</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="91"/> <location filename="../actionmanager.cpp" line="86"/>
<source>&amp;Open...</source> <source>&amp;Open...</source>
<translation>کھُلھو</translation> <translation>کھُلھو</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="93"/> <location filename="../actionmanager.cpp" line="88"/>
<source>Actual size</source> <source>Actual size</source>
<translation>اصلی اکار</translation> <translation>اصلی اکار</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="94"/> <location filename="../actionmanager.cpp" line="89"/>
<source>Toggle maximize</source> <source>Toggle maximize</source>
<translation>ودھو ودھ بدلو</translation> <translation>ودھو ودھ بدلو</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="98"/> <location filename="../actionmanager.cpp" line="93"/>
<source>Rotate right</source> <source>Rotate right</source>
<translation>سجے گھنماؤ</translation> <translation>سجے گھنماؤ</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="100"/> <location filename="../actionmanager.cpp" line="94"/>
<source>Rotate left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="96"/>
<source>Previous image</source> <source>Previous image</source>
<translation>پچھلی تصویر</translation> <translation>پچھلی تصویر</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="101"/> <location filename="../actionmanager.cpp" line="97"/>
<source>Next image</source> <source>Next image</source>
<translation>اگلی تصویر</translation> <translation>اگلی تصویر</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="800"/>
<location filename="../actionmanager.cpp" line="109"/> <location filename="../actionmanager.cpp" line="109"/>
<location filename="../mainwindow.cpp" line="736"/>
<source>Move to Trash</source> <source>Move to Trash</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@@ -364,314 +401,314 @@
<context> <context>
<name>MetadataModel</name> <name>MetadataModel</name>
<message> <message>
<location filename="../metadatamodel.cpp" line="41"/> <location filename="../metadatamodel.cpp" line="43"/>
<source>Origin</source> <source>Origin</source>
<comment>Section name.</comment> <comment>Section name.</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="42"/> <location filename="../metadatamodel.cpp" line="44"/>
<source>Image</source> <source>Image</source>
<comment>Section name.</comment> <comment>Section name.</comment>
<translation>تصویر</translation> <translation>تصویر</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="46"/> <location filename="../metadatamodel.cpp" line="48"/>
<source>File</source> <source>File</source>
<comment>Section name.</comment> <comment>Section name.</comment>
<translation>فائل</translation> <translation>فائل</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="43"/> <location filename="../metadatamodel.cpp" line="45"/>
<source>Camera</source> <source>Camera</source>
<comment>Section name.</comment> <comment>Section name.</comment>
<translation>کیمرہ</translation> <translation>کیمرہ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="33"/> <location filename="../metadatamodel.cpp" line="35"/>
<source>%1 File</source> <source>%1 File</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="40"/> <location filename="../metadatamodel.cpp" line="42"/>
<source>Description</source> <source>Description</source>
<comment>Section name.</comment> <comment>Section name.</comment>
<translation>تفصیل</translation> <translation>تفصیل</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="44"/> <location filename="../metadatamodel.cpp" line="46"/>
<source>Advanced photo</source> <source>Advanced photo</source>
<comment>Section name.</comment> <comment>Section name.</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="45"/> <location filename="../metadatamodel.cpp" line="47"/>
<source>GPS</source> <source>GPS</source>
<comment>Section name.</comment> <comment>Section name.</comment>
<translation>گیپیایس</translation> <translation>گیپیایس</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="50"/> <location filename="../metadatamodel.cpp" line="52"/>
<source>Dimensions</source> <source>Dimensions</source>
<translation>ماپ</translation> <translation>ماپ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="52"/> <location filename="../metadatamodel.cpp" line="54"/>
<source>Aspect ratio</source> <source>Aspect ratio</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="56"/> <location filename="../metadatamodel.cpp" line="58"/>
<source>Frame count</source> <source>Frame count</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="60"/> <location filename="../metadatamodel.cpp" line="62"/>
<source>Name</source> <source>Name</source>
<translation>ناں</translation> <translation>ناں</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="62"/> <location filename="../metadatamodel.cpp" line="64"/>
<source>Item type</source> <source>Item type</source>
<translation>قسم</translation> <translation>قسم</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="64"/> <location filename="../metadatamodel.cpp" line="66"/>
<source>Folder path</source> <source>Folder path</source>
<translation>فولڈر پاتھ</translation> <translation>فولڈر پاتھ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="66"/> <location filename="../metadatamodel.cpp" line="68"/>
<source>Size</source> <source>Size</source>
<translation>اکار</translation> <translation>اکار</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="68"/> <location filename="../metadatamodel.cpp" line="70"/>
<source>Date created</source> <source>Date created</source>
<translation>بݨاوݨ دی تریخ</translation> <translation>بݨاوݨ دی تریخ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="70"/> <location filename="../metadatamodel.cpp" line="72"/>
<source>Date modified</source> <source>Date modified</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="77"/> <location filename="../metadatamodel.cpp" line="79"/>
<source>Title</source> <source>Title</source>
<translation>سرلیکھ</translation> <translation>سرلیکھ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="79"/> <location filename="../metadatamodel.cpp" line="81"/>
<source>Subject</source> <source>Subject</source>
<translation>وِشا</translation> <translation>وِشا</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="81"/> <location filename="../metadatamodel.cpp" line="83"/>
<source>Rating</source> <source>Rating</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="83"/> <location filename="../metadatamodel.cpp" line="85"/>
<source>Tags</source> <source>Tags</source>
<translation>ٹیگ</translation> <translation>ٹیگ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="85"/> <location filename="../metadatamodel.cpp" line="87"/>
<source>Comments</source> <source>Comments</source>
<translation>ٹپݨیاں</translation> <translation>ٹپݨیاں</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="88"/> <location filename="../metadatamodel.cpp" line="90"/>
<source>Authors</source> <source>Authors</source>
<translation>لیکھک</translation> <translation>لیکھک</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="90"/> <location filename="../metadatamodel.cpp" line="92"/>
<source>Date taken</source> <source>Date taken</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="96"/> <location filename="../metadatamodel.cpp" line="98"/>
<source>Program name</source> <source>Program name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="98"/> <location filename="../metadatamodel.cpp" line="100"/>
<source>Copyright</source> <source>Copyright</source>
<translation>لائیسنس</translation> <translation>لائیسنس</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="101"/> <location filename="../metadatamodel.cpp" line="103"/>
<source>Horizontal resolution</source> <source>Horizontal resolution</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="103"/> <location filename="../metadatamodel.cpp" line="105"/>
<source>Vertical resolution</source> <source>Vertical resolution</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="105"/> <location filename="../metadatamodel.cpp" line="107"/>
<source>Resolution unit</source> <source>Resolution unit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="107"/> <location filename="../metadatamodel.cpp" line="109"/>
<source>Colour representation</source> <source>Colour representation</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="110"/> <location filename="../metadatamodel.cpp" line="112"/>
<source>Camera maker</source> <source>Camera maker</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="112"/> <location filename="../metadatamodel.cpp" line="114"/>
<source>Camera model</source> <source>Camera model</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="114"/> <location filename="../metadatamodel.cpp" line="116"/>
<source>F-stop</source> <source>F-stop</source>
<translation>ایف سٹاپ</translation> <translation>ایف سٹاپ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="116"/> <location filename="../metadatamodel.cpp" line="118"/>
<source>Exposure time</source> <source>Exposure time</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="118"/> <location filename="../metadatamodel.cpp" line="120"/>
<source>ISO speed</source> <source>ISO speed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="120"/> <location filename="../metadatamodel.cpp" line="122"/>
<source>Exposure bias</source> <source>Exposure bias</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="122"/> <location filename="../metadatamodel.cpp" line="124"/>
<source>Focal length</source> <source>Focal length</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="124"/> <location filename="../metadatamodel.cpp" line="126"/>
<source>Max aperture</source> <source>Max aperture</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="126"/> <location filename="../metadatamodel.cpp" line="128"/>
<source>Metering mode</source> <source>Metering mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="128"/> <location filename="../metadatamodel.cpp" line="130"/>
<source>Subject distance</source> <source>Subject distance</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="130"/> <location filename="../metadatamodel.cpp" line="132"/>
<source>Flash mode</source> <source>Flash mode</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="132"/> <location filename="../metadatamodel.cpp" line="134"/>
<source>35mm focal length</source> <source>35mm focal length</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="135"/> <location filename="../metadatamodel.cpp" line="137"/>
<source>Lens model</source> <source>Lens model</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="137"/> <location filename="../metadatamodel.cpp" line="139"/>
<source>Contrast</source> <source>Contrast</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="139"/> <location filename="../metadatamodel.cpp" line="141"/>
<source>Brightness</source> <source>Brightness</source>
<translation>چمک</translation> <translation>چمک</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="141"/> <location filename="../metadatamodel.cpp" line="143"/>
<source>Exposure program</source> <source>Exposure program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="143"/> <location filename="../metadatamodel.cpp" line="145"/>
<source>Saturation</source> <source>Saturation</source>
<translation>سنترپتہ</translation> <translation>سنترپتہ</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="145"/> <location filename="../metadatamodel.cpp" line="147"/>
<source>Sharpness</source> <source>Sharpness</source>
<translation>تکھاپن</translation> <translation>تکھاپن</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="147"/> <location filename="../metadatamodel.cpp" line="149"/>
<source>White balance</source> <source>White balance</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="149"/> <location filename="../metadatamodel.cpp" line="151"/>
<source>Digital zoom</source> <source>Digital zoom</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="151"/> <location filename="../metadatamodel.cpp" line="153"/>
<source>EXIF version</source> <source>EXIF version</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="154"/> <location filename="../metadatamodel.cpp" line="156"/>
<source>Latitude reference</source> <source>Latitude reference</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="156"/> <location filename="../metadatamodel.cpp" line="158"/>
<source>Latitude</source> <source>Latitude</source>
<translation>اکشانش</translation> <translation>اکشانش</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="158"/> <location filename="../metadatamodel.cpp" line="160"/>
<source>Longitude reference</source> <source>Longitude reference</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="160"/> <location filename="../metadatamodel.cpp" line="162"/>
<source>Longitude</source> <source>Longitude</source>
<translation>لمبکار</translation> <translation>لمبکار</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="162"/> <location filename="../metadatamodel.cpp" line="164"/>
<source>Altitude reference</source> <source>Altitude reference</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="164"/> <location filename="../metadatamodel.cpp" line="166"/>
<source>Altitude</source> <source>Altitude</source>
<translation>اُچائی</translation> <translation>اُچائی</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="174"/> <location filename="../metadatamodel.cpp" line="176"/>
<source>%1 x %2</source> <source>%1 x %2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="192"/> <location filename="../metadatamodel.cpp" line="194"/>
<source>%1 : %2</source> <source>%1 : %2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="317"/> <location filename="../metadatamodel.cpp" line="319"/>
<source>Property</source> <source>Property</source>
<translation>وشیشتا</translation> <translation>وشیشتا</translation>
</message> </message>
<message> <message>
<location filename="../metadatamodel.cpp" line="317"/> <location filename="../metadatamodel.cpp" line="319"/>
<source>Value</source> <source>Value</source>
<translation>مُل</translation> <translation>مُل</translation>
</message> </message>
@@ -679,104 +716,185 @@
<context> <context>
<name>SettingsDialog</name> <name>SettingsDialog</name>
<message> <message>
<location filename="../settingsdialog.cpp" line="22"/> <location filename="../settingsdialog.cpp" line="33"/>
<source>Settings</source> <source>Settings</source>
<translation>سیٹنگاں</translation> <translation>سیٹنگاں</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="27"/> <location filename="../settingsdialog.cpp" line="41"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="53"/>
<source>Shortcuts</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="63"/>
<source>Editing shortcuts for action &quot;%1&quot;:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="72"/>
<source>Failed to set shortcuts</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="73"/>
<source>Please check if shortcuts are duplicated with existing shortcuts.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="80"/>
<source>Do nothing</source> <source>Do nothing</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="28"/> <location filename="../settingsdialog.cpp" line="81"/>
<source>Close the window</source> <source>Close the window</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="29"/> <location filename="../settingsdialog.cpp" line="82"/>
<source>Toggle maximize</source> <source>Toggle maximize</source>
<translation type="unfinished">ودھو ودھ بدلو</translation> <translation type="unfinished">ودھو ودھ بدلو</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="33"/> <location filename="../settingsdialog.cpp" line="83"/>
<source>Toggle fullscreen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="87"/>
<source>Zoom in and out</source> <source>Zoom in and out</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="34"/> <location filename="../settingsdialog.cpp" line="88"/>
<source>View next or previous item</source> <source>View next or previous item</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="38"/> <location filename="../settingsdialog.cpp" line="92"/>
<source>Auto size</source> <source>Auto size</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="39"/> <location filename="../settingsdialog.cpp" line="93"/>
<source>Maximized</source> <source>Maximized</source>
<translation>ودھ توں ودھ</translation> <translation>ودھ توں ودھ</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="43"/> <location filename="../settingsdialog.cpp" line="94"/>
<source>Windowed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="98"/>
<source>Round (Integer scaling)</source> <source>Round (Integer scaling)</source>
<comment>This option means round up for .5 and above</comment> <comment>This option means round up for .5 and above</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="44"/> <location filename="../settingsdialog.cpp" line="99"/>
<source>Ceil (Integer scaling)</source> <source>Ceil (Integer scaling)</source>
<comment>This option means always round up</comment> <comment>This option means always round up</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="45"/> <location filename="../settingsdialog.cpp" line="100"/>
<source>Floor (Integer scaling)</source> <source>Floor (Integer scaling)</source>
<comment>This option means always round down</comment> <comment>This option means always round down</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="46"/> <location filename="../settingsdialog.cpp" line="101"/>
<source>Follow system (Fractional scaling)</source> <source>Follow system (Fractional scaling)</source>
<comment>This option means don&apos;t round</comment> <comment>This option means don&apos;t round</comment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="69"/> <location filename="../settingsdialog.cpp" line="124"/>
<source>Stay on top when start-up</source> <source>Stay on top when start-up</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="70"/> <location filename="../settingsdialog.cpp" line="125"/>
<source>Use built-in close window animation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="126"/>
<source>Use light-color checkerboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="127"/>
<source>Loop the loaded gallery</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="128"/>
<source>Auto long image mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="129"/>
<source>Limit SVG support to SVG Tiny 1.2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="130"/>
<source>Double-click behavior</source> <source>Double-click behavior</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="71"/> <location filename="../settingsdialog.cpp" line="131"/>
<source>Mouse wheel behavior</source> <source>Mouse wheel behavior</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="72"/> <location filename="../settingsdialog.cpp" line="132"/>
<source>Default window size</source> <source>Default window size</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="73"/> <location filename="../settingsdialog.cpp" line="133"/>
<source>HiDPI scale factor rounding policy</source> <source>HiDPI scale factor rounding policy</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>ShortcutEdit</name>
<message>
<location filename="../shortcutedit.cpp" line="104"/>
<source>No shortcuts</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShortcutEditor</name>
<message>
<location filename="../shortcutedit.cpp" line="70"/>
<source>Shortcut #%1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>main</name> <name>main</name>
<message> <message>
<location filename="../main.cpp" line="41"/> <location filename="../main.cpp" line="42"/>
<source>Pineapple Pictures</source> <source>Pineapple Pictures</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../main.cpp" line="45"/> <location filename="../main.cpp" line="45"/>
<source>List supported image format suffixes, and quit program.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main.cpp" line="49"/>
<source>File list.</source> <source>File list.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,902 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ta">
<context>
<name>AboutDialog</name>
<message>
<location filename="../aboutdialog.cpp" line="29"/>
<source>About</source>
<translation>ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="32"/>
<source>Launch application with image file path as argument to load the file.</source>
<translation> .</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="33"/>
<source>Drag and drop image file onto the window is also supported.</source>
<translation> ி ி.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="34"/>
<source>None of the operations in this application will alter the pictures on disk.</source>
<translation> ி ி .</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="35"/>
<source>Context menu option explanation:</source>
<translation> ி ி ி:</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="42"/>
<source>Make window stay on top of all other windows.</source>
<translation> .</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="45"/>
<source>Avoid close window accidentally. (eg. by double clicking the window)</source>
<translation> ி. (.. )</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="48"/>
<source>Avoid resetting the zoom/rotation/flip state that was applied to the image view when switching between images.</source>
<translation> ி ி /ி/ிி ி ி.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="55"/>
<source>Version: %1</source>
<translation>ி: %1</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="66"/>
<source>Logo designed by %1</source>
<translation> %1 ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="68"/>
<source>Built with Qt %1 (%2)</source>
<translation>ிி %1 ( %2) </translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="69"/>
<source>Source code</source>
<translation> ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="79"/>
<source>Contributors</source>
<translation>ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="81"/>
<source>List of contributors on GitHub</source>
<translation>ிி ிி ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="82"/>
<source>Thanks to all people who contributed to this project.</source>
<translation> ிி ி ி.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="86"/>
<source>Translators</source>
<translation>ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="87"/>
<source>I would like to thank the following people who volunteered to translate this application.</source>
<translation> ி ி ி ி ிி ிி.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="131"/>
<source>%1 is built on the following free software libraries:</source>
<comment>Free as in freedom</comment>
<translation>%1 ி ி :</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="155"/>
<source>&amp;Special Thanks</source>
<translation>&amp; ி ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="157"/>
<source>&amp;Third-party Libraries</source>
<translation> </translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="93"/>
<source>Your Rights</source>
<translation> ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="63"/>
<source>Copyright (c) %1 %2</source>
<comment>%1 is year, %2 is the name of copyright holder(s)</comment>
<translation>ிி (ி) %1 %2</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="95"/>
<source>%1 is released under the MIT License.</source>
<translation>%1 ி ிி ிிி.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="96"/>
<source>This license grants people a number of freedoms:</source>
<translation> ி ி ி:</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="97"/>
<source>You are free to use %1, for any purpose</source>
<translation> ி %1 </translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="98"/>
<source>You are free to distribute %1</source>
<translation>%1 ிிி </translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="99"/>
<source>You can study how %1 works and change it</source>
<translation>%1 ி ி </translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="100"/>
<source>You can distribute changed versions of %1</source>
<translation> ி %1 ிிி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="102"/>
<source>The MIT license guarantees you this freedom. Nobody is ever permitted to take it away.</source>
<translation>ி ி ி ி. ிி.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="130"/>
<source>Third-party Libraries used by %1</source>
<translation>%1 </translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="153"/>
<source>&amp;Help</source>
<translation>ி (&amp;h)</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="154"/>
<source>&amp;About</source>
<translation>&amp;ி</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="156"/>
<source>&amp;License</source>
<translation>&amp; ி</translation>
</message>
</context>
<context>
<name>GraphicsScene</name>
<message>
<location filename="../mainwindow.cpp" line="292"/>
<location filename="../graphicsscene.cpp" line="102"/>
<source>Drag image here</source>
<translation> </translation>
</message>
</context>
<context>
<name>GraphicsView</name>
<message>
<location filename="../graphicsview.cpp" line="51"/>
<source>File is not a valid image</source>
<translation> ி </translation>
</message>
<message>
<location filename="../graphicsview.cpp" line="55"/>
<location filename="../graphicsview.cpp" line="60"/>
<location filename="../graphicsview.cpp" line="71"/>
<source>Image data is invalid or currently unsupported</source>
<translation> ி</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../mainwindow.cpp" line="190"/>
<location filename="../mainwindow.cpp" line="561"/>
<source>File url list is empty</source>
<translation> ி ி ி </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="461"/>
<source>&amp;Copy</source>
<translation> (&amp;c)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="569"/>
<source>Image data is invalid</source>
<translation> </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="576"/>
<source>Not supported mimedata: %1</source>
<translation> ிி: %1</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="783"/>
<source>Image From Clipboard</source>
<translation>ிிிி </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="801"/>
<source>Are you sure you want to move &quot;%1&quot; to recycle bin?</source>
<translation>ி ி &quot;%1&quot; ிி?</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="805"/>
<source>Failed to move file to trash</source>
<translation> ி ி</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="806"/>
<source>Move to trash failed, it might caused by file permission issue, file system limitation, or platform limitation.</source>
<translation> ி, ி, ி .</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="106"/>
<source>Copy P&amp;ixmap</source>
<translation>ி &amp; </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="107"/>
<source>Copy &amp;File Path</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="125"/>
<source>Properties</source>
<translation></translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="110"/>
<location filename="../aboutdialog.cpp" line="41"/>
<source>Stay on top</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="111"/>
<location filename="../aboutdialog.cpp" line="44"/>
<source>Protected mode</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="112"/>
<location filename="../aboutdialog.cpp" line="47"/>
<source>Keep transformation</source>
<comment>The &apos;transformation&apos; means the flip/rotation status that currently applied to the image view</comment>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="90"/>
<source>Zoom in</source>
<translation>ி</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="91"/>
<source>Zoom out</source>
<translation>ிி</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="99"/>
<source>Pause/Resume Animation</source>
<translation>ி/ி </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="100"/>
<source>Animation Go to Next Frame</source>
<translation>ி ி </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="102"/>
<source>Flip &amp;Horizontally</source>
<translation>ி </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="103"/>
<source>Fit to view</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="104"/>
<source>Fit to width</source>
<translation>ி </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="105"/>
<source>Fit long image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="108"/>
<source>&amp;Paste</source>
<translation> (&amp;p)</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="92"/>
<source>Toggle Checkerboard</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="86"/>
<source>&amp;Open...</source>
<translation>&amp; ி ...</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="88"/>
<source>Actual size</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="89"/>
<source>Toggle maximize</source>
<translation>ி </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="93"/>
<source>Rotate right</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="94"/>
<source>Rotate left</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="96"/>
<source>Previous image</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="97"/>
<source>Next image</source>
<translation> </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="800"/>
<location filename="../actionmanager.cpp" line="109"/>
<source>Move to Trash</source>
<translation> </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="113"/>
<source>Configure...</source>
<translation> ...</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="114"/>
<source>Help</source>
<translation>ி</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="117"/>
<source>Show in File Explorer</source>
<comment>File Explorer is the name of explorer.exe under Windows</comment>
<translation> ி ி</translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="123"/>
<source>Show in directory</source>
<translation>ி </translation>
</message>
<message>
<location filename="../actionmanager.cpp" line="126"/>
<source>Quit</source>
<translation>ி</translation>
</message>
</context>
<context>
<name>MetadataDialog</name>
<message>
<location filename="../metadatadialog.cpp" line="84"/>
<source>Image Metadata</source>
<translation> ி </translation>
</message>
</context>
<context>
<name>MetadataModel</name>
<message>
<location filename="../metadatamodel.cpp" line="43"/>
<source>Origin</source>
<comment>Section name.</comment>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="44"/>
<source>Image</source>
<comment>Section name.</comment>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="48"/>
<source>File</source>
<comment>Section name.</comment>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="45"/>
<source>Camera</source>
<comment>Section name.</comment>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="35"/>
<source>%1 File</source>
<translation>%1 </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="42"/>
<source>Description</source>
<comment>Section name.</comment>
<translation>ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="46"/>
<source>Advanced photo</source>
<comment>Section name.</comment>
<translation> </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="47"/>
<source>GPS</source>
<comment>Section name.</comment>
<translation> </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="52"/>
<source>Dimensions</source>
<translation>ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="54"/>
<source>Aspect ratio</source>
<translation> ிி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="58"/>
<source>Frame count</source>
<translation> ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="62"/>
<source>Name</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="64"/>
<source>Item type</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="66"/>
<source>Folder path</source>
<translation> </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="68"/>
<source>Size</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="70"/>
<source>Date created</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="72"/>
<source>Date modified</source>
<translation>ி ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="79"/>
<source>Title</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="81"/>
<source>Subject</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="83"/>
<source>Rating</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="85"/>
<source>Tags</source>
<translation>ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="87"/>
<source>Comments</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="90"/>
<source>Authors</source>
<translation>ிி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="92"/>
<source>Date taken</source>
<translation> ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="98"/>
<source>Program name</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="100"/>
<source>Copyright</source>
<translation>ிி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="103"/>
<source>Horizontal resolution</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="105"/>
<source>Vertical resolution</source>
<translation> </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="107"/>
<source>Resolution unit</source>
<translation>ிி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="109"/>
<source>Colour representation</source>
<translation> ிிிி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="112"/>
<source>Camera maker</source>
<translation> ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="114"/>
<source>Camera model</source>
<translation> ிி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="116"/>
<source>F-stop</source>
<translation>-</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="118"/>
<source>Exposure time</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="120"/>
<source>ISO speed</source>
<translation> ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="122"/>
<source>Exposure bias</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="124"/>
<source>Focal length</source>
<translation>ி, ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="126"/>
<source>Max aperture</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="128"/>
<source>Metering mode</source>
<translation> </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="130"/>
<source>Subject distance</source>
<translation> </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="132"/>
<source>Flash mode</source>
<translation>ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="134"/>
<source>35mm focal length</source>
<translation>35 ி ி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="137"/>
<source>Lens model</source>
<translation> ிி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="139"/>
<source>Contrast</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="141"/>
<source>Brightness</source>
<translation>ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="143"/>
<source>Exposure program</source>
<translation>ி ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="145"/>
<source>Saturation</source>
<translation>ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="147"/>
<source>Sharpness</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="149"/>
<source>White balance</source>
<translation> </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="151"/>
<source>Digital zoom</source>
<translation>ிி </translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="153"/>
<source>EXIF version</source>
<translation>Exif ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="156"/>
<source>Latitude reference</source>
<translation> ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="158"/>
<source>Latitude</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="160"/>
<source>Longitude reference</source>
<translation> ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="162"/>
<source>Longitude</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="164"/>
<source>Altitude reference</source>
<translation> ி</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="166"/>
<source>Altitude</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="176"/>
<source>%1 x %2</source>
<translation>%1 %2</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="194"/>
<source>%1 : %2</source>
<translation>%1: %2</translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="319"/>
<source>Property</source>
<translation></translation>
</message>
<message>
<location filename="../metadatamodel.cpp" line="319"/>
<source>Value</source>
<translation>ி</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="../settingsdialog.cpp" line="33"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="41"/>
<source>Options</source>
<translation>ி</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="53"/>
<source>Shortcuts</source>
<translation>ி</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="63"/>
<source>Editing shortcuts for action &quot;%1&quot;:</source>
<translation> ி ி &quot;%1&quot;:</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="72"/>
<source>Failed to set shortcuts</source>
<translation>ி ி ி</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="73"/>
<source>Please check if shortcuts are duplicated with existing shortcuts.</source>
<translation> ி ி ி.</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="80"/>
<source>Do nothing</source>
<translation> </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="81"/>
<source>Close the window</source>
<translation> </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="82"/>
<source>Toggle maximize</source>
<translation>ி </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="83"/>
<source>Toggle fullscreen</source>
<translation> ி</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="87"/>
<source>Zoom in and out</source>
<translation> ி ி</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="88"/>
<source>View next or previous item</source>
<translation> ி </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="92"/>
<source>Auto size</source>
<translation> </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="93"/>
<source>Maximized</source>
<translation>ி</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="94"/>
<source>Windowed</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="98"/>
<source>Round (Integer scaling)</source>
<comment>This option means round up for .5 and above</comment>
<translation> ( ி)</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="99"/>
<source>Ceil (Integer scaling)</source>
<comment>This option means always round up</comment>
<translation> ( ி)</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="100"/>
<source>Floor (Integer scaling)</source>
<comment>This option means always round down</comment>
<translation>ி ( ி)</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="101"/>
<source>Follow system (Fractional scaling)</source>
<comment>This option means don&apos;t round</comment>
<translation>ிி ி (ி ி)</translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="124"/>
<source>Stay on top when start-up</source>
<translation>ி </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="125"/>
<source>Use built-in close window animation</source>
<translation> ி </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="126"/>
<source>Use light-color checkerboard</source>
<translation>ி- </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="127"/>
<source>Loop the loaded gallery</source>
<translation> ி </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="128"/>
<source>Auto long image mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="129"/>
<source>Limit SVG support to SVG Tiny 1.2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="130"/>
<source>Double-click behavior</source>
<translation> </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="131"/>
<source>Mouse wheel behavior</source>
<translation>ி </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="132"/>
<source>Default window size</source>
<translation>ி </translation>
</message>
<message>
<location filename="../settingsdialog.cpp" line="133"/>
<source>HiDPI scale factor rounding policy</source>
<translation>HIDPI ி ி ி </translation>
</message>
</context>
<context>
<name>ShortcutEdit</name>
<message>
<location filename="../shortcutedit.cpp" line="104"/>
<source>No shortcuts</source>
<translation>ி </translation>
</message>
</context>
<context>
<name>ShortcutEditor</name>
<message>
<location filename="../shortcutedit.cpp" line="70"/>
<source>Shortcut #%1</source>
<translation>ி #%1</translation>
</message>
</context>
<context>
<name>main</name>
<message>
<location filename="../main.cpp" line="42"/>
<source>Pineapple Pictures</source>
<translation>ி </translation>
</message>
<message>
<location filename="../main.cpp" line="45"/>
<source>List supported image format suffixes, and quit program.</source>
<translation>ி ி ி ிி, ி ி.</translation>
</message>
<message>
<location filename="../main.cpp" line="49"/>
<source>File list.</source>
<translation> ி.</translation>
</message>
</context>
</TS>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,22 +8,14 @@ environment:
LIBEXIV2: C:\projects\exiv2 LIBEXIV2: C:\projects\exiv2
PPKG: C:\projects\ppkg PPKG: C:\projects\ppkg
matrix: matrix:
- job_name: mingw_64_qt6_7 - job_name: mingw_64_qt6_8
QTDIR: C:\Qt\6.7\mingw_64 QTDIR: C:\Qt\6.8\mingw_64
MINGW64: C:\Qt\Tools\mingw1120_64 MINGW64: C:\Qt\mingw_64\Tools\mingw1310_64
KF_BRANCH: master KF_BRANCH: master
EXIV2_VERSION: "0.28.2" EXIV2_VERSION: "0.28.7"
EXIV2_CMAKE_OPTIONS: "-DEXIV2_ENABLE_BROTLI=OFF -DEXIV2_ENABLE_INIH=OFF -DEXIV2_BUILD_EXIV2_COMMAND=OFF" EXIV2_CMAKE_OPTIONS: "-DEXIV2_ENABLE_BROTLI=OFF -DEXIV2_ENABLE_INIH=OFF -DEXIV2_BUILD_EXIV2_COMMAND=OFF"
PPIC_CMAKE_OPTIONS: "-DPREFER_QT_5=OFF" PPIC_CMAKE_OPTIONS: "-DPREFER_QT_5=OFF"
WINDEPLOYQT_ARGS: "--verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --skip-plugin-types tls,networkinformation" WINDEPLOYQT_ARGS: "--verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-system-d3d-compiler --skip-plugin-types tls,networkinformation"
- job_name: mingw81_64_qt5_15_2
QTDIR: C:\Qt\5.15.2\mingw81_64
MINGW64: C:\Qt\Tools\mingw810_64
KF_BRANCH: kf5
EXIV2_VERSION: "0.27.7"
EXIV2_CMAKE_OPTIONS: "-DEXIV2_BUILD_SAMPLES=OFF -DEXIV2_ENABLE_WIN_UNICODE=ON -DEXIV2_BUILD_EXIV2_COMMAND=OFF"
PPIC_CMAKE_OPTIONS: "-DPREFER_QT_5=ON"
WINDEPLOYQT_ARGS: "--verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler"
install: install:
- mkdir %CMAKE_INSTALL_PREFIX% - mkdir %CMAKE_INSTALL_PREFIX%
@@ -67,7 +59,7 @@ build_script:
- cd %APPVEYOR_BUILD_FOLDER% - cd %APPVEYOR_BUILD_FOLDER%
# install AOM for libavif AV1 decoding support... # install AOM for libavif AV1 decoding support...
- cd 3rdparty - cd 3rdparty
#- git clone -b v3.6.0 --depth 1 https://aomedia.googlesource.com/aom #- git clone -b v3.9.1 --depth 1 https://aomedia.googlesource.com/aom
#- cd aom #- cd aom
#- mkdir build.aom #- mkdir build.aom
#- cd build.aom #- cd build.aom
@@ -76,18 +68,18 @@ build_script:
#- cmake --build . --config Release --target install/strip #- cmake --build . --config Release --target install/strip
- mkdir aom - mkdir aom
- cd aom - cd aom
- curl -fsSL -o ppkg-aom.zip https://sourceforge.net/projects/pineapple-package-manager/files/packages/mingw-w64-x86_64-windows/aom-3.6.0-1.zip - curl -fsSL -o ppkg-aom.zip https://sourceforge.net/projects/pineapple-package-manager/files/packages/mingw-w64-x86_64-windows/aom-3.9.1-2.zip
- ppkg ppkg-aom.zip - ppkg ppkg-aom.zip
- 7z x ppkg-aom.zip LICENSE -y - 7z x ppkg-aom.zip LICENSE -y
- cd %APPVEYOR_BUILD_FOLDER% - cd %APPVEYOR_BUILD_FOLDER%
# install libavif for avif format support of KImageFormats # install libavif for avif format support of KImageFormats
- cd %LIBAVIF% - cd %LIBAVIF%
- curl -fsSL -o libavif-v0_11_1.zip https://github.com/AOMediaCodec/libavif/archive/v0.11.1.zip - curl -fsSL -o libavif-v1_3_0.zip https://github.com/AOMediaCodec/libavif/archive/v1.3.0.zip
- 7z x libavif-v0_11_1.zip -y - 7z x libavif-v1_3_0.zip -y
- cd libavif-0.11.1 - cd libavif-1.3.0
- mkdir build - mkdir build
- cd build - cd build
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_PREFIX% -DAVIF_CODEC_AOM=ON - cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_PREFIX% -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_AOM_DECODE=ON -DAVIF_CODEC_AOM_ENCODE=ON -DAVIF_LIBYUV=LOCAL
- cmake --build . --config Release - cmake --build . --config Release
- cmake --build . --config Release --target install/strip - cmake --build . --config Release --target install/strip
- cd %APPVEYOR_BUILD_FOLDER% - cd %APPVEYOR_BUILD_FOLDER%
@@ -98,15 +90,15 @@ build_script:
- cd karchive - cd karchive
- mkdir build - mkdir build
- cd build - cd build
- cmake .. -G "Ninja" -DWITH_LIBZSTD=OFF -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_PREFIX% - cmake .. -G "Ninja" -DBUILD_TESTING=OFF -DWITH_LIBZSTD=OFF -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DWITH_OPENSSL=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_PREFIX%
- cmake --build . --config Release - cmake --build . --config Release
- cmake --build . --config Release --target install/strip - cmake --build . --config Release --target install/strip
- cd %APPVEYOR_BUILD_FOLDER% - cd %APPVEYOR_BUILD_FOLDER%
# build libexpat for libexiv2 # build libexpat for libexiv2
- cd %LIBEXPAT% - cd %LIBEXPAT%
- curl -fsSL -o R_2_5_0.zip https://github.com/libexpat/libexpat/archive/R_2_5_0.zip - curl -fsSL -o R_2_7_3.zip https://github.com/libexpat/libexpat/archive/R_2_7_3.zip
- 7z x R_2_5_0.zip -y - 7z x R_2_7_3.zip -y
- cd libexpat-R_2_5_0/expat/ - cd libexpat-R_2_7_3/expat/
- cmake -G "Ninja" . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_PREFIX% -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF - cmake -G "Ninja" . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_PREFIX% -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF
- cmake --build . --target install/strip - cmake --build . --target install/strip
- cd %APPVEYOR_BUILD_FOLDER% - cd %APPVEYOR_BUILD_FOLDER%
@@ -125,7 +117,7 @@ build_script:
- cd kimageformats - cd kimageformats
- mkdir build - mkdir build
- cd build - cd build
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_QTPLUGINDIR=%QTDIR%\plugins - cmake .. -G "Ninja" -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_QTPLUGINDIR=%QTDIR%\plugins
- cmake --build . --config Release - cmake --build . --config Release
- cmake --build . --config Release --target install/strip - cmake --build . --config Release --target install/strip
- cd %APPVEYOR_BUILD_FOLDER% - cd %APPVEYOR_BUILD_FOLDER%
@@ -151,8 +143,8 @@ build_script:
- copy %APPVEYOR_BUILD_FOLDER%\3rdparty\aom\LICENSE License.aom.txt - copy %APPVEYOR_BUILD_FOLDER%\3rdparty\aom\LICENSE License.aom.txt
- copy %APPVEYOR_BUILD_FOLDER%\3rdparty\karchive\LICENSES\LGPL-2.0-or-later.txt License.KArchive.txt - copy %APPVEYOR_BUILD_FOLDER%\3rdparty\karchive\LICENSES\LGPL-2.0-or-later.txt License.KArchive.txt
- copy %APPVEYOR_BUILD_FOLDER%\3rdparty\kimageformats\LICENSES\LGPL-2.1-or-later.txt License.kimageformats.txt - copy %APPVEYOR_BUILD_FOLDER%\3rdparty\kimageformats\LICENSES\LGPL-2.1-or-later.txt License.kimageformats.txt
- copy %LIBEXPAT%\libexpat-R_2_5_0\expat\COPYING License.expat.txt - copy %LIBEXPAT%\libexpat-R_2_7_3\expat\COPYING License.expat.txt
- copy %LIBAVIF%\libavif-0.11.1\LICENSE License.libavif.txt - copy %LIBAVIF%\libavif-1.3.0\LICENSE License.libavif.txt
- copy %LIBEXIV2%\exiv2-%EXIV2_VERSION%\COPYING License.exiv2.txt - copy %LIBEXIV2%\exiv2-%EXIV2_VERSION%\COPYING License.exiv2.txt
# TODO: Qt, zlib # TODO: Qt, zlib
- cd .. - cd ..

BIN
assets/icons/app-icon.icns Normal file

Binary file not shown.

View File

@@ -1,4 +1,4 @@
IDI_ICON1 ICON DISCARDABLE "icons/app-icon.ico" IDI_ICON1 ICON DISCARDABLE "@CMAKE_CURRENT_SOURCE_DIR@/assets/icons/app-icon.ico"
1 VERSIONINFO 1 VERSIONINFO
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
@@ -8,6 +8,7 @@ BEGIN
VALUE "FileDescription", "Pineapple Pictures - Image Viewer" VALUE "FileDescription", "Pineapple Pictures - Image Viewer"
VALUE "LegalCopyright", "MIT/Expat License - Copyright (C) 2024 Gary Wang" VALUE "LegalCopyright", "MIT/Expat License - Copyright (C) 2024 Gary Wang"
VALUE "ProductName", "Pineapple Pictures" VALUE "ProductName", "Pineapple Pictures"
VALUE "ProductVersion", "@PROJECT_VERSION@"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@@ -13,6 +13,7 @@
<li><u>Russian</u>: Sergey Shornikov, Artem, Andrey</li> <li><u>Russian</u>: Sergey Shornikov, Artem, Andrey</li>
<li><u>Sinhala</u>: HelaBasa</li> <li><u>Sinhala</u>: HelaBasa</li>
<li><u>Spanish</u>: Toni Estévez, Génesis Toxical, William(ѕ)ⁿ, gallegonovato</li> <li><u>Spanish</u>: Toni Estévez, Génesis Toxical, William(ѕ)ⁿ, gallegonovato</li>
<li><u>Tamil</u>: தமிழ்நேரம் (TamilNeram)</li>
<li><u>Turkish</u>: E-Akcaer, Oğuz Ersen, Sabri Ünal</li> <li><u>Turkish</u>: E-Akcaer, Oğuz Ersen, Sabri Ünal</li>
<li><u>Ukrainian</u>: Dan, volkov, Сергій</li> <li><u>Ukrainian</u>: Dan, volkov, Сергій</li>
</ul> </ul>

136
dist/MacOSXBundleInfo.plist.in vendored Normal file
View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<!-- FIXME: this list can't be automatically generated by Qt's CMake API, don't know why. -->
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>ca</string>
<string>de</string>
<string>es</string>
<string>fr</string>
<string>id</string>
<string>it</string>
<string>ja</string>
<string>ko</string>
<string>nb_NO</string>
<string>nl</string>
<string>pa_PK</string>
<string>ru</string>
<string>si</string>
<string>ta</string>
<string>tr</string>
<string>uk</string>
<string>zh_CN</string>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<!-- JPEG -->
<dict>
<key>CFBundleTypeName</key>
<string>JPEG Image</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>jpg</string>
<string>jpeg</string>
<string>jfif</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>image/jpeg</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<!-- PNG -->
<dict>
<key>CFBundleTypeName</key>
<string>PNG Image</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>png</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>image/png</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<!-- WebP -->
<dict>
<key>CFBundleTypeName</key>
<string>WebP Image</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>webp</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>image/webp</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<!-- GIF -->
<dict>
<key>CFBundleTypeName</key>
<string>GIF Image</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>gif</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>image/gif</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<!-- SVG -->
<dict>
<key>CFBundleTypeName</key>
<string>SVG Image</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>svg</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>image/svg+xml</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
</dict>
</plist>

View File

@@ -6,6 +6,7 @@
<name xml:lang="ja">Pineapple Pictures</name> <name xml:lang="ja">Pineapple Pictures</name>
<name xml:lang="nl">Pineapple Afbeeldingen</name> <name xml:lang="nl">Pineapple Afbeeldingen</name>
<name xml:lang="ru">Pineapple Pictures</name> <name xml:lang="ru">Pineapple Pictures</name>
<name xml:lang="ta">அன்னாசி படங்கள்</name>
<name xml:lang="uk">Pineapple Pictures</name> <name xml:lang="uk">Pineapple Pictures</name>
<name xml:lang="zh-CN">菠萝看图</name> <name xml:lang="zh-CN">菠萝看图</name>
<summary>Image Viewer</summary> <summary>Image Viewer</summary>
@@ -13,6 +14,7 @@
<summary xml:lang="ja">画像ビューアー</summary> <summary xml:lang="ja">画像ビューアー</summary>
<summary xml:lang="nl">Afbeeldingsweergave</summary> <summary xml:lang="nl">Afbeeldingsweergave</summary>
<summary xml:lang="ru">Просмотр изображений</summary> <summary xml:lang="ru">Просмотр изображений</summary>
<summary xml:lang="ta">பட பார்வையாளர்</summary>
<summary xml:lang="uk">Переглядач зображень</summary> <summary xml:lang="uk">Переглядач зображень</summary>
<summary xml:lang="zh-CN">图像查看器</summary> <summary xml:lang="zh-CN">图像查看器</summary>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
@@ -23,6 +25,7 @@
<p xml:lang="ja">Pineapple Picturesは、ズームイン時に便利なナビゲーションサムネイルを備えた軽量で使いやすい画像ビューアです。画像管理のサポートは含まれていません。</p> <p xml:lang="ja">Pineapple Picturesは、ズームイン時に便利なナビゲーションサムネイルを備えた軽量で使いやすい画像ビューアです。画像管理のサポートは含まれていません。</p>
<p xml:lang="nl">Pineapple Afbeeldingen is een licht en eenvoudig te gebruiken afbeeldingsweergaveprogramma met miniatuurnavigatie na inzoomen. Het programma heeft echter geen fotobeheermogelijkheid.</p> <p xml:lang="nl">Pineapple Afbeeldingen is een licht en eenvoudig te gebruiken afbeeldingsweergaveprogramma met miniatuurnavigatie na inzoomen. Het programma heeft echter geen fotobeheermogelijkheid.</p>
<p xml:lang="ru">Pineapple Pictures - это легкий и простой в использовании просмотрщик изображений, оснащенный удобной навигацией по миниатюрам при увеличении масштаба и не содержащий никакой поддержки управления изображениями.</p> <p xml:lang="ru">Pineapple Pictures - это легкий и простой в использовании просмотрщик изображений, оснащенный удобной навигацией по миниатюрам при увеличении масштаба и не содержащий никакой поддержки управления изображениями.</p>
<p xml:lang="ta">அன்னாசி படங்கள் ஒரு இலகுரக மற்றும் பயன்படுத்த எளிதான பட பார்வையாளராகும், இது பெரிதாக்கும்போது ஒரு எளிமையான வழிசெலுத்தல் சிறுபடத்துடன் வருகிறது, மேலும் எந்த பட மேலாண்மை ஆதரவையும் கொண்டிருக்கவில்லை.</p>
<p xml:lang="uk">Pineapple Pictures це легкий і простий у використанні переглядач зображень, який постачається зі зручною навігаційною мініатюрою при збільшенні масштабу і не містить жодної підтримки керування зображеннями.</p> <p xml:lang="uk">Pineapple Pictures це легкий і простий у використанні переглядач зображень, який постачається зі зручною навігаційною мініатюрою при збільшенні масштабу і не містить жодної підтримки керування зображеннями.</p>
<p xml:lang="zh-CN">菠萝看图是一个轻量级易用的图像查看器,在图片放大时提供了方便的鸟瞰导航功能,且不包含任何图片管理功能。</p> <p xml:lang="zh-CN">菠萝看图是一个轻量级易用的图像查看器,在图片放大时提供了方便的鸟瞰导航功能,且不包含任何图片管理功能。</p>
</description> </description>
@@ -37,6 +40,7 @@
<launchable type="desktop-id">net.blumia.pineapple-pictures.desktop</launchable> <launchable type="desktop-id">net.blumia.pineapple-pictures.desktop</launchable>
<url type="homepage">https://github.com/BLumia/pineapple-pictures</url> <url type="homepage">https://github.com/BLumia/pineapple-pictures</url>
<url type="bugtracker">https://github.com/BLumia/pineapple-pictures/issues</url> <url type="bugtracker">https://github.com/BLumia/pineapple-pictures/issues</url>
<url type="donation">https://ko-fi.com/blumia</url>
<url type="translate">https://hosted.weblate.org/projects/pineapple-pictures/</url> <url type="translate">https://hosted.weblate.org/projects/pineapple-pictures/</url>
<provides> <provides>
<binary>ppic</binary> <binary>ppic</binary>
@@ -48,6 +52,7 @@
<caption xml:lang="ja">画像ファイル読み込み時のメインウィンドウ</caption> <caption xml:lang="ja">画像ファイル読み込み時のメインウィンドウ</caption>
<caption xml:lang="nl">Hoofdvenster na het laden van een afbeelding</caption> <caption xml:lang="nl">Hoofdvenster na het laden van een afbeelding</caption>
<caption xml:lang="ru">Основное окно после загрузки файла изображения</caption> <caption xml:lang="ru">Основное окно после загрузки файла изображения</caption>
<caption xml:lang="ta">ஒரு படக் கோப்பு ஏற்றப்படும் போது முதன்மையான சாளரம்</caption>
<caption xml:lang="uk">Головне вікно після завантаження файлу зображення</caption> <caption xml:lang="uk">Головне вікно після завантаження файлу зображення</caption>
<caption xml:lang="zh-CN">加载图片后的主窗口</caption> <caption xml:lang="zh-CN">加载图片后的主窗口</caption>
<image type="source" width="1503" height="640">https://pineapple-pictures.sourceforge.io/ppic-gui-static.png</image> <image type="source" width="1503" height="640">https://pineapple-pictures.sourceforge.io/ppic-gui-static.png</image>
@@ -58,6 +63,7 @@
<caption xml:lang="ja">ラスター画像の拡大</caption> <caption xml:lang="ja">ラスター画像の拡大</caption>
<caption xml:lang="nl">Inzoomen op een roosterafbeelding</caption> <caption xml:lang="nl">Inzoomen op een roosterafbeelding</caption>
<caption xml:lang="ru">Масштабирование растрового изображения</caption> <caption xml:lang="ru">Масштабирование растрового изображения</caption>
<caption xml:lang="ta">ராச்டர் படத்தில் பெரிதாக்குதல்</caption>
<caption xml:lang="uk">Масштабування растрового зображення</caption> <caption xml:lang="uk">Масштабування растрового зображення</caption>
<caption xml:lang="zh-CN">放大浏览位图</caption> <caption xml:lang="zh-CN">放大浏览位图</caption>
<image type="source" width="771" height="553">https://pineapple-pictures.sourceforge.io/ppic-zoom-raster.png</image> <image type="source" width="771" height="553">https://pineapple-pictures.sourceforge.io/ppic-zoom-raster.png</image>
@@ -68,12 +74,205 @@
<caption xml:lang="ja">ベクター画像の拡大</caption> <caption xml:lang="ja">ベクター画像の拡大</caption>
<caption xml:lang="nl">Inzoomen op een vectorafbeelding</caption> <caption xml:lang="nl">Inzoomen op een vectorafbeelding</caption>
<caption xml:lang="ru">Масштабирование векторного изображения</caption> <caption xml:lang="ru">Масштабирование векторного изображения</caption>
<caption xml:lang="ta">ஒரு திசையன் படத்தில் பெரிதாக்குதல்</caption>
<caption xml:lang="uk">Масштабування векторного зображення</caption> <caption xml:lang="uk">Масштабування векторного зображення</caption>
<caption xml:lang="zh-CN">放大浏览矢量图</caption> <caption xml:lang="zh-CN">放大浏览矢量图</caption>
<image type="source" width="771" height="553">https://pineapple-pictures.sourceforge.io/ppic-zoom-svg.png</image> <image type="source" width="771" height="553">https://pineapple-pictures.sourceforge.io/ppic-zoom-svg.png</image>
</screenshot> </screenshot>
</screenshots> </screenshots>
<releases> <releases>
<release type="stable" version="1.3.0" date="2025-12-20T00:00:00Z">
<description>
<p>This release adds the following features:</p>
<ul>
<li>New option to limit SVG support to SVG Tiny 1.2 standard</li>
<li>Windows: ship tools and configurations that help user associate image files to this program</li>
</ul>
<p>This release fixes the following bugs:</p>
<ul>
<li>Fix window not appear at the screen that the mouse cursor is at</li>
<li>Fix Windows prebuilt binary having AVIF plugin included but not actually support it</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>CPack DEB: will now recommend "kimageformat6-plugins" instead of the KF5 version</li>
<li>Update translations</li>
<li>Update exiv2 version for Windows binary build</li>
</ul>
<p>With contributions from:</p>
<p>VenusGirl, Andrey</p>
</description>
</release>
<release type="stable" version="1.2.1" date="2025-11-22T00:00:00Z">
<description>
<p>This release fixes the following bug:</p>
<ul>
<li>Fix incorrect color when display some CMYK images.</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>Now use Qt 6.10.1 for pre-built binary</li>
<li>Update README description and AppStream metainfo</li>
<li>Update translations</li>
<li>Update libavif, AOM and expat version for Windows binary build</li>
</ul>
<p>With contributions from:</p>
<p>albanobattistella</p>
</description>
</release>
<release type="stable" version="1.2.0" date="2025-09-21T00:00:00Z">
<description>
<p>This release adds the following features:</p>
<ul>
<li>Long image mode that detect extra wide image and auto fit by its thin side</li>
<li>Windows: Add product version to binary metadata / resource file</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>Update translations</li>
<li>Update libavif version for Windows binary build</li>
</ul>
<p>With contributions from:</p>
<p>Heimen Stoffels, albanobattistella, Sabri Ünal</p>
</description>
</release>
<release type="stable" version="1.1.1" date="2025-08-02T00:00:00Z">
<description>
<p>This release adds the following feature:</p>
<ul>
<li>Click dock icon should show window when it's hidden on macOS</li>
</ul>
<p>This release fixes the following bug:</p>
<ul>
<li>Ensure "Fit by Width" position the view to the beginning of the image</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>Update translations</li>
<li>Update Exiv2 version for Windows binary build</li>
</ul>
<p>With contributions from:</p>
<p>Heimen Stoffels, VenusGirl, தமிழ்நேரம்</p>
</description>
</release>
<release type="stable" version="1.1.0" date="2025-07-06T00:00:00Z">
<description>
<p>This release adds the following features:</p>
<ul>
<li>New option to disable built-in close window animation</li>
<li>New option to disable gallery looping</li>
<li>Support load m3u8 as image gallery playlist</li>
</ul>
<p>This release includes the following change:</p>
<ul>
<li>Drop Qt 5 support</li>
</ul>
<p>With contributions from:</p>
<p>Heimen Stoffels, albanobattistella, தமிழ்நேரம்</p>
</description>
</release>
<release type="stable" version="1.0.0" date="2025-05-03T00:00:00Z">
<description>
<p>This release adds the following features:</p>
<ul>
<li>Support enforces windowed mode on start-up</li>
<li>Reload image automatically when current image gets updated</li>
</ul>
<p>This release fixes the following bug:</p>
<ul>
<li>Display correct text language on macOS</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>Use native text for shortcut editor's label</li>
<li>Display native commandline message when possible</li>
<li>Merge Qt translations into app applications as well</li>
</ul>
<p>With contributions from:</p>
<p>Heimen Stoffels, albanobattistella, mmahhi</p>
</description>
</release>
<release type="stable" version="0.9.2" date="2025-03-05T00:00:00Z">
<description>
<p>This release fixes the following bug:</p>
<ul>
<li>Refer to the right exiv2 CMake module so it can be found on Linux</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>Convert DEP5 to REUSE.toml for better REUSE compliance</li>
<li>Update translations</li>
</ul>
<p>With contributions from:</p>
<p>Pino Toscano, TamilNeram</p>
</description>
</release>
<release type="stable" version="0.9.1" date="2025-01-25T00:00:00Z">
<description>
<p>This release adds the following features:</p>
<ul>
<li>Option to double-click to fullscreen</li>
<li>Build-time option to embed translation resources</li>
</ul>
<p>This release fixes the following bugs:</p>
<ul>
<li>Fix window size not adjusted when open file on macOS</li>
<li>Should center window according to available screen geometry</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>Change close window bahavior on macOS</li>
<li>Update translations</li>
</ul>
<p>With contributions from:</p>
<p>albanobattistella, Sabri Ünal</p>
</description>
</release>
<release type="stable" version="0.9.0" date="2024-12-08T00:00:00Z">
<description>
<p>This release adds the following features:</p>
<ul>
<li>Support custom shortcuts for existing actions</li>
<li>Actions for frame-by-frame animated image playback support</li>
</ul>
<p>This release includes the following changes:</p>
<ul>
<li>Initial macOS bundle support</li>
<li>bump minimum required CMake version to 3.16</li>
<li>Update translations</li>
</ul>
<p>With contributions from:</p>
<p>albanobattistella, VenusGirl, gallegonovato, Sabri Ünal</p>
</description>
</release>
<release type="stable" version="0.8.2.1" date="2024-10-27T00:00:00Z">
<description>
<p>This release fixes the following bug:</p>
<ul>
<li>Cannot load translations caused by a change in 0.8.2</li>
</ul>
</description>
</release>
<release type="stable" version="0.8.2" date="2024-10-26T00:00:00Z">
<description>
<p>This release adds the following feature:</p>
<ul>
<li>New option to allow use light-color checkerboard by default</li>
</ul>
<p>With contributions from:</p>
<p>albanobattistella, mmahhi, gallegonovato</p>
</description>
</release>
<release type="stable" version="0.8.1" date="2024-08-25T00:00:00Z">
<description>
<p>This release adds the following feature:</p>
<ul>
<li>New command line option to list all supported formats</li>
</ul>
<p>With contributions from:</p>
<p>albanobattistella, mmahhi, ovl-1, gallegonovato, Oğuz Ersen</p>
</description>
</release>
<release type="stable" version="0.8.0" date="2024-06-29T00:00:00Z"> <release type="stable" version="0.8.0" date="2024-06-29T00:00:00Z">
<description> <description>
<p>This release adds the following feature:</p> <p>This release adds the following feature:</p>
@@ -123,7 +322,7 @@
<description> <description>
<p>This release adds the following features:</p> <p>This release adds the following features:</p>
<ul> <ul>
<li>TIF and TIFF format files in the same folder will now be automatedly added to the gallery</li> <li>TIF and TIFF format files in the same folder will now be automatically added to the gallery</li>
<li>Built-in window resizing now also supports Linux desktop. (macOS might also works as well)</li> <li>Built-in window resizing now also supports Linux desktop. (macOS might also works as well)</li>
</ul> </ul>
<p>This release fixes the following bugs:</p> <p>This release fixes the following bugs:</p>

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: id\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,51 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: 2025-11-30 14:00+0000\n"
"Last-Translator: VenusGirl <VenusGirl@outlook.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/"
"pineapple-pictures/appstream-metadata/ko/>\n"
"Language: ko\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.15-dev\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr "Pineapple Pictures"
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr "이미지 뷰어"
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
"Pineapple Pictures는 가볍고 사용하기 쉬운 이미지 뷰어로, 확대 시 편리한 내비"
"게이션 썸네일과 함께 제공되며 이미지 관리 지원이 포함되어 있지 않습니다."
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr "이미지 파일이 로드될 때 기본 창"
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr "래스터 이미지 확대하기"
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr "벡터 이미지 확대하기"
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: nb_NO\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: pa_PK\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: si\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

View File

@@ -0,0 +1,52 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: 2025-01-28 09:01+0000\n"
"Last-Translator: தமிழ்நேரம் <anishprabu.t@gmail.com>\n"
"Language-Team: Tamil <https://hosted.weblate.org/projects/pineapple-pictures/"
"appstream-metadata/ta/>\n"
"Language: ta\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10-dev\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr "அன்னாசி படங்கள்"
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr "பட பார்வையாளர்"
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
"அன்னாசி படங்கள் ஒரு இலகுரக மற்றும் பயன்படுத்த எளிதான பட பார்வையாளராகும், இது "
"பெரிதாக்கும்போது ஒரு எளிமையான வழிசெலுத்தல் சிறுபடத்துடன் வருகிறது, மேலும் எந்த பட "
"மேலாண்மை ஆதரவையும் கொண்டிருக்கவில்லை."
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr "ஒரு படக் கோப்பு ஏற்றப்படும் போது முதன்மையான சாளரம்"
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr "ராச்டர் படத்தில் பெரிதாக்குதல்"
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr "ஒரு திசையன் படத்தில் பெரிதாக்குதல்"
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr "கேரி (ப்ளூமியா) வாங் மற்றும் பலர்."

View File

@@ -0,0 +1,47 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#. (itstool) path: component/name
#: net.blumia.pineapple-pictures.metainfo.xml:7
msgid "Pineapple Pictures"
msgstr ""
#. (itstool) path: component/summary
#: net.blumia.pineapple-pictures.metainfo.xml:9
msgid "Image Viewer"
msgstr ""
#. (itstool) path: description/p
#: net.blumia.pineapple-pictures.metainfo.xml:12
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:17
msgid "Main window when an image file is loaded"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:22
msgid "Zooming in a raster image"
msgstr ""
#. (itstool) path: screenshot/caption
#: net.blumia.pineapple-pictures.metainfo.xml:27
msgid "Zooming in a vector image"
msgstr ""
#. (itstool) path: component/developer_name
#: net.blumia.pineapple-pictures.metainfo.xml:34
msgid "Gary (BLumia) Wang et al."
msgstr ""

BIN
dist/passoc/generic.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
dist/passoc/gif.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
dist/passoc/jpeg.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
dist/passoc/png.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

118
dist/passoc/ppic.pacfg vendored Normal file
View File

@@ -0,0 +1,118 @@
targetApp=ppic.exe
friendlyAppName=Pineapple Pictures
friendlyAppName[zh_CN]=菠萝看图
openCommand="\"{targetAppFullPath}\" \"%1\""
[ProgId/jpeg]
name=JPEG Image
name[zh_CN]=JPEG 图像
extensions=jpg,jpeg,jfif
[ProgId/gif]
name=GIF Animation Image
name[zh_CN]=GIF 动图
[ProgId/png]
name=PNG Image
name[zh_CN]=PNG 图像
[ProgId/svg]
name=Scalable Vector Graphics
name[zh_CN]=可缩放矢量图像
[ProgId/webp]
name=WebP Image
name[zh_CN]=WebP 图像
extensions=webp
[ProgId/avif]
name=AV1 Image File
name[zh_CN]=AV1 图像文件
[ProgId/ico]
name=Windows Icon Image
name[zh_CN]=Windows 图标图像
[ProgId/icns]
name=Apple Icon Image
name[zh_CN]=苹果图标图像
[ProgId/psd]
name=Photoshop Document
name[zh_CN]=Photoshop 文档
extensions=psd,psb,pdd,psdt
[ProgId/kra]
name=Krita Document
name[zh_CN]=Krita 文档
[ProgId/xcf]
name=GIMP Document
name[zh_CN]=GIMP 文档
[ProgId/tga]
name=TARGA Image
name[zh_CN]=TARGA 图像
[ProgId/tif]
name=Tagged Image File Format
name[zh_CN]=标签图像文件格式
extensions=tif,tiff
[ProgId/bmp]
name=Bitmap
name[zh_CN]=位图
[ProgId/wbmp]
name=Wireless Bitmap
name[zh_CN]=无线位图
[ProgId/dds]
name=DirectDraw Surface
[ProgId/hdr]
name=High Dynamic Range Image
name[zh_CN]=高动态范围图像
[ProgId/iff]
name=Interchange File Format
name[zh_CN]=可交换文件格式
[ProgId/pic]
name=Softimage Picture
name[zh_CN]=Softimage 图像
[ProgId/pcx]
name=PiCture eXchange PC Paintbrush Image
name[zh_CN]=PC Paintbrush 图像
[ProgId/qoi]
name=Quite OK Image
name[zh_CN]=挺 OK 图像
[ProgId/ras]
name=Sun Raster Image
name[zh_CN]=Sun 栅格图象
extensions=ras,sun
[ProgId/ora]
name=OpenRaster Image
name[zh_CN]=OpenRaster 图象
[ProgId/ani]
name=Animated Cursor
name[zh_CN]=动态光标
[ProgId/pfm]
name=Portable Float Map
extensions=pfm,phm
[ProgId/rgb]
name=Silicon Graphics Image
extensions=rgb,rgba,bw,sgi
[ProgId/pxr]
name=Pixar Raster Image
[ProgId/sct]
name=Scitex Continuous Tone

BIN
dist/passoc/psd.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
dist/passoc/svg.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -1,12 +1,16 @@
# SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net> # SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
QT += core widgets gui svg QT += core widgets gui svg svgwidgets
greaterThan(QT_MAJOR_VERSION, 5): QT += svgwidgets
TARGET = ppic TARGET = ppic
TEMPLATE = app TEMPLATE = app
DEFINES += PPIC_VERSION_STRING=\\\"x.y.z\\\"
win32 {
DEFINES += FLAG_PORTABLE_MODE_SUPPORT=1
}
# The following define makes your compiler emit warnings if you use # The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings # any feature of Qt which has been marked as deprecated (the exact warnings
@@ -38,7 +42,9 @@ SOURCES += \
app/metadatadialog.cpp \ app/metadatadialog.cpp \
app/exiv2wrapper.cpp \ app/exiv2wrapper.cpp \
app/actionmanager.cpp \ app/actionmanager.cpp \
app/playlistmanager.cpp app/playlistmanager.cpp \
app/shortcutedit.cpp \
app/fileopeneventhandler.cpp
HEADERS += \ HEADERS += \
app/aboutdialog.h \ app/aboutdialog.h \
@@ -56,10 +62,12 @@ HEADERS += \
app/metadatadialog.h \ app/metadatadialog.h \
app/exiv2wrapper.h \ app/exiv2wrapper.h \
app/actionmanager.h \ app/actionmanager.h \
app/playlistmanager.h app/playlistmanager.h \
app/shortcutedit.h \
app/fileopeneventhandler.h
TRANSLATIONS = \ TRANSLATIONS = \
app/translations/PineapplePictures.ts \ app/translations/PineapplePictures_en.ts \
app/translations/PineapplePictures_zh_CN.ts \ app/translations/PineapplePictures_zh_CN.ts \
app/translations/PineapplePictures_de.ts \ app/translations/PineapplePictures_de.ts \
app/translations/PineapplePictures_es.ts \ app/translations/PineapplePictures_es.ts \
@@ -79,7 +87,7 @@ RESOURCES += \
assets/resources.qrc assets/resources.qrc
# Generate from svg: # Generate from svg:
# magick convert -density 512x512 -background none app-icon.svg -define icon:auto-resize app-icon.ico # magick -density 512x512 -background none app-icon.svg -define icon:auto-resize app-icon.ico
RC_ICONS = assets/icons/app-icon.ico RC_ICONS = assets/icons/app-icon.ico
# Windows only, for rc file (we're not going to use the .rc file in this repo) # Windows only, for rc file (we're not going to use the .rc file in this repo)