Compare commits
4 Commits
33344ce413
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cb1237cbc4 | |||
| dbc9baba13 | |||
| bd99501616 | |||
| fccbf4d810 |
@@ -29,6 +29,7 @@ add_subdirectory(libXISF)
|
||||
|
||||
set(TENMON_SRC
|
||||
src/about.cpp src/about.h
|
||||
src/application.cpp src/application.h
|
||||
src/batchprocessing.cpp src/batchprocessing.h src/batchprocessing.ui
|
||||
src/chartgraph.h src/chartgraph.cpp
|
||||
src/database.cpp src/database.h
|
||||
@@ -74,6 +75,9 @@ elseif(APPLE)
|
||||
set(tenmon_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/tenmon.icns)
|
||||
find_package(Qt6 COMPONENTS DBus REQUIRED)
|
||||
set_source_files_properties(${tenmon_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
set(MACOSX_BUNDLE_ICON_FILE "tenmon.icns")
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "tenmon")
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "space.nouspiro.tenmon")
|
||||
else()
|
||||
set(tenmon_ICON "")
|
||||
find_package(Qt6 COMPONENTS DBus REQUIRED)
|
||||
@@ -112,6 +116,7 @@ endif(STELLARSOLVER_INCLUDE AND STELLARSOLVER_LIB)
|
||||
target_link_libraries(tenmon PRIVATE Qt6::Widgets Qt6::Sql Qt6::OpenGLWidgets Qt6::Qml Qt6::Charts Qt6::Svg ${EXIF_LIB} ${FITS_LIB} ${RAW_LIB} ${WCS_LIB} ${LCMS2_LIB} XISF)
|
||||
if(APPLE)
|
||||
target_link_libraries(tenmon PRIVATE Qt6::DBus "-framework CoreFoundation")
|
||||
set_target_properties(tenmon PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in")
|
||||
elseif(UNIX)
|
||||
target_link_libraries(tenmon PRIVATE Qt6::DBus)
|
||||
endif(APPLE)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//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>tenmon</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>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>fits</string>
|
||||
<string>fit</string>
|
||||
<string>xisf</string>
|
||||
<string>png</string>
|
||||
<string>jpg</string>
|
||||
<string>jpeg</string>
|
||||
<string>tiff</string>
|
||||
<string>tif</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
#include "application.h"
|
||||
|
||||
#include <QFileOpenEvent>
|
||||
|
||||
Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
||||
{
|
||||
}
|
||||
|
||||
bool Application::event(QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::FileOpen) {
|
||||
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(event);
|
||||
emit openFileEvent(openEvent->file());
|
||||
}
|
||||
|
||||
return QApplication::event(event);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
class Application : public QApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Application(int &argc, char **argv);
|
||||
bool event(QEvent *event) override;
|
||||
signals:
|
||||
void openFileEvent(const QString &file);
|
||||
};
|
||||
|
||||
#endif // APPLICATION_H
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include "application.h"
|
||||
#include <QCommandLineParser>
|
||||
#include <QSettings>
|
||||
#include <QSurfaceFormat>
|
||||
@@ -102,11 +102,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
|
||||
|
||||
QApplication a(argc, argv);
|
||||
Application a(argc, argv);
|
||||
a.setOrganizationName("nou");
|
||||
a.setApplicationName("Tenmon");
|
||||
a.setWindowIcon(QIcon(":/space.nouspiro.tenmon.png"));
|
||||
a.setWindowIcon(QIcon(":/space.nouspiro.tenmon_64.png"));
|
||||
|
||||
QTranslator translator;
|
||||
QTranslator translator2;
|
||||
@@ -127,6 +126,7 @@ int main(int argc, char *argv[])
|
||||
a.installTranslator(&translator2);
|
||||
|
||||
MainWindow w;
|
||||
QObject::connect(&a, &Application::openFileEvent, &w, static_cast<void (MainWindow::*)(const QString&)>(&MainWindow::loadFile));
|
||||
w.show();
|
||||
|
||||
if(!cmd.positionalArguments().isEmpty() && !cmd.isSet("script"))
|
||||
|
||||
Reference in New Issue
Block a user