7 Commits

Author SHA1 Message Date
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
9 changed files with 97 additions and 9 deletions

View File

@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(pineapple-pictures VERSION 0.9.2) # don't forget to update NEWS file and AppStream metadata. project(pineapple-pictures VERSION 1.0.0) # don't forget to update NEWS file and AppStream metadata.
include(GNUInstallDirs) include(GNUInstallDirs)
include(FeatureSummary) include(FeatureSummary)
@ -118,10 +118,16 @@ add_executable (${EXE_NAME}
) )
if (${QT_VERSION_MAJOR} EQUAL "6") if (${QT_VERSION_MAJOR} EQUAL "6")
set(ADD_TRANSLATIONS_ADDITIONAL_ARGS)
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.9.0")
set(ADD_TRANSLATIONS_ADDITIONAL_ARGS MERGE_QT_TRANSLATIONS)
endif()
if (TRANSLATION_RESOURCE_EMBEDDING) if (TRANSLATION_RESOURCE_EMBEDDING)
qt_add_translations(${EXE_NAME} TS_FILES ${PPIC_TS_FILES}) qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES})
else() else()
qt_add_translations(${EXE_NAME} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES) qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES)
endif() endif()
else() else()
qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES})

22
NEWS
View File

@ -1,3 +1,23 @@
Version 1.0.0
~~~~~~~~~~~~~
Released: 2025-05-03
Features:
* Support enforce windowed mode on start-up
* Reload image automatically when current image gets updated
Bugfixes:
* Refer to the right exiv2 CMake module so it can be found on Linux
* 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 Version 0.9.2
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
Released: 2025-03-05 Released: 2025-03-05
@ -123,7 +143,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:

View File

@ -118,7 +118,7 @@ qreal GraphicsView::scaleFactor() const
void GraphicsView::resetTransform() void GraphicsView::resetTransform()
{ {
if (!m_avoidResetTransform) { if (!shouldAvoidTransform()) {
QGraphicsView::resetTransform(); QGraphicsView::resetTransform();
} }
} }
@ -196,7 +196,7 @@ void GraphicsView::fitByOrientation(Qt::Orientation ori, bool scaleDownOnly)
void GraphicsView::displayScene() void GraphicsView::displayScene()
{ {
if (m_avoidResetTransform) { if (shouldAvoidTransform()) {
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform()); emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
return; return;
} }
@ -206,6 +206,7 @@ void GraphicsView::displayScene()
} }
m_enableFitInView = true; m_enableFitInView = true;
m_firstUserMediaLoaded = true;
} }
bool GraphicsView::isSceneBiggerThanView() const bool GraphicsView::isSceneBiggerThanView() const
@ -365,3 +366,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

@ -64,6 +64,8 @@ private:
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.
@ -71,6 +73,7 @@ private:
bool m_avoidResetTransform = false; bool m_avoidResetTransform = false;
bool m_checkerboardEnabled = false; bool m_checkerboardEnabled = false;
bool m_useLightCheckerboard = false; bool m_useLightCheckerboard = false;
bool m_firstUserMediaLoaded = false;
}; };
#endif // GRAPHICSVIEW_H #endif // GRAPHICSVIEW_H

View File

@ -52,8 +52,13 @@ int main(int argc, char *argv[])
parser.process(a); parser.process(a);
if (parser.isSet(supportedImageFormats)) { if (parser.isSet(supportedImageFormats)) {
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
fputs(qPrintable(MainWindow::supportedImageFormats().join(QChar('\n'))), stdout); fputs(qPrintable(MainWindow::supportedImageFormats().join(QChar('\n'))), stdout);
::exit(EXIT_SUCCESS); ::exit(EXIT_SUCCESS);
#else
QCommandLineParser::showMessageAndExit(QCommandLineParser::MessageType::Information,
MainWindow::supportedImageFormats().join(QChar('\n')));
#endif
} }
MainWindow w; MainWindow w;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1"> <TS version="2.1" language="en_US">
<context> <context>
<name>AboutDialog</name> <name>AboutDialog</name>
<message> <message>

View File

@ -30,6 +30,28 @@
<true/> <true/>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string> <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> <key>CFBundleDocumentTypes</key>
<array> <array>
<!-- JPEG --> <!-- JPEG -->

View File

@ -80,6 +80,28 @@
</screenshot> </screenshot>
</screenshots> </screenshots>
<releases> <releases>
<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 enforce windowed mode on start-up</li>
<li>Reload image automatically when current image gets updated</li>
</ul>
<p>This release fixes the following bugs:</p>
<ul>
<li>Refer to the right exiv2 CMake module so it can be found on Linux</li>
<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"> <release type="stable" version="0.9.2" date="2025-03-05T00:00:00Z">
<description> <description>
<p>This release fixes the following bug:</p> <p>This release fixes the following bug:</p>
@ -210,7 +232,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

@ -9,6 +9,10 @@ TARGET = ppic
TEMPLATE = app TEMPLATE = app
DEFINES += PPIC_VERSION_STRING=\\\"x.y.z\\\" 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
# depend on your compiler). Please consult the documentation of the # depend on your compiler). Please consult the documentation of the
@ -64,7 +68,7 @@ HEADERS += \
app/fileopeneventhandler.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 \