mirror of
https://github.com/alexkay/spek.git
synced 2025-06-11 04:42:24 +03:00
osx: Associate with audio and video files, closes #2
This commit is contained in:
parent
034c165d42
commit
57756a0c52
22
dist/osx/Info.plist.in
vendored
22
dist/osx/Info.plist.in
vendored
@ -25,6 +25,26 @@
|
|||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>Copyright (c) 2010-2012 Alexander Kojevnikov and contributors</string>
|
<string>Copyright (c) 2010-2012 Alexander Kojevnikov and contributors</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>10.4</string>
|
<string>10.5</string>
|
||||||
|
<key>CFBundleDocumentTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeIconFiles</key>
|
||||||
|
<array>
|
||||||
|
<string>Spek.icns</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>Spek File</string>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>LSHandlerRank</key>
|
||||||
|
<string>Alternate</string>
|
||||||
|
<key>LSItemContentTypes</key>
|
||||||
|
<array>
|
||||||
|
<string>public.audio</string>
|
||||||
|
<string>public.movie</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
21
src/spek.cc
21
src/spek.cc
@ -33,13 +33,17 @@ extern "C" {
|
|||||||
class Spek: public wxApp
|
class Spek: public wxApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Spek() : wxApp(), quit(false) {}
|
Spek() : wxApp(), window(NULL), quit(false) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool OnInit();
|
virtual bool OnInit();
|
||||||
virtual int OnRun();
|
virtual int OnRun();
|
||||||
|
#ifdef OS_OSX
|
||||||
|
virtual void MacOpenFiles(const wxArrayString& files);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
SpekWindow *window;
|
||||||
wxString path;
|
wxString path;
|
||||||
bool quit;
|
bool quit;
|
||||||
};
|
};
|
||||||
@ -102,9 +106,9 @@ bool Spek::OnInit()
|
|||||||
this->path = parser.GetParam();
|
this->path = parser.GetParam();
|
||||||
}
|
}
|
||||||
|
|
||||||
SpekWindow *window = new SpekWindow(this->path);
|
this->window = new SpekWindow(this->path);
|
||||||
window->Show(true);
|
this->window->Show(true);
|
||||||
SetTopWindow(window);
|
SetTopWindow(this->window);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,3 +120,12 @@ int Spek::OnRun()
|
|||||||
|
|
||||||
return wxApp::OnRun();
|
return wxApp::OnRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OS_OSX
|
||||||
|
void Spek::MacOpenFiles(const wxArrayString& files)
|
||||||
|
{
|
||||||
|
if (files.GetCount() == 1) {
|
||||||
|
this->window->open(files[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user