| 1394 /* Set our text entry */ |
1395 /* Set our text entry */ |
| 1395 gtk_entry_set_text(GTK_ENTRY(sndent[snd]), sound_file[snd]); |
1396 gtk_entry_set_text(GTK_ENTRY(sndent[snd]), sound_file[snd]); |
| 1396 |
1397 |
| 1397 /* Close the window! It's getting cold in here! */ |
1398 /* Close the window! It's getting cold in here! */ |
| 1398 close_sounddialog(NULL, sounddialog); |
1399 close_sounddialog(NULL, sounddialog); |
| |
1400 |
| |
1401 if (last_sound_dir) |
| |
1402 g_free(last_sound_dir); |
| |
1403 last_sound_dir = g_dirname(sound_file[snd]); |
| 1399 } |
1404 } |
| 1400 |
1405 |
| 1401 static void reset_sound(GtkWidget *button, int snd) |
1406 static void reset_sound(GtkWidget *button, int snd) |
| 1402 { |
1407 { |
| 1403 |
1408 |
| 1407 gtk_entry_set_text(GTK_ENTRY(sndent[snd]), "(default)"); |
1412 gtk_entry_set_text(GTK_ENTRY(sndent[snd]), "(default)"); |
| 1408 } |
1413 } |
| 1409 |
1414 |
| 1410 static void sel_sound(GtkWidget *button, int snd) |
1415 static void sel_sound(GtkWidget *button, int snd) |
| 1411 { |
1416 { |
| 1412 |
|
| 1413 char *buf = g_malloc(BUF_LEN); |
1417 char *buf = g_malloc(BUF_LEN); |
| 1414 |
1418 |
| 1415 if (!sounddialog) { |
1419 if (!sounddialog) { |
| 1416 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
1420 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
| 1417 |
1421 |
| 1418 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); |
1422 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); |
| 1419 |
1423 |
| 1420 g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME")); |
1424 g_snprintf(buf, BUF_LEN - 1, "%s/", last_sound_dir ? last_sound_dir : g_get_home_dir()); |
| 1421 |
1425 |
| 1422 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); |
1426 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); |
| 1423 |
1427 |
| 1424 gtk_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
1428 gtk_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
| 1425 GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
1429 GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |