diff --git a/dist/osx/Info.plist.in b/dist/osx/Info.plist.in
index ff15794..f1dadb8 100644
--- a/dist/osx/Info.plist.in
+++ b/dist/osx/Info.plist.in
@@ -25,6 +25,26 @@
NSHumanReadableCopyright
Copyright (c) 2010-2012 Alexander Kojevnikov and contributors
LSMinimumSystemVersion
- 10.4
+ 10.5
+ CFBundleDocumentTypes
+
+
+ CFBundleTypeIconFiles
+
+ Spek.icns
+
+ CFBundleTypeName
+ Spek File
+ CFBundleTypeRole
+ Viewer
+ LSHandlerRank
+ Alternate
+ LSItemContentTypes
+
+ public.audio
+ public.movie
+
+
+
diff --git a/src/spek.cc b/src/spek.cc
index 7861068..e8c922b 100644
--- a/src/spek.cc
+++ b/src/spek.cc
@@ -33,13 +33,17 @@ extern "C" {
class Spek: public wxApp
{
public:
- Spek() : wxApp(), quit(false) {}
+ Spek() : wxApp(), window(NULL), quit(false) {}
protected:
virtual bool OnInit();
virtual int OnRun();
+#ifdef OS_OSX
+ virtual void MacOpenFiles(const wxArrayString& files);
+#endif
private:
+ SpekWindow *window;
wxString path;
bool quit;
};
@@ -102,9 +106,9 @@ bool Spek::OnInit()
this->path = parser.GetParam();
}
- SpekWindow *window = new SpekWindow(this->path);
- window->Show(true);
- SetTopWindow(window);
+ this->window = new SpekWindow(this->path);
+ this->window->Show(true);
+ SetTopWindow(this->window);
return true;
}
@@ -116,3 +120,12 @@ int Spek::OnRun()
return wxApp::OnRun();
}
+
+#ifdef OS_OSX
+void Spek::MacOpenFiles(const wxArrayString& files)
+{
+ if (files.GetCount() == 1) {
+ this->window->open(files[0]);
+ }
+}
+#endif