Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register as .zip/.mrpack handler on macOS and Linux #229

Merged
merged 10 commits into from Nov 5, 2022
23 changes: 23 additions & 0 deletions cmake/MacOSXBundleInfo.plist.in
Expand Up @@ -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>
ryanccn marked this conversation as resolved.
Show resolved Hide resolved
<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>
6 changes: 6 additions & 0 deletions launcher/Application.cpp
Expand Up @@ -945,6 +945,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);
}

Expand Down
9 changes: 9 additions & 0 deletions program_info/modrinth-mrpack-mime.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
Scrumplex marked this conversation as resolved.
Show resolved Hide resolved
<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>
1 change: 1 addition & 0 deletions program_info/org.prismlauncher.PrismLauncher.desktop.in
Expand Up @@ -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