Mercurial > pidgin.yaz
comparison src/dialogs.c @ 1035:80a47e3b1bca
[gaim-migrate @ 1045]
thanks to bmiller for yet another patch ;)
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 31 Oct 2000 07:36:11 +0000 |
parents | 643a4d81c18a |
children | faa5afc2b89e |
comparison
equal
deleted
inserted
replaced
1034:1d43fda97960 | 1035:80a47e3b1bca |
---|---|
64 #include "pixmaps/tongue.xpm" | 64 #include "pixmaps/tongue.xpm" |
65 #include "pixmaps/wink.xpm" | 65 #include "pixmaps/wink.xpm" |
66 #include "pixmaps/yell.xpm" | 66 #include "pixmaps/yell.xpm" |
67 | 67 |
68 #define DEFAULT_FONT_NAME "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1" | 68 #define DEFAULT_FONT_NAME "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1" |
69 | |
70 #define PATHSIZE 1024 | |
69 | 71 |
70 int smiley_array[FACE_TOTAL]; | 72 int smiley_array[FACE_TOTAL]; |
71 GdkColor bgcolor; | 73 GdkColor bgcolor; |
72 GdkColor fgcolor; | 74 GdkColor fgcolor; |
73 | 75 |
1860 | 1862 |
1861 void do_log(GtkWidget *w, struct conversation *c) | 1863 void do_log(GtkWidget *w, struct conversation *c) |
1862 { | 1864 { |
1863 struct log_conversation *l; | 1865 struct log_conversation *l; |
1864 char buf[128]; | 1866 char buf[128]; |
1867 char *file; | |
1868 char path[PATHSIZE]; | |
1865 | 1869 |
1866 if (!find_log_info(c->name)) { | 1870 if (!find_log_info(c->name)) { |
1871 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->log_dialog)); | |
1872 strncpy( path, file, PATHSIZE - 1 ); | |
1873 if (file_is_dir(path, c->log_dialog)) { | |
1874 return; | |
1875 } | |
1876 | |
1867 l = (struct log_conversation *)g_new0(struct log_conversation, 1); | 1877 l = (struct log_conversation *)g_new0(struct log_conversation, 1); |
1868 strcpy(l->name, c->name); | 1878 strcpy(l->name, c->name); |
1869 strcpy(l->filename, gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->log_dialog))); | 1879 strcpy(l->filename, file); |
1870 log_conversations = g_list_append(log_conversations, l); | 1880 log_conversations = g_list_append(log_conversations, l); |
1871 | 1881 |
1872 if (c != NULL) | 1882 if (c != NULL) |
1873 { | 1883 { |
1874 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name); | 1884 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name); |
2621 | 2631 |
2622 /*------------------------------------------------------------------------*/ | 2632 /*------------------------------------------------------------------------*/ |
2623 /* The dialog for import/export */ | 2633 /* The dialog for import/export */ |
2624 /*------------------------------------------------------------------------*/ | 2634 /*------------------------------------------------------------------------*/ |
2625 | 2635 |
2626 #define PATHSIZE 1024 | |
2627 | |
2628 /* see if a buddy list cache file for this user exists */ | 2636 /* see if a buddy list cache file for this user exists */ |
2629 | 2637 |
2630 gboolean | 2638 gboolean |
2631 bud_list_cache_exists(struct gaim_connection *gc) | 2639 bud_list_cache_exists(struct gaim_connection *gc) |
2632 { | 2640 { |
2668 char path[PATHSIZE]; | 2676 char path[PATHSIZE]; |
2669 | 2677 |
2670 if ( show_dialog == 1 ) { | 2678 if ( show_dialog == 1 ) { |
2671 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(exportdialog)); | 2679 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(exportdialog)); |
2672 strncpy( path, file, PATHSIZE - 1 ); | 2680 strncpy( path, file, PATHSIZE - 1 ); |
2681 if (file_is_dir(path, exportdialog)) { | |
2682 g_free (buf); | |
2683 return; | |
2684 } | |
2673 if ((f = fopen(path,"w"))) { | 2685 if ((f = fopen(path,"w"))) { |
2674 toc_build_config(connections->data, buf, 8192 - 1, TRUE); | 2686 toc_build_config(connections->data, buf, 8192 - 1, TRUE); |
2675 fprintf(f, "%s\n", buf); | 2687 fprintf(f, "%s\n", buf); |
2676 fclose(f); | 2688 fclose(f); |
2677 chmod(buf, S_IRUSR | S_IWUSR); | 2689 chmod(buf, S_IRUSR | S_IWUSR); |
2770 FILE *f; | 2782 FILE *f; |
2771 | 2783 |
2772 if ( !gc ) { | 2784 if ( !gc ) { |
2773 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); | 2785 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); |
2774 strncpy( path, file, PATHSIZE - 1 ); | 2786 strncpy( path, file, PATHSIZE - 1 ); |
2787 if (file_is_dir(path, importdialog)) { | |
2788 g_free (buf); | |
2789 g_free (first); | |
2790 return; | |
2791 } | |
2775 } | 2792 } |
2776 else { | 2793 else { |
2777 for (i = 0; i < strlen(gc->username); i++) | 2794 for (i = 0; i < strlen(gc->username); i++) |
2778 g_screenname[i] = toupper(gc->username[i]); | 2795 g_screenname[i] = toupper(gc->username[i]); |
2779 g_screenname[i] = '\0'; | 2796 g_screenname[i] = '\0'; |