Compare commits
No commits in common. "ff4f71c1e61727999799184854b35bd3c99e63c5" and "c227c74e233f46660bb6ceb3be9c2c461bc0387f" have entirely different histories.
ff4f71c1e6
...
c227c74e23
@ -68,7 +68,6 @@ 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
|
||||||
@ -89,7 +88,6 @@ 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
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2025 BLumia
|
Copyright (c) 2020 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
|
||||||
|
@ -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("2025"), QStringLiteral("<a href='https://github.com/BLumia'>@BLumia</a>")),
|
.arg(QStringLiteral("2024"), 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) 2025 BLumia
|
Copyright (c) 2024 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
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
// 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);
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
// 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);
|
|
||||||
};
|
|
14
app/main.cpp
14
app/main.cpp
@ -7,10 +7,6 @@
|
|||||||
#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>
|
||||||
@ -59,16 +55,6 @@ 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.showNormal();
|
|
||||||
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);
|
||||||
|
|
||||||
|
@ -160,6 +160,10 @@ 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,6 +661,20 @@ 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);
|
||||||
|
@ -77,6 +77,9 @@ 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();
|
||||||
|
@ -40,8 +40,7 @@ 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 \
|
||||||
@ -60,8 +59,7 @@ 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 \
|
||||||
|
Loading…
Reference in New Issue
Block a user