Fix Dock drag and drop

This commit is contained in:
vit9696 2019-08-18 05:02:30 +03:00
parent fa954394cc
commit d95e533441
4 changed files with 73 additions and 15 deletions

1
.gitignore vendored
View File

@ -235,7 +235,6 @@ Makefile
uefitool_plugin_import.cpp
UEFITool.app/
UEFITool/Info.plist
UEFITool/XCBuildData
UEFIDump/UEFIDump
UEFIExtract/UEFIExtract

33
UEFITool/Info.plist Normal file
View File

@ -0,0 +1,33 @@
<?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>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleIconFile</key>
<string>uefitool</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>UEFITool NE</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>UEFITool</string>
<key>CFBundleIdentifier</key>
<string>org.longsoft.UEFITool</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>None</string>
</dict>
</array>
</dict>
</plist>

View File

@ -122,4 +122,7 @@ FORMS += uefitool.ui \
RESOURCES += uefitool.qrc
RC_FILE = uefitool.rc
ICON = icons/uefitool.icns
ICONFILE.files = icons/uefitool.icns
ICONFILE.path = Contents/Resources
QMAKE_BUNDLE_DATA += ICONFILE
QMAKE_INFO_PLIST = Info.plist

View File

@ -15,18 +15,41 @@
#include <QString>
#include "uefitool.h"
class UEFIToolApplication : public QApplication
{
UEFITool tool;
public:
UEFIToolApplication(int &argc, char **argv)
: QApplication(argc, argv)
{
setOrganizationName("LongSoft");
setOrganizationDomain("longsoft.org");
setApplicationName("UEFITool");
}
int startup()
{
tool.setProgramPath(arguments().at(0));
if (arguments().length() > 1)
tool.openImageFile(arguments().at(1));
tool.show();
return exec();
}
bool event(QEvent *event)
{
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(event);
tool.openImageFile(openEvent->file());
}
return QApplication::event(event);
}
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setOrganizationName("LongSoft");
a.setOrganizationDomain("longsoft.org");
a.setApplicationName("UEFITool");
UEFITool w;
w.setProgramPath(a.arguments().at(0));
if (a.arguments().length() > 1)
w.openImageFile(a.arguments().at(1));
w.show();
return a.exec();
UEFIToolApplication a(argc, argv);
return a.startup();
}