comparison src/sound.c @ 5436:ad445074d239

[gaim-migrate @ 5818] Another big commit. Ugh. I need a very smart regexp. Core/UI split do_error_dialog(), and soon the mail dialogs! Yay! This should work without problems at all, but standard disclaimer.. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 18 May 2003 19:59:02 +0000
parents eae93f3e46bd
children 7a64114641c3
comparison
equal deleted inserted replaced
5435:a2f26666de42 5436:ad445074d239
47 #include <audio/soundlib.h> 47 #include <audio/soundlib.h>
48 #endif /* USE_NAS_AUDIO */ 48 #endif /* USE_NAS_AUDIO */
49 49
50 #include "gaim.h" 50 #include "gaim.h"
51 #include "sound.h" 51 #include "sound.h"
52 #include "notify.h"
52 53
53 #ifdef _WIN32 54 #ifdef _WIN32
54 #include "win32dep.h" 55 #include "win32dep.h"
55 #endif 56 #endif
56 57
179 return; 180 return;
180 } 181 }
181 182
182 if (!g_file_test(filename, G_FILE_TEST_EXISTS)) { 183 if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
183 char *tmp = g_strdup_printf(_("Unable to play sound because the chosen file (%s) does not exist."), filename); 184 char *tmp = g_strdup_printf(_("Unable to play sound because the chosen file (%s) does not exist."), filename);
184 do_error_dialog(tmp, NULL, GAIM_ERROR); 185 gaim_notify_error(NULL, NULL, tmp, NULL);
185 g_free(tmp); 186 g_free(tmp);
186 return; 187 return;
187 } 188 }
188 189
189 #ifndef _WIN32 190 #ifndef _WIN32
190 if ((sound_options & OPT_SOUND_CMD)) { 191 if ((sound_options & OPT_SOUND_CMD)) {
191 char *command; 192 char *command;
192 GError *error = NULL; 193 GError *error = NULL;
193 194
194 if(!sound_cmd) { 195 if(!sound_cmd) {
195 do_error_dialog(_("Unable to play sound because the 'Command' sound method has been chosen, but no command has been set."), NULL, GAIM_ERROR); 196 gaim_notify_error(NULL, NULL,
197 _("Unable to play sound because the "
198 "'Command' sound method has been chosen, "
199 "but no command has been set."), NULL);
196 return; 200 return;
197 } 201 }
198 202
199 command = g_strdup_printf(sound_cmd, filename); 203 command = g_strdup_printf(sound_cmd, filename);
200 204
201 if(!g_spawn_command_line_async(command, &error)) { 205 if(!g_spawn_command_line_async(command, &error)) {
202 char *tmp = g_strdup_printf(_("Unable to play sound because the configured sound command could not be launched: %s"), error->message); 206 char *tmp = g_strdup_printf(_("Unable to play sound because the configured sound command could not be launched: %s"), error->message);
203 do_error_dialog(tmp, NULL, GAIM_ERROR); 207 gaim_notify_error(NULL, NULL, tmp, NULL);
204 g_free(tmp); 208 g_free(tmp);
205 g_error_free(error); 209 g_error_free(error);
206 } 210 }
207 211
208 g_free(command); 212 g_free(command);