From 6001ceff9f9383c4c3f04e056cd09b118d11b044 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 27 Apr 2013 23:00:18 +0200 Subject: [PATCH] Get rid of bundled beep --- configure.ac | 5 ++--- share/Makefile.am | 2 +- share/doc/readme.md | 2 +- share/sounds/Makefile.am | 11 ----------- share/sounds/beep.wav | Bin 17684 -> 0 bytes src/common/cfgfiles.c | 22 +--------------------- src/common/ctcp.c | 2 +- src/common/outbound.c | 2 +- src/common/text.c | 12 +++++++----- src/common/text.h | 2 +- src/fe-gtk/fe-gtk.c | 13 ++++--------- src/fe-gtk/setup.c | 2 +- win32/hexchat.props | 1 - win32/installer/hexchat-x64.skel.iss | 1 - win32/installer/hexchat-x86.skel.iss | 1 - 15 files changed, 20 insertions(+), 58 deletions(-) delete mode 100644 share/sounds/Makefile.am delete mode 100644 share/sounds/beep.wav diff --git a/configure.ac b/configure.ac index 6eb5b97e..2715398c 100644 --- a/configure.ac +++ b/configure.ac @@ -178,14 +178,14 @@ dnl ********************************************************************* dnl ** GLIB ************************************************************* dnl ********************************************************************* -AM_PATH_GLIB_2_0(2.20.0, glib=yes, glib=no) +AM_PATH_GLIB_2_0(2.14.0, glib=yes, glib=no) if test "$glib" = no; then AC_MSG_ERROR(Cannot find GLib!) fi COMMON_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES" COMMON_LIBS="$GLIB_LIBS" -COMMON_LIBS="$COMMON_LIBS -lgmodule-2.0 -lgobject-2.0 -lgio-2.0" +COMMON_LIBS="$COMMON_LIBS -lgmodule-2.0 -lgobject-2.0" dnl ********************************************************************* dnl ** GTK ************************************************************** @@ -933,7 +933,6 @@ Makefile share/Makefile share/icons/Makefile share/misc/Makefile -share/sounds/Makefile src/Makefile src/common/Makefile src/common/dbus/Makefile diff --git a/share/Makefile.am b/share/Makefile.am index 5c331fd1..6d143b61 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -1,3 +1,3 @@ if DO_GTK -SUBDIRS = icons sounds misc +SUBDIRS = icons misc endif diff --git a/share/doc/readme.md b/share/doc/readme.md index 4fdacfc0..ec2a6d9f 100644 --- a/share/doc/readme.md +++ b/share/doc/readme.md @@ -22,7 +22,7 @@ in general. HexChat runs on most BSD and POSIX compliant operating systems. ## Requirements: * GTK+ 2.14 - * GLib 2.20 + * GLib 2.14 HexChat is known to work on, at least: diff --git a/share/sounds/Makefile.am b/share/sounds/Makefile.am deleted file mode 100644 index f1dc0fc5..00000000 --- a/share/sounds/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -sound_DATA = beep.wav -sounddir = $(datadir)/sounds/freedesktop/stereo - -UPDATE_SOUND_CACHE = touch -m $(datadir)/sounds/freedesktop || : - -install-data-hook: - mv $(DESTDIR)$(datadir)/sounds/freedesktop/stereo/beep.wav $(DESTDIR)$(datadir)/sounds/freedesktop/stereo/hexchat_beep.wav - $(UPDATE_SOUND_CACHE); - -uninstall-hook: - $(UPDATE_SOUND_CACHE); diff --git a/share/sounds/beep.wav b/share/sounds/beep.wav deleted file mode 100644 index 099370f9a20061bb13ce0235222ebee7867dc574..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17684 zcmeI3`#+m^8^=R1jkZjBnle_Ut6@=9V=Yyr4rQiu2oJ&;c zhf!;tH7%+-Mym|fHMFZy(?e|9QKPBn{xhB*zTfvhkRR^6KCkP#K5u_dJbtS?3KirM z=pLO&G0{VzP--Z3l-o5FO0QWRrGe5zks>G&i*6{CmA;k!hUtc>t{sBAu6x7jhSLRS z3(oT6`SIQqZ%TV+d#02nWo<&6P(Q1mwVJt_*+^-mpcBvu77-Q^AwPutFzG(&K4&*) zH@$y){|@X9>`T;3lzd6P^kU}4%)tGD`yIDBZfQ3mRB2bOUtYhwN3=&I=8O4k*AUa3NgiROwXtzTtht`J3l&dJTCE;T3p=)*G!iRv)cC67`6Bj{6+< zMcGE#@?H6^cz?WqSa?`CKaL;AOXa0nWm;v1vO-zw&^n}skVa3V$EL-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!TJdA*zeep zS&>;D7dx`z$3u^Y!asz6keA8Jwdh*(;LgFF)C1H5q2Gjl zW8h)nK?)=VDkGJVltfD6y|jC2E%X+;5o83dAlR|&SPK~o8OEu`spvR#TpzKISonS6 z_dO?iPKXbQ4-vi~d_mQv>bj}iRK~B3U&lO&c|!e_`fFWRU6*HrXG48OeT8PBW?@NA zNlq>=m$wOT!deJ5>>Bn2e}c~tF+}ttdXcP3RwZweH_>m?ZE9D- z6Kd<&b*$V>Zq{+6<47^S7{4W8OTgWTyAf~#oS>7YlXirDgg(cbW2qn&1hF6%Ig^~Z zn7Wv%6|WV)7LMS*=I`a^<>q+U@$g>Ly{7n2@t^MA+`ah*d1ljQ(?-Ka!7?2x~i{WGV$Joc%YOoqiWE0umd~bexZhJ2MGW~MW)ugL|*8;CC%Mpf` zhc#z3XC{;rN+kL~#(|6j83!^BWE{vika1v+19KdhsT<~T6NfjJKBD#5N2>?*;o z66`9$t`h7j!95P#PC(}bbWT9$1awY7uM+esL9Y_@ zDnYLj^eREG61W4v9RThCa0h@p0NerK#{oYM_;J9G1AZLv #include -#include - #include "hexchat.h" #include "cfgfiles.h" #include "util.h" @@ -628,8 +626,6 @@ load_config (void) #ifdef WIN32 char out[256]; #endif - GFile *beepsrc; - GFile *beepdest; check_prefs_dir (); username = g_get_user_name (); @@ -847,23 +843,7 @@ load_config (void) g_free (buf); buf = g_build_filename (get_xdir (), "sounds", NULL); - if (g_mkdir (buf, 0700) == 0) - { - g_free (buf); - - buf = g_build_filename (get_xdir (), "sounds", "beep.wav", NULL); -#ifdef WIN32 /* keep this in sync with fe-gtk.c! */ - beepsrc = g_file_new_for_path (HEXCHATSHAREDIR G_DIR_SEPARATOR_S "share" G_DIR_SEPARATOR_S "sounds" G_DIR_SEPARATOR_S "beep.wav"); -#else - beepsrc = g_file_new_for_path (HEXCHATSHAREDIR G_DIR_SEPARATOR_S "sounds" G_DIR_SEPARATOR_S "freedesktop" G_DIR_SEPARATOR_S "stereo" G_DIR_SEPARATOR_S "hexchat_beep.wav"); -#endif - beepdest = g_file_new_for_path (buf); - - g_file_copy (beepsrc, beepdest, G_FILE_COPY_TARGET_DEFAULT_PERMS, NULL, NULL, NULL, NULL); - - g_object_unref (beepsrc); - g_object_unref (beepdest); - } + g_mkdir (buf, 0700); g_free (buf); } if (prefs.hex_gui_win_height < 138) diff --git a/src/common/ctcp.c b/src/common/ctcp.c index 487003a8..ebfb604d 100644 --- a/src/common/ctcp.c +++ b/src/common/ctcp.c @@ -175,7 +175,7 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip, #else if (strchr (word[5], '/') == NULL) #endif - sound_play (word[5], TRUE, FALSE); + sound_play (word[5], TRUE); return; } } diff --git a/src/common/outbound.c b/src/common/outbound.c index 17c7b331..c8d0397d 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -3161,7 +3161,7 @@ cmd_splay (struct session *sess, char *tbuf, char *word[], char *word_eol[]) { if (*word[2]) { - sound_play (word[2], FALSE, FALSE); + sound_play (word[2], FALSE); return TRUE; } diff --git a/src/common/text.c b/src/common/text.c index da677c88..905a3ce9 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -2221,7 +2221,7 @@ sound_find_command (void) } void -sound_play (const char *file, gboolean quiet, gboolean hexchat_beep) +sound_play (const char *file, gboolean quiet) { char *buf; char *wavfile; @@ -2234,10 +2234,10 @@ sound_play (const char *file, gboolean quiet, gboolean hexchat_beep) } #ifdef WIN32 - /* check for fullpath; also use full path if hexchat_beep is TRUE, which should *only* happen when invoked by fe_beep() */ - if (hexchat_beep || file[0] == '\\' || (((file[0] >= 'A' && file[0] <= 'Z') || (file[0] >= 'a' && file[0] <= 'z')) && file[1] == ':')) + /* check for fullpath */ + if (file[0] == '\\' || (((file[0] >= 'A' && file[0] <= 'Z') || (file[0] >= 'a' && file[0] <= 'z')) && file[1] == ':')) #else - if (hexchat_beep || file[0] == '/') + if (file[0] == '/') #endif { wavfile = g_strdup (file); @@ -2280,7 +2280,9 @@ void sound_play_event (int i) { if (sound_files[i]) - sound_play (sound_files[i], FALSE, FALSE); + { + sound_play (sound_files[i], FALSE); + } } static void diff --git a/src/common/text.h b/src/common/text.h index 4d7bbb38..52cc8ea9 100644 --- a/src/common/text.h +++ b/src/common/text.h @@ -53,7 +53,7 @@ int get_stamp_str (char *fmt, time_t tim, char **ret); void format_event (session *sess, int index, char **args, char *o, int sizeofo, unsigned int stripcolor_args); char *text_find_format_string (char *name); -void sound_play (const char *file, gboolean quiet, gboolean hexchat_beep); +void sound_play (const char *file, gboolean quiet); void sound_play_event (int i); void sound_beep (session *); void sound_load (); diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 603025d1..e11eeaf6 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -660,15 +660,10 @@ fe_print_text (struct session *sess, char *text, time_t stamp) void fe_beep (session *sess) { - char *beepfile; - -#ifdef WIN32 /* keep this in sync with cfgfiles.c! */ - beepfile = g_build_filename (HEXCHATSHAREDIR, "share", "sounds", "beep.wav", NULL); -#else - beepfile = g_build_filename (HEXCHATSHAREDIR, "sounds", "freedesktop", "stereo", "hexchat_beep.wav", NULL); -#endif - sound_play (beepfile, TRUE, TRUE); - g_free (beepfile); + if (!prefs.hex_gui_focus_omitalerts || !fe_gui_info (sess, 0) == 1) + { + gdk_beep (); + } } void diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index 02e8605d..fd239c9d 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -1660,7 +1660,7 @@ setup_snd_browse_cb (GtkWidget *button, GtkEntry *entry) static void setup_snd_play_cb (GtkWidget *button, GtkEntry *entry) { - sound_play (entry->text, FALSE, FALSE); + sound_play (entry->text, FALSE); } static void diff --git a/win32/hexchat.props b/win32/hexchat.props index ad59ec1c..5feac5ad 100644 --- a/win32/hexchat.props +++ b/win32/hexchat.props @@ -73,7 +73,6 @@ xcopy /q /s /i "$(DepsRoot)\lib\gtk-2.0\i686-pc-vs10\engines" "$(HexChatRel)\lib xcopy /q /s /i etc "$(HexChatRel)\etc" xcopy /q /s /i share "$(HexChatRel)\share" xcopy /q /s /i "..\..\share\doc\COPYING" "$(HexChatRel)\share\doc\hexchat\" -xcopy /q /s /i "..\..\share\sounds\beep.wav" "$(HexChatRel)\share\sounds\" xcopy /q /s /i "$(DepsRoot)\share\doc" "$(HexChatRel)\share\doc" xcopy /q /s /i "$(DepsRoot)\lib\enchant\libenchant_myspell.dll" "$(HexChatRel)\lib\enchant\" xcopy /q /s /i "$(HexChatBin)hcchecksum.dll" "$(HexChatRel)\plugins\" diff --git a/win32/installer/hexchat-x64.skel.iss b/win32/installer/hexchat-x64.skel.iss index 79c40f0f..d742fdfa 100644 --- a/win32/installer/hexchat-x64.skel.iss +++ b/win32/installer/hexchat-x64.skel.iss @@ -85,7 +85,6 @@ Source: "etc\gtk-2.0\gtkrc"; DestDir: "{app}\etc\gtk-2.0"; Flags: ignoreversion; ;Source: "etc\gtk-2.0\gtkrc"; DestDir: "{app}\etc\gtk-2.0"; Flags: ignoreversion; Components: libs and not gtkengines Source: "share\xml\*"; DestDir: "{app}\share\xml"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs Source: "share\doc\*"; DestDir: "{app}\share\doc"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs -Source: "share\sounds\beep.wav"; DestDir: "{app}\share\sounds"; Flags: ignoreversion; Components: libs Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations diff --git a/win32/installer/hexchat-x86.skel.iss b/win32/installer/hexchat-x86.skel.iss index c5619d42..fa86cd0c 100644 --- a/win32/installer/hexchat-x86.skel.iss +++ b/win32/installer/hexchat-x86.skel.iss @@ -84,7 +84,6 @@ Source: "etc\gtk-2.0\gtkrc"; DestDir: "{app}\etc\gtk-2.0"; Flags: ignoreversion; ;Source: "etc\gtk-2.0\gtkrc"; DestDir: "{app}\etc\gtk-2.0"; Flags: ignoreversion; Components: libs and not gtkengines Source: "share\xml\*"; DestDir: "{app}\share\xml"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs Source: "share\doc\*"; DestDir: "{app}\share\doc"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs -Source: "share\sounds\beep.wav"; DestDir: "{app}\share\sounds"; Flags: ignoreversion; Components: libs Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations