8 Commits

Author SHA1 Message Date
088066197f chore: update release info to 0.9.1 2025-01-20 20:06:59 +08:00
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
16 changed files with 142 additions and 43 deletions

View File

@ -14,15 +14,25 @@ jobs:
with: with:
version: '6.8.1' version: '6.8.1'
modules: 'qtimageformats' modules: 'qtimageformats'
- name: Run a qt project - name: Install Conan and Dependencies
id: conan
working-directory: ./
shell: bash
run: | run: |
cmake . -Bbuild -DTRANSLATION_RESOURCE_EMBEDDING=ON pip3 install wheel setuptools
cmake --build build 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 - name: Deploy
run: | run: |
macdeployqt ./build/ppic.app -dmg macdeployqt ./ppic.app -dmg
ls ls
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: "macos-bundle" name: "macos-bundle"
path: build/*.dmg path: "*.dmg"

View File

@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(pineapple-pictures VERSION 0.9.0) # don't forget to update NEWS file and AppStream metadata. project(pineapple-pictures VERSION 0.9.1) # don't forget to update NEWS file and AppStream metadata.
include (GNUInstallDirs) include (GNUInstallDirs)
include (FeatureSummary) include (FeatureSummary)
@ -68,6 +68,7 @@ set (PPIC_CPP_FILES
app/exiv2wrapper.cpp app/exiv2wrapper.cpp
app/playlistmanager.cpp app/playlistmanager.cpp
app/shortcutedit.cpp app/shortcutedit.cpp
app/fileopeneventhandler.cpp
) )
set (PPIC_HEADER_FILES set (PPIC_HEADER_FILES
@ -88,6 +89,7 @@ set (PPIC_HEADER_FILES
app/exiv2wrapper.h app/exiv2wrapper.h
app/playlistmanager.h app/playlistmanager.h
app/shortcutedit.h app/shortcutedit.h
app/fileopeneventhandler.h
) )
set (PPIC_QRC_FILES set (PPIC_QRC_FILES

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

19
NEWS
View File

@ -1,3 +1,22 @@
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 Version 0.9.0
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Released: 2024-12-08 Released: 2024-12-08

View File

@ -21,7 +21,7 @@ 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` - Debian (since bullseye) or Ubuntu (since 21.04): `sudo apt install pineapple-pictures`
- 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) - 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)

View File

@ -59,7 +59,7 @@ AboutDialog::AboutDialog(QWidget *parent)
)), )),
QStringLiteral("<hr/>"), QStringLiteral("<hr/>"),
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(QStringLiteral("2025"), QStringLiteral("<a href='https://github.com/BLumia'>@BLumia</a>")),
QStringLiteral("<br/>"), QStringLiteral("<br/>"),
tr("Logo designed by %1").arg(QStringLiteral("<a href='https://github.com/Lovelyblack'>@Lovelyblack</a>")), tr("Logo designed by %1").arg(QStringLiteral("<a href='https://github.com/Lovelyblack'>@Lovelyblack</a>")),
QStringLiteral("<hr/>"), QStringLiteral("<hr/>"),
@ -103,7 +103,7 @@ AboutDialog::AboutDialog(QWidget *parent)
const QString mitLicense(QStringLiteral(R"(Expat/MIT License const QString mitLicense(QStringLiteral(R"(Expat/MIT License
Copyright (c) 2024 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

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

@ -7,6 +7,10 @@
#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>
@ -55,6 +59,21 @@ int main(int argc, char *argv[])
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();
});
#endif // Q_OS_MACOS
QStringList urlStrList = parser.positionalArguments(); QStringList urlStrList = parser.positionalArguments();
QList<QUrl> && urlList = PlaylistManager::convertToUrlList(urlStrList); QList<QUrl> && urlList = PlaylistManager::convertToUrlList(urlStrList);

View File

@ -71,7 +71,11 @@ MainWindow::MainWindow(QWidget *parent)
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,
#ifdef Q_OS_MAC
this, &QWidget::hide);
#else
this, &QWidget::close); this, &QWidget::close);
#endif
GraphicsScene * scene = new GraphicsScene(this); GraphicsScene * scene = new GraphicsScene(this);
@ -160,10 +164,6 @@ MainWindow::MainWindow(QWidget *parent)
installResizeCapture(m_graphicsView->viewport()); installResizeCapture(m_graphicsView->viewport());
installResizeCapture(m_gv); installResizeCapture(m_gv);
installResizeCapture(m_gv->viewport()); installResizeCapture(m_gv->viewport());
#ifdef Q_OS_MACOS
qApp->installEventFilter(this);
#endif // Q_OS_MACOS
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -563,7 +563,7 @@ 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()
) )
); );
} }
@ -661,20 +661,6 @@ QSize MainWindow::sizeHint() const
return QSize(710, 530); return QSize(710, 530);
} }
#ifdef Q_OS_MACOS
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
Q_UNUSED(obj);
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent *fileOpenEvent = static_cast<QFileOpenEvent *>(event);
showUrls({fileOpenEvent->url()});
initWindowSize();
return true;
}
return false;
}
#endif // Q_OS_MACOS
void MainWindow::on_actionOpen_triggered() void MainWindow::on_actionOpen_triggered()
{ {
QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);

View File

@ -77,9 +77,6 @@ protected slots:
protected: protected:
QSize sizeHint() const override; QSize sizeHint() const override;
#ifdef Q_OS_MACOS
bool eventFilter(QObject *obj, QEvent *event) override;
#endif // Q_OS_MACOS
private slots: private slots:
void on_actionOpen_triggered(); void on_actionOpen_triggered();

View File

@ -764,7 +764,7 @@
<message> <message>
<location filename="../settingsdialog.cpp" line="79"/> <location filename="../settingsdialog.cpp" line="79"/>
<source>Toggle fullscreen</source> <source>Toggle fullscreen</source>
<translation type="unfinished"></translation> <translation>Attiva schermo intero</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="83"/> <location filename="../settingsdialog.cpp" line="83"/>

View File

@ -295,12 +295,12 @@
<message> <message>
<location filename="../actionmanager.cpp" line="108"/> <location filename="../actionmanager.cpp" line="108"/>
<source>Pause/Resume Animation</source> <source>Pause/Resume Animation</source>
<translation type="unfinished"></translation> <translation>Canlandırmayı Duraklat/Sürdür</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="109"/> <location filename="../actionmanager.cpp" line="109"/>
<source>Animation Go to Next Frame</source> <source>Animation Go to Next Frame</source>
<translation type="unfinished"></translation> <translation>Canlandırma Sonraki Kareye Git</translation>
</message> </message>
<message> <message>
<location filename="../actionmanager.cpp" line="111"/> <location filename="../actionmanager.cpp" line="111"/>
@ -743,7 +743,7 @@
<message> <message>
<location filename="../settingsdialog.cpp" line="68"/> <location filename="../settingsdialog.cpp" line="68"/>
<source>Failed to set shortcuts</source> <source>Failed to set shortcuts</source>
<translation type="unfinished"></translation> <translation>Kısayollar ayarlanamadı</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="69"/> <location filename="../settingsdialog.cpp" line="69"/>
@ -768,7 +768,7 @@
<message> <message>
<location filename="../settingsdialog.cpp" line="79"/> <location filename="../settingsdialog.cpp" line="79"/>
<source>Toggle fullscreen</source> <source>Toggle fullscreen</source>
<translation type="unfinished"></translation> <translation>Tam ekranı /kapat</translation>
</message> </message>
<message> <message>
<location filename="../settingsdialog.cpp" line="83"/> <location filename="../settingsdialog.cpp" line="83"/>

View File

@ -8,9 +8,9 @@ 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\Tools\mingw1310_64
KF_BRANCH: master KF_BRANCH: master
EXIV2_VERSION: "0.28.3" EXIV2_VERSION: "0.28.3"
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"
@ -125,7 +125,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%

View File

@ -74,6 +74,27 @@
</screenshot> </screenshot>
</screenshots> </screenshots>
<releases> <releases>
<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"> <release type="stable" version="0.9.0" date="2024-12-08T00:00:00Z">
<description> <description>
<p>This release adds the following features:</p> <p>This release adds the following features:</p>

View File

@ -40,7 +40,8 @@ SOURCES += \
app/exiv2wrapper.cpp \ app/exiv2wrapper.cpp \
app/actionmanager.cpp \ app/actionmanager.cpp \
app/playlistmanager.cpp \ app/playlistmanager.cpp \
app/shortcutedit.cpp app/shortcutedit.cpp \
app/fileopeneventhandler.cpp
HEADERS += \ HEADERS += \
app/aboutdialog.h \ app/aboutdialog.h \
@ -59,7 +60,8 @@ HEADERS += \
app/exiv2wrapper.h \ app/exiv2wrapper.h \
app/actionmanager.h \ app/actionmanager.h \
app/playlistmanager.h \ app/playlistmanager.h \
app/shortcutedit.h app/shortcutedit.h \
app/fileopeneventhandler.h
TRANSLATIONS = \ TRANSLATIONS = \
app/translations/PineapplePictures.ts \ app/translations/PineapplePictures.ts \