From 059e4ec9c8d59f6b283bda3f007ae9d2fd29bc83 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 14 Apr 2013 10:30:51 +0200 Subject: 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 00000000..099370f9 Binary files /dev/null and b/win32/copy/share/beep.wav differ diff --git a/win32/installer/hexchat-x64.skel.iss b/win32/installer/hexchat-x64.skel.iss index 38337619..7c21eb2d 100644 --- a/win32/installer/hexchat-x64.skel.iss +++ b/win32/installer/hexchat-x64.skel.iss @@ -85,6 +85,8 @@ 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\beep.wav"; DestDir: "{app}\share"; Flags: ignoreversion; Components: libs + Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations Source: "atk-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs diff --git a/win32/installer/hexchat-x86.skel.iss b/win32/installer/hexchat-x86.skel.iss index 40834499..1ea4fed5 100644 --- a/win32/installer/hexchat-x86.skel.iss +++ b/win32/installer/hexchat-x86.skel.iss @@ -84,6 +84,8 @@ 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\beep.wav"; DestDir: "{app}\share"; Flags: ignoreversion; Components: libs + Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations Source: "atk-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs -- cgit 1.4.1