Mercurial > pidgin.yaz
comparison src/prefs.c @ 2471:612efbf62c35
[gaim-migrate @ 2484]
hi.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 10 Oct 2001 00:26:26 +0000 |
parents | bdc74764245c |
children | 0e0a54e5819a |
comparison
equal
deleted
inserted
replaced
2470:116ec6e7e0ed | 2471:612efbf62c35 |
---|---|
1354 gtk_widget_show(prefdialog); | 1354 gtk_widget_show(prefdialog); |
1355 } | 1355 } |
1356 | 1356 |
1357 static GtkWidget *sndent[NUM_SOUNDS]; | 1357 static GtkWidget *sndent[NUM_SOUNDS]; |
1358 static GtkWidget *sndcmd = NULL; | 1358 static GtkWidget *sndcmd = NULL; |
1359 static char *last_sound_dir = NULL; | |
1359 | 1360 |
1360 void close_sounddialog(GtkWidget *w, GtkWidget *w2) | 1361 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1361 { | 1362 { |
1362 | 1363 |
1363 GtkWidget *dest; | 1364 GtkWidget *dest; |
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); |