Compare commits
No commits in common. "64c4d2e06408d0e8dbe50fbaec32be65dde8c495" and "06af6329142101c290b45f7921c2e4a02a0d8fc6" have entirely different histories.
64c4d2e064
...
06af632914
19
.github/workflows/macos.yml
vendored
19
.github/workflows/macos.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: macOS CI
|
name: macOS CI
|
||||||
|
|
||||||
on: [push, pull_request, workflow_dispatch]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -10,19 +10,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v4
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: '6.8.1'
|
version: '6.4.2'
|
||||||
modules: 'qtimageformats'
|
|
||||||
- name: Run a qt project
|
- name: Run a qt project
|
||||||
run: |
|
run: |
|
||||||
cmake . -Bbuild
|
cmake ./ -DPREFER_QT_5=OFF
|
||||||
cmake --build build
|
make
|
||||||
- name: Deploy
|
|
||||||
run: |
|
|
||||||
macdeployqt ./build/ppic.app -dmg
|
|
||||||
ls
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: "macos-bundle"
|
|
||||||
path: build/*.dmg
|
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,9 +2,6 @@
|
|||||||
*.user
|
*.user
|
||||||
*.user.*
|
*.user.*
|
||||||
|
|
||||||
# Why, macOS, why?
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Translation files
|
# Translation files
|
||||||
*.qm
|
*.qm
|
||||||
*.mo
|
*.mo
|
||||||
|
@ -107,7 +107,7 @@ if (WIN32)
|
|||||||
list(APPEND PPIC_RC_FILES assets/pineapple-pictures.rc)
|
list(APPEND PPIC_RC_FILES assets/pineapple-pictures.rc)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_executable (${EXE_NAME}
|
add_executable (${EXE_NAME} WIN32
|
||||||
${PPIC_HEADER_FILES}
|
${PPIC_HEADER_FILES}
|
||||||
${PPIC_CPP_FILES}
|
${PPIC_CPP_FILES}
|
||||||
${PPIC_QRC_FILES}
|
${PPIC_QRC_FILES}
|
||||||
@ -201,24 +201,8 @@ endif ()
|
|||||||
|
|
||||||
# Install settings
|
# Install settings
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set_target_properties(${EXE_NAME} PROPERTIES
|
# TODO: try to avoid install to a "bin" subfolder under windows...
|
||||||
WIN32_EXECUTABLE TRUE
|
# when fixed, don't forget to update the CI config file...
|
||||||
)
|
|
||||||
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)
|
||||||
@ -245,7 +229,6 @@ 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
|
||||||
|
@ -160,10 +160,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()
|
||||||
@ -657,19 +653,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()});
|
|
||||||
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);
|
||||||
|
@ -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();
|
||||||
|
Binary file not shown.
114
dist/MacOSXBundleInfo.plist.in
vendored
114
dist/MacOSXBundleInfo.plist.in
vendored
@ -1,114 +0,0 @@
|
|||||||
<?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>
|
|
||||||
<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>
|
|
Loading…
Reference in New Issue
Block a user