diff --git a/extras/juce demo/src/BinaryData.cpp b/extras/juce demo/src/BinaryData.cpp index ea2472e13b..73bc33a63e 100644 --- a/extras/juce demo/src/BinaryData.cpp +++ b/extras/juce demo/src/BinaryData.cpp @@ -7974,3 +7974,4 @@ static const unsigned char temp17[] = {47,42,13,10,32,32,61,61,61,61,61,61,61,61 111,109,109,97,110,100,77,97,110,97,103,101,114,41,13,10,123,13,10,32,32,32,32,114,101,116,117,114,110,32,110,101,119,32,87,105,100,103,101,116, 115,68,101,109,111,32,40,99,111,109,109,97,110,100,77,97,110,97,103,101,114,41,59,13,10,125,13,10,0,0}; const char* BinaryData::widgetsdemo_cpp = (const char*) temp17; + diff --git a/extras/the jucer/src/BinaryData.cpp b/extras/the jucer/src/BinaryData.cpp index 1279f531a8..c08fddd03e 100644 --- a/extras/the jucer/src/BinaryData.cpp +++ b/extras/the jucer/src/BinaryData.cpp @@ -911,3 +911,4 @@ static const unsigned char temp4[] = {137,80,78,71,13,10,26,10,0,0,0,13,73,72,68 0,98,28,9,155,95,0,2,104,68,236,11,1,8,160,17,225,73,128,0,3,0,120,52,172,151,198,78,252,63,0,0,0,0,73,69,78,68,174,66, 96,130,0,0}; const char* BinaryData::prefs_misc_png = (const char*) temp4; + diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 48ed14c3c2..820aa7f8f3 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -6516,6 +6516,10 @@ END_JUCE_NAMESPACE #include #include #include + #else + #if MACOSX_DEPLOYMENT_TARGET <= MAC_OS_X_VERSION_10_4 + #include + #endif #endif #include @@ -70454,6 +70458,7 @@ void PreferencesPanel::showInDialogBox (const String& dialogtitle, dw.setContentComponent (this, true, true); dw.centreAroundComponent (0, dw.getWidth(), dw.getHeight()); dw.runModalLoop(); + dw.setContentComponent (0, false, false); } void PreferencesPanel::resized() @@ -240904,6 +240909,26 @@ void PlatformUtilities::deleteRegistryKey (const String& regKeyPath) } } +void PlatformUtilities::registerFileAssociation (const String& fileExtension, + const String& symbolicDescription, + const String& fullDescription, + const File& targetExecutable, + int iconResourceNumber) +{ + setRegistryValue ("HKEY_CLASSES_ROOT\\" + fileExtension + "\\", symbolicDescription); + + const String key ("HKEY_CLASSES_ROOT\\" + symbolicDescription); + + if (iconResourceNumber != 0) + setRegistryValue (key + "\\DefaultIcon\\", + targetExecutable.getFullPathName() + "," + String (-iconResourceNumber)); + + setRegistryValue (key + "\\", fullDescription); + + setRegistryValue (key + "\\shell\\open\\command\\", + targetExecutable.getFullPathName() + " %1"); +} + bool juce_IsRunningInWine() throw() { HKEY key; diff --git a/juce_amalgamated.h b/juce_amalgamated.h index ecdae94434..aba94e8775 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -13051,6 +13051,24 @@ public: /** WIN32 ONLY - Deletes a registry key (which is registry-talk for 'folder'). */ static void deleteRegistryKey (const String& regKeyPath); + /** WIN32 ONLY - Creates a file association in the registry. + + This lets you set the exe that should be launched by a given file extension. + @param fileExtension the file extension to associate, including the + initial dot, e.g. ".txt" + @param symbolicDescription a space-free short token to identify the file type + @param fullDescription a human-readable description of the file type + @param targetExecutable the executable that should be launched + @param iconResourceNumber the icon that gets displayed for the file type will be + found by looking up this resource number in the + executable. Pass 0 here to not use an icon + */ + static void registerFileAssociation (const String& fileExtension, + const String& symbolicDescription, + const String& fullDescription, + const File& targetExecutable, + int iconResourceNumber); + /** WIN32 ONLY - This returns the HINSTANCE of the current module. In a normal Juce application this will be set to the module handle diff --git a/src/juce_appframework/gui/components/special/juce_PreferencesPanel.cpp b/src/juce_appframework/gui/components/special/juce_PreferencesPanel.cpp index a39b5f6835..4bde220ce2 100644 --- a/src/juce_appframework/gui/components/special/juce_PreferencesPanel.cpp +++ b/src/juce_appframework/gui/components/special/juce_PreferencesPanel.cpp @@ -125,6 +125,7 @@ void PreferencesPanel::showInDialogBox (const String& dialogtitle, dw.setContentComponent (this, true, true); dw.centreAroundComponent (0, dw.getWidth(), dw.getHeight()); dw.runModalLoop(); + dw.setContentComponent (0, false, false); } //============================================================================== diff --git a/src/juce_core/io/network/juce_Socket.cpp b/src/juce_core/io/network/juce_Socket.cpp index 4571d6a09d..55ed016b06 100644 --- a/src/juce_core/io/network/juce_Socket.cpp +++ b/src/juce_core/io/network/juce_Socket.cpp @@ -43,6 +43,10 @@ #include #include #include + #else + #if MACOSX_DEPLOYMENT_TARGET <= MAC_OS_X_VERSION_10_4 + #include + #endif #endif #include