From d342a55418a8fee71998fadd97cebda8cf77b749 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Fri, 13 Apr 2007 01:54:47 +0000 Subject: [PATCH] Windows debug builds now really shouldn't associate themselves. Also some (preliminary, untested, possibly bad) file type registration code for Mac. Originally committed to SVN as r1068. --- aegisub/main.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/aegisub/main.cpp b/aegisub/main.cpp index 6d70d70ee..6413efbd5 100644 --- a/aegisub/main.cpp +++ b/aegisub/main.cpp @@ -265,13 +265,12 @@ int AegisubApp::OnRun() { ///////////////////////////////// // Registry program to filetypes void AegisubApp::RegistryAssociate () { -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) // Command to open with this wxString command; command << _T("\"") << fullPath << _T("\" \"%1\""); // Main program association -#ifndef DEBUG wxRegKey *key = new wxRegKey(_T("HKEY_CURRENT_USER\\Software\\Classes\\Aegisub")); if (!key->Exists()) key->Create(); key->SetValue(_T(""),_T("Aegisub Subtitle Script")); @@ -292,7 +291,6 @@ void AegisubApp::RegistryAssociate () { if (!key->Exists()) key->Create(); key->SetValue(_T(""),command); delete key; -#endif // Check associations if (Options.AsBool(_T("Show associations"))) { @@ -304,6 +302,15 @@ void AegisubApp::RegistryAssociate () { Options.Save(); } } +#elif defined(__APPLE__) + // This is totally untested and pure guesswork + // I don't know if it should be ".ass" or just "ass" + wxFileName::MacRegisterDefaultTypeAndCreator(_T(".ass"), 0x41535341 /*ASSA*/, 0x41475355 /*AGSU*/); + // Technically .ssa isn't ASSA but it makes it so much easier ;) + wxFileName::MacRegisterDefaultTypeAndCreator(_T(".ssa"), 0x53534134 /*SSA4*/, 0x41475355 /*AGSU*/); + // Not touching .srt yet, there might be some type already registered for it which we should probably use then +#else + // Is there anything like this for other POSIX compatible systems? #endif }