mudlet/src/FileOpenHandler.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.7 KiB
C
Raw Permalink Normal View History

Add: open .mpackage files with Mudlet (#7065) #### Brief overview of PR changes/additions - Created `MudletServer` to keep track of Mudlet instances and allow them to communicate. - Added cli argument for installing a package. - Created `FileOpenHandler` for installing packages from `QEvent::FileOpen` events. - Updated mudlet.desktop to associate Mudlet with .zip files on Linux. - Created Info.plist to associate Mudlet with .mpackage files on MacOS. - Added registry keys to associate Mudlet with .mpackage files on Windows. #### Motivation for adding to Mudlet fixes #1083 /claim #1083 #### Other info (issues closed, discussion etc) The Info.plist file needs to be copied into the app bundle for MacOS to recognize it. I'm not sure how to do that. I found a reference to mudlet.app in `CI/travis.osx.after_success.sh`, but I think that's just for the CI build. Does someone know how Mudlet is installed on MacOS? Related docs: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1 ## Examples **Installing a package on an already running instance of Mudlet** https://github.com/Mudlet/Mudlet/assets/147658676/4457e496-a24f-420f-9bc3-3a879e7e4f9f **Queueing two packages for install by gui and cli. Displaying connection dialogue to determine which profile the packages should be installed on.** https://github.com/Mudlet/Mudlet/assets/147658676/a12edeea-6973-43c8-a691-cfb4524efdb1 **If no other instance of Mudlet is open, open Mudlet and install on first opened profile** https://github.com/Mudlet/Mudlet/assets/147658676/662d450a-6bbd-4528-88e6-4dba674cc82e
2024-01-07 08:48:57 -05:00
/***************************************************************************
* Copyright (C) 2024-2024 by Adam Robinson - seldon1951@hotmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef FILEOPENHANDLER_H
#define FILEOPENHANDLER_H
#include <QObject>
#include <QFileOpenEvent>
class FileOpenHandler : public QObject
{
Q_OBJECT
public:
explicit FileOpenHandler(QObject* parent = nullptr);
~FileOpenHandler() override;
Add: open .mpackage files with Mudlet (#7065) #### Brief overview of PR changes/additions - Created `MudletServer` to keep track of Mudlet instances and allow them to communicate. - Added cli argument for installing a package. - Created `FileOpenHandler` for installing packages from `QEvent::FileOpen` events. - Updated mudlet.desktop to associate Mudlet with .zip files on Linux. - Created Info.plist to associate Mudlet with .mpackage files on MacOS. - Added registry keys to associate Mudlet with .mpackage files on Windows. #### Motivation for adding to Mudlet fixes #1083 /claim #1083 #### Other info (issues closed, discussion etc) The Info.plist file needs to be copied into the app bundle for MacOS to recognize it. I'm not sure how to do that. I found a reference to mudlet.app in `CI/travis.osx.after_success.sh`, but I think that's just for the CI build. Does someone know how Mudlet is installed on MacOS? Related docs: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1 ## Examples **Installing a package on an already running instance of Mudlet** https://github.com/Mudlet/Mudlet/assets/147658676/4457e496-a24f-420f-9bc3-3a879e7e4f9f **Queueing two packages for install by gui and cli. Displaying connection dialogue to determine which profile the packages should be installed on.** https://github.com/Mudlet/Mudlet/assets/147658676/a12edeea-6973-43c8-a691-cfb4524efdb1 **If no other instance of Mudlet is open, open Mudlet and install on first opened profile** https://github.com/Mudlet/Mudlet/assets/147658676/662d450a-6bbd-4528-88e6-4dba674cc82e
2024-01-07 08:48:57 -05:00
protected:
bool eventFilter(QObject* obj, QEvent* event) override;
};
#endif //FILEOPENHANDLER_H