Mercurial > pidgin.yaz
comparison src/dialogs.c @ 7261:1930e3d00ecd
[gaim-migrate @ 7838]
prpl-specific normalize is back, after my crusade to kill it.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 14 Oct 2003 05:07:39 +0000 |
parents | 747b9e00ef60 |
children | 5500f20a4331 |
comparison
equal
deleted
inserted
replaced
7260:49839c4cbb1c | 7261:1930e3d00ecd |
---|---|
551 static void do_info(GtkWidget *widget, int resp, struct getuserinfo *info) | 551 static void do_info(GtkWidget *widget, int resp, struct getuserinfo *info) |
552 { | 552 { |
553 char *who; | 553 char *who; |
554 | 554 |
555 if (resp == GTK_RESPONSE_OK) { | 555 if (resp == GTK_RESPONSE_OK) { |
556 who = g_strdup(gaim_normalize(gtk_entry_get_text(GTK_ENTRY(info->entry)))); | 556 who = g_strdup(gaim_normalize(info->gc->account, gtk_entry_get_text(GTK_ENTRY(info->entry)))); |
557 | 557 |
558 if (!g_ascii_strcasecmp(who, "")) { | 558 if (!g_ascii_strcasecmp(who, "")) { |
559 g_free(who); | 559 g_free(who); |
560 return; | 560 return; |
561 } | 561 } |
964 | 964 |
965 gtk_file_selection_hide_fileop_buttons( | 965 gtk_file_selection_hide_fileop_buttons( |
966 GTK_FILE_SELECTION(gtkconv->dialogs.log)); | 966 GTK_FILE_SELECTION(gtkconv->dialogs.log)); |
967 | 967 |
968 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S "%s.log", | 968 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S "%s.log", |
969 gaim_home_dir(), gaim_normalize(c->name)); | 969 gaim_home_dir(), gaim_normalize(c->account, c->name)); |
970 g_object_set_data(G_OBJECT(gtkconv->dialogs.log), "dialog_type", | 970 g_object_set_data(G_OBJECT(gtkconv->dialogs.log), "dialog_type", |
971 "log dialog"); | 971 "log dialog"); |
972 gtk_file_selection_set_filename(GTK_FILE_SELECTION(gtkconv->dialogs.log), | 972 gtk_file_selection_set_filename(GTK_FILE_SELECTION(gtkconv->dialogs.log), |
973 buf); | 973 buf); |
974 g_signal_connect(G_OBJECT(gtkconv->dialogs.log), "delete_event", | 974 g_signal_connect(G_OBJECT(gtkconv->dialogs.log), "delete_event", |
1891 char *tmp; | 1891 char *tmp; |
1892 | 1892 |
1893 name = g_object_get_data(G_OBJECT(filesel), "name"); | 1893 name = g_object_get_data(G_OBJECT(filesel), "name"); |
1894 tmp = gaim_user_dir(); | 1894 tmp = gaim_user_dir(); |
1895 g_snprintf(filename, PATHSIZE, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, | 1895 g_snprintf(filename, PATHSIZE, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, |
1896 name ? gaim_normalize(name) : "system", name ? ".log" : ""); | 1896 name ? gaim_normalize(NULL, name) : "system", name ? ".log" : ""); |
1897 | 1897 |
1898 file = (const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); | 1898 file = (const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); |
1899 strncpy(path, file, PATHSIZE - 1); | 1899 strncpy(path, file, PATHSIZE - 1); |
1900 if (gaim_gtk_check_if_dir(path, GTK_FILE_SELECTION(filesel))) | 1900 if (gaim_gtk_check_if_dir(path, GTK_FILE_SELECTION(filesel))) |
1901 return; | 1901 return; |
1929 { | 1929 { |
1930 GtkWidget *filesel; | 1930 GtkWidget *filesel; |
1931 gchar buf[BUF_LEN]; | 1931 gchar buf[BUF_LEN]; |
1932 | 1932 |
1933 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S "%s%s", gaim_home_dir(), | 1933 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S "%s%s", gaim_home_dir(), |
1934 name ? gaim_normalize(name) : "system", name ? ".log" : ""); | 1934 name ? gaim_normalize(NULL, name) : "system", name ? ".log" : ""); |
1935 | 1935 |
1936 filesel = gtk_file_selection_new(_("Save Log File")); | 1936 filesel = gtk_file_selection_new(_("Save Log File")); |
1937 g_signal_connect(G_OBJECT(filesel), "delete_event", | 1937 g_signal_connect(G_OBJECT(filesel), "delete_event", |
1938 G_CALLBACK(destroy_dialog), filesel); | 1938 G_CALLBACK(destroy_dialog), filesel); |
1939 | 1939 |
1958 GtkWidget *window; | 1958 GtkWidget *window; |
1959 char *tmp; | 1959 char *tmp; |
1960 | 1960 |
1961 tmp = gaim_user_dir(); | 1961 tmp = gaim_user_dir(); |
1962 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, | 1962 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, |
1963 name ? gaim_normalize(name) : "system", name ? ".log" : ""); | 1963 name ? gaim_normalize(NULL, name) : "system", name ? ".log" : ""); |
1964 | 1964 |
1965 if ((remove(filename)) == -1) { | 1965 if ((remove(filename)) == -1) { |
1966 g_snprintf(buf, 256, _("Couldn't remove file %s." ), filename); | 1966 g_snprintf(buf, 256, _("Couldn't remove file %s." ), filename); |
1967 gaim_notify_error(NULL, NULL, buf, strerror(errno)); | 1967 gaim_notify_error(NULL, NULL, buf, strerror(errno)); |
1968 } | 1968 } |
2027 | 2027 |
2028 string = g_string_new(""); | 2028 string = g_string_new(""); |
2029 | 2029 |
2030 if (view->name) { | 2030 if (view->name) { |
2031 char *tmp = gaim_user_dir(); | 2031 char *tmp = gaim_user_dir(); |
2032 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, gaim_normalize(view->name)); | 2032 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, gaim_normalize(NULL, view->name)); |
2033 } else { | 2033 } else { |
2034 char *tmp = gaim_user_dir(); | 2034 char *tmp = gaim_user_dir(); |
2035 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "system", tmp); | 2035 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "system", tmp); |
2036 } | 2036 } |
2037 if ((fp = fopen(filename, "r")) == NULL) { | 2037 if ((fp = fopen(filename, "r")) == NULL) { |
2203 hbox = gtk_hbox_new(FALSE, 5); | 2203 hbox = gtk_hbox_new(FALSE, 5); |
2204 gtk_box_pack_start(GTK_BOX(box), hbox, TRUE, TRUE, 0); | 2204 gtk_box_pack_start(GTK_BOX(box), hbox, TRUE, TRUE, 0); |
2205 | 2205 |
2206 if (name) { | 2206 if (name) { |
2207 char *tmp = gaim_user_dir(); | 2207 char *tmp = gaim_user_dir(); |
2208 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, gaim_normalize(name)); | 2208 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, gaim_normalize(NULL, name)); |
2209 if ((fp = fopen(filename, "r")) == NULL) { | 2209 if ((fp = fopen(filename, "r")) == NULL) { |
2210 g_snprintf(buf, BUF_LONG, _("Couldn't open log file %s."), filename); | 2210 g_snprintf(buf, BUF_LONG, _("Couldn't open log file %s."), filename); |
2211 gaim_notify_error(NULL, NULL, buf, strerror(errno)); | 2211 gaim_notify_error(NULL, NULL, buf, strerror(errno)); |
2212 return; | 2212 return; |
2213 } | 2213 } |