diff options
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | cmake/MacOSXBundleInfo.plist.in | 23 | ||||
-rw-r--r-- | launcher/Application.cpp | 6 | ||||
-rw-r--r-- | program_info/CMakeLists.txt | 1 | ||||
-rw-r--r-- | program_info/modrinth-mrpack-mime.xml | 9 | ||||
-rw-r--r-- | program_info/org.prismlauncher.PrismLauncher.desktop.in | 1 |
6 files changed, 47 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 00eb1925..22692dae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,13 +301,11 @@ if(UNIX AND APPLE) install(FILES ${Launcher_Branding_ICNS} DESTINATION ${RESOURCES_DEST_DIR} RENAME ${Launcher_Name}.icns) elseif(UNIX) + include(KDEInstallDirs) + set(BINARY_DEST_DIR "bin") set(LIBRARY_DEST_DIR "lib${LIB_SUFFIX}") set(JARS_DEST_DIR "share/${Launcher_APP_BINARY_NAME}") - set(LAUNCHER_DESKTOP_DEST_DIR "share/applications" CACHE STRING "Path to the desktop file directory") - set(LAUNCHER_METAINFO_DEST_DIR "share/metainfo" CACHE STRING "Path to the metainfo directory") - set(LAUNCHER_ICON_DEST_DIR "share/icons/hicolor/scalable/apps" CACHE STRING "Path to the scalable icon directory") - set(LAUNCHER_MAN_DEST_DIR "share/man/man6" CACHE STRING "Path to the man page directory") # install as bundle with no dependencies included set(INSTALL_BUNDLE "nodeps") @@ -315,12 +313,13 @@ elseif(UNIX) # Set RPATH SET(Launcher_BINARY_RPATH "$ORIGIN/") - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_Desktop} DESTINATION ${LAUNCHER_DESKTOP_DEST_DIR}) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_MetaInfo} DESTINATION ${LAUNCHER_METAINFO_DEST_DIR}) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_SVG} DESTINATION ${LAUNCHER_ICON_DEST_DIR}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_Desktop} DESTINATION ${KDE_INSTALL_APPDIR}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_MetaInfo} DESTINATION ${KDE_INSTALL_METAINFODIR}) + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_SVG} DESTINATION "${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps") + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_mrpack_MIMEInfo} DESTINATION ${KDE_INSTALL_MIMEDIR}) if(Launcher_ManPage) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_ManPage} DESTINATION ${LAUNCHER_MAN_DEST_DIR}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_ManPage} DESTINATION "${KDE_INSTALL_MANDIR}/man6") endif() # Install basic runner script if component "portable" is selected diff --git a/cmake/MacOSXBundleInfo.plist.in b/cmake/MacOSXBundleInfo.plist.in index 1b22e21f..400e482f 100644 --- a/cmake/MacOSXBundleInfo.plist.in +++ b/cmake/MacOSXBundleInfo.plist.in @@ -44,5 +44,28 @@ <string>${MACOSX_SPARKLE_UPDATE_PUBLIC_KEY}</string> <key>SUFeedURL</key> <string>${MACOSX_SPARKLE_UPDATE_FEED_URL}</string> + <key>CFBundleDocumentTypes</key> + <array> + <dict> + <key>CFBundleTypeExtensions</key> + <array> + <string>zip</string> + <string>mrpack</string> + </array> + <key>CFBundleTypeName</key> + <string>Prism Launcher instance</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>TEXT</string> + <string>utxt</string> + <string>TUTX</string> + <string>****</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>LSHandlerRank</key> + <string>Alternate</string> + </dict> + </array> </dict> </plist> diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 73a062e1..579942f4 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -925,6 +925,12 @@ bool Application::event(QEvent* event) { m_prevAppState = ev->applicationState(); } #endif + + if (event->type() == QEvent::FileOpen) { + auto ev = static_cast<QFileOpenEvent*>(event); + m_mainWindow->droppedURLs({ ev->url() }); + } + return QApplication::event(event); } diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index b0507816..8c682711 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -25,6 +25,7 @@ set(Launcher_DesktopFileName "org.prismlauncher.PrismLauncher.desktop" PARENT_SC set(Launcher_SVGFileName "org.prismlauncher.PrismLauncher.svg" PARENT_SCOPE) set(Launcher_Desktop "program_info/org.prismlauncher.PrismLauncher.desktop" PARENT_SCOPE) +set(Launcher_mrpack_MIMEInfo "program_info/modrinth-mrpack-mime.xml" PARENT_SCOPE) set(Launcher_MetaInfo "program_info/org.prismlauncher.PrismLauncher.metainfo.xml" PARENT_SCOPE) set(Launcher_SVG "program_info/org.prismlauncher.PrismLauncher.svg" PARENT_SCOPE) set(Launcher_Branding_ICNS "program_info/prismlauncher.icns" PARENT_SCOPE) diff --git a/program_info/modrinth-mrpack-mime.xml b/program_info/modrinth-mrpack-mime.xml new file mode 100644 index 00000000..5001e5e7 --- /dev/null +++ b/program_info/modrinth-mrpack-mime.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/x-modrinth-modpack+zip">
+ <comment>Modrinth Modpack File</comment>
+ <icon name="application-x-modrinth-modpack"/>
+ <glob-deleteall/>
+ <glob pattern="*.mrpack"/>
+ </mime-type>
+</mime-info>
diff --git a/program_info/org.prismlauncher.PrismLauncher.desktop.in b/program_info/org.prismlauncher.PrismLauncher.desktop.in index e608f588..f08f2ba4 100644 --- a/program_info/org.prismlauncher.PrismLauncher.desktop.in +++ b/program_info/org.prismlauncher.PrismLauncher.desktop.in @@ -10,3 +10,4 @@ Icon=org.prismlauncher.PrismLauncher Categories=Game;ActionGame;AdventureGame;Simulation; Keywords=game;minecraft;launcher;mc;multimc;polymc; StartupWMClass=PrismLauncher +MimeType=application/zip;application/x-modrinth-modpack+zip |