From 13747555fdff4d2b1b8ec95153c86b15525ddaa7 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Thu, 22 Oct 2015 18:18:50 +0200 Subject: [PATCH] growl: Renamed Growl plugin to OS X Notifications This renames the Growl plugin to OS X Notifications to highlight the new capabilities and to not advertise Growl so much, as requested. Signed-off-by: Jean-Baptiste Kempf --- configure.ac | 18 +++++----- .../English.lproj/SimplePreferences.xib | 6 ++-- extras/package/macosx/configure.sh | 2 +- modules/gui/macosx/simple_prefs.h | 2 +- modules/gui/macosx/simple_prefs.m | 8 ++--- modules/notify/Makefile.am | 14 ++++---- .../notify/{growl.m => osx_notifications.m} | 34 +++++++++++++------ po/POTFILES.in | 2 +- 8 files changed, 49 insertions(+), 37 deletions(-) rename modules/notify/{growl.m => osx_notifications.m} (92%) diff --git a/configure.ac b/configure.ac index aaaae68a1d..3971c8e6b0 100644 --- a/configure.ac +++ b/configure.ac @@ -4060,17 +4060,17 @@ then fi dnl -dnl Growl notification plugin +dnl OS X notification plugin dnl -AC_ARG_ENABLE(growl, - [ --enable-growl growl notification plugin (default disabled)],, - [enable_growl=no]) -AS_IF([test "${enable_growl}" != "no"], [ +AC_ARG_ENABLE(osx_notifications, + [ --enable-osx-notifications osx notification plugin (default disabled)],, + [enable_osx_notifications=no]) +AS_IF([test "${enable_osx_notifications}" != "no"], [ AC_CHECK_HEADERS(${CONTRIB_DIR}/Growl.framework/Versions/A/Headers/Growl.h, [ - VLC_ADD_PLUGIN([growl]) - VLC_ADD_LIBS([growl], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation]) - VLC_ADD_OBJCFLAGS([growl], [-F${CONTRIB_DIR}]) - VLC_ADD_OBJCFLAGS([growl], [-fobjc-exceptions] ) + VLC_ADD_PLUGIN([osx_notifications]) + VLC_ADD_LIBS([osx_notifications], [-F${CONTRIB_DIR} -Wl,-framework,Growl,-framework,Foundation]) + VLC_ADD_OBJCFLAGS([osx_notifications], [-F${CONTRIB_DIR}]) + VLC_ADD_OBJCFLAGS([osx_notifications], [-fobjc-exceptions] ) ]) ] ) diff --git a/extras/package/macosx/Resources/English.lproj/SimplePreferences.xib b/extras/package/macosx/Resources/English.lproj/SimplePreferences.xib index fda675e3cf..9ae4239955 100644 --- a/extras/package/macosx/Resources/English.lproj/SimplePreferences.xib +++ b/extras/package/macosx/Resources/English.lproj/SimplePreferences.xib @@ -72,7 +72,7 @@ - + @@ -262,7 +262,7 @@ Gw - + @@ -1774,7 +1774,7 @@ Gw - + diff --git a/extras/package/macosx/configure.sh b/extras/package/macosx/configure.sh index 1db7cc6ffa..c968d66c96 100755 --- a/extras/package/macosx/configure.sh +++ b/extras/package/macosx/configure.sh @@ -18,7 +18,7 @@ OPTIONS=" --prefix=`pwd`/vlc_install_dir --enable-macosx --enable-merge-ffmpeg - --enable-growl + --enable-osx-notifications --enable-faad --enable-flac --enable-theora diff --git a/modules/gui/macosx/simple_prefs.h b/modules/gui/macosx/simple_prefs.h index 3244f8f743..5db8d268b3 100644 --- a/modules/gui/macosx/simple_prefs.h +++ b/modules/gui/macosx/simple_prefs.h @@ -99,7 +99,7 @@ @property (readwrite, weak) IBOutlet NSView *intfView; @property (readwrite, weak) IBOutlet NSButton *intf_updateCheckbox; @property (readwrite, weak) IBOutlet NSTextField *intf_last_updateLabel; -@property (readwrite, weak) IBOutlet NSButton *intf_enableGrowlCheckbox; +@property (readwrite, weak) IBOutlet NSButton *intf_enableNotificationsCheckbox; @property (readwrite, weak) IBOutlet NSButton *intf_nativefullscreenCheckbox; @property (readwrite, weak) IBOutlet NSButton *intf_autoresizeCheckbox; @property (readwrite, weak) IBOutlet NSButton *intf_pauseminimizedCheckbox; diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m index 41a42e2e85..af0a982851 100644 --- a/modules/gui/macosx/simple_prefs.m +++ b/modules/gui/macosx/simple_prefs.m @@ -377,7 +377,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin [_intf_artCheckbox setTitle: _NS("Allow metadata network access")]; [_intf_updateCheckbox setTitle: _NS("Automatically check for updates")]; [_intf_last_updateLabel setStringValue: @""]; - [_intf_enableGrowlCheckbox setTitle: _NS("Enable Growl notifications (on playlist item change)")]; + [_intf_enableNotificationsCheckbox setTitle: _NS("Enable notifications on playlist item change")]; [_intf_autoresizeCheckbox setTitle: _NS("Resize interface to the native video size")]; [_intf_pauseminimizedCheckbox setTitle: _NS("Pause the video playback when minimized")]; [_intf_luahttpBox setTitle:_NS("Lua HTTP")]; @@ -590,10 +590,10 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam psz_tmp = config_GetPsz(p_intf, "control"); if (psz_tmp) { - [_intf_enableGrowlCheckbox setState: (NSInteger)strstr(psz_tmp, "growl")]; + [_intf_enableNotificationsCheckbox setState: (NSInteger)strstr(psz_tmp, "growl")]; free(psz_tmp); } else - [_intf_enableGrowlCheckbox setState: NSOffState]; + [_intf_enableNotificationsCheckbox setState: NSOffState]; if (config_GetInt(p_intf, "macosx-interfacestyle")) { [_intf_style_darkButtonCell setState: YES]; [_intf_style_brightButtonCell setState: NO]; @@ -929,7 +929,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha config_PutInt(p_intf, "macosx-nativefullscreenmode", [_intf_nativefullscreenCheckbox state]); config_PutInt(p_intf, "macosx-pause-minimized", [_intf_pauseminimizedCheckbox state]); config_PutInt(p_intf, "macosx-video-autoresize", [_intf_autoresizeCheckbox state]); - if ([_intf_enableGrowlCheckbox state] == NSOnState) { + if ([_intf_enableNotificationsCheckbox state] == NSOnState) { tmpString = getString("control"); tmpRange = [tmpString rangeOfString:@"growl"]; if ([tmpString length] > 0 && tmpRange.location == NSNotFound) diff --git a/modules/notify/Makefile.am b/modules/notify/Makefile.am index c38c453418..714a3c5641 100644 --- a/modules/notify/Makefile.am +++ b/modules/notify/Makefile.am @@ -1,15 +1,15 @@ notifydir = $(pluginsdir)/notify -libgrowl_plugin_la_SOURCES = notify/growl.m -libgrowl_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_growl) -libgrowl_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(notifydir)' -Wl,-framework,AppKit -libgrowl_plugin_la_LIBADD = $(LIBS_growl) -libgrowl_plugin_la_LIBTOOLFLAGS = --tag=CC +libosx_notifications_plugin_la_SOURCES = notify/osx_notifications.m +libosx_notifications_plugin_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(OBJCFLAGS_osx_notifications) +libosx_notifications_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(notifydir)' -Wl,-framework,AppKit +libosx_notifications_plugin_la_LIBADD = $(LIBS_osx_notifications) +libosx_notifications_plugin_la_LIBTOOLFLAGS = --tag=CC libnotify_plugin_la_SOURCES = notify/notify.c libnotify_plugin_la_CFLAGS = $(AM_CFLAGS) $(NOTIFY_CFLAGS) libnotify_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(notifydir)' libnotify_plugin_la_LIBADD = $(NOTIFY_LIBS) -notify_LTLIBRARIES = $(LTLIBgrowl) $(LTLIBnotify) -EXTRA_LTLIBRARIES += libgrowl_plugin.la libnotify_plugin.la +notify_LTLIBRARIES = $(LTLIBosx_notifications) $(LTLIBnotify) +EXTRA_LTLIBRARIES += libosx_notifications_plugin.la libnotify_plugin.la diff --git a/modules/notify/growl.m b/modules/notify/osx_notifications.m similarity index 92% rename from modules/notify/growl.m rename to modules/notify/osx_notifications.m index 30d9fd3e3b..73bcd9ec70 100644 --- a/modules/notify/growl.m +++ b/modules/notify/osx_notifications.m @@ -1,5 +1,5 @@ /***************************************************************************** - * growl.m : growl notification plugin + * osx_notifications.m : OS X notification plugin ***************************************************************************** * VLC specific code: * @@ -24,23 +24,35 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * + * --- + * * Growl specific code, ripped from growlnotify: * * Copyright (c) The Growl Project, 2004-2005 * All rights reserved. * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * 3. Neither the name of Growl nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *****************************************************************************/ @@ -109,8 +121,9 @@ static int ItemChange( vlc_object_t *, const char *, vlc_module_begin () set_category( CAT_INTERFACE ) set_subcategory( SUBCAT_INTERFACE_CONTROL ) -set_shortname( "Growl" ) -set_description( N_("Growl Notification Plugin") ) +set_shortname( "OSX-Notifications" ) +add_shortcut( "growl" ) +set_description( N_("OS X Notification Plugin") ) set_capability( "interface", 0 ) set_callbacks( Open, Close ) vlc_module_end () @@ -195,7 +208,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var, return VLC_SUCCESS; else { /* "item-change" */ - if( p_item->i_id != p_intf->p_sys->i_id ) return VLC_SUCCESS; diff --git a/po/POTFILES.in b/po/POTFILES.in index a5b21c8cb7..c8bebfd1c1 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1005,7 +1005,7 @@ modules/mux/mpeg/ts.c modules/mux/mpjpeg.c modules/mux/ogg.c modules/mux/wav.c -modules/notify/growl.m +modules/notify/osx_notifications.m modules/notify/notify.c modules/packetizer/avparser.h modules/packetizer/copy.c