From 059e4ec9c8d59f6b283bda3f007ae9d2fd29bc83 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 14 Apr 2013 10:30:51 +0200 Subject: [PATCH] Add default beep sound, deploy on Windows FIXME on Unix yet --- src/common/cfgfiles.c | 26 +++++++++++++++++++++++++- win32/copy/share/beep.wav | Bin 0 -> 17684 bytes win32/installer/hexchat-x64.skel.iss | 2 ++ win32/installer/hexchat-x86.skel.iss | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 win32/copy/share/beep.wav diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index d3c2046d..c7a89665 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -23,6 +23,8 @@ #include #include +#include + #include "hexchat.h" #include "cfgfiles.h" #include "util.h" @@ -627,6 +629,8 @@ load_config (void) #ifdef WIN32 char out[256]; #endif + GFile *beepsrc; + GFile *beepdest; check_prefs_dir (); username = g_get_user_name (); @@ -831,9 +835,29 @@ load_config (void) g_mkdir (prefs.hex_dcc_dir, 0700); g_mkdir (prefs.hex_dcc_completed_dir, 0700); - buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "addons", get_xdir ()); + buf = g_build_filename (get_xdir (), "addons", NULL); g_mkdir (buf, 0700); 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 + beepsrc = g_file_new_for_path (HEXCHATSHAREDIR G_DIR_SEPARATOR_S "share" G_DIR_SEPARATOR_S "beep.wav"); +#else + beepsrc = g_file_new_for_path (HEXCHATSHAREDIR G_DIR_SEPARATOR_S "hexchat" G_DIR_SEPARATOR_S "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_free (buf); } if (prefs.hex_gui_win_height < 138) prefs.hex_gui_win_height = 138; diff --git a/win32/copy/share/beep.wav b/win32/copy/share/beep.wav new file mode 100644 index 0000000000000000000000000000000000000000..099370f9a20061bb13ce0235222ebee7867dc574 GIT binary patch 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-mZ6s_Y1V;u( zb_R3?5KaF8oLMPu;V+XXFv`$cgR~-HAUZ{_I@sT&*fn z70rrfMFv?0S@+rZ**dTeJcr=R^W`1QIhrFX5EWo6uoaS@BtI>5E_Bum)(i@N7yj<> z%HdVWhma5A?c(iJ6RJsOMjB|BuPe+k^x?TOHe z(6ac~;$PgKxIf2`7kwxCj(f9vbGNKphAqLC@bmb2uGy~H6b^-hgK;nyA)Xu0RR|P< z)=RCIM#@IYR%%yjU$wnzi@FzeZ|9?(k7Nt7g^sn3wI$3FMro)t473ik9(5XZQukH& ztq!dYCB=|pwv)G$lWEB`B9qAMhx(y>gdxTdBa@m*y_0+=xi6|Os+G`6nDCzPjyoE6 zbnvUeuUrgV3~aS+wKrBaR#xX$=eXnC@eh3;`Z`-WThKM=8sw8HJu5ydp3R=k9_Ng6 zPQj<(Fa$Ig&9xQS3P#1F;+E2u()ybEnv~X*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