Mercurial > pidgin
comparison src/dialogs.c @ 7107:9220c7490cd1
[gaim-migrate @ 7672]
This is a big one: normalize() -> gaim_normalize, linkify_text() ->
gaim_markup_linkify(), gaim_get_size_string() -> gaim_str_size_to_units(),
and moved clean_pid() to main.c.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 01 Oct 2003 06:17:28 +0000 |
parents | 770233dad86c |
children | 6faeeecab0dc |
comparison
equal
deleted
inserted
replaced
7106:db6bd3e794d8 | 7107:9220c7490cd1 |
---|---|
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(normalize(gtk_entry_get_text(GTK_ENTRY(info->entry)))); | 556 who = g_strdup(gaim_normalize(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(), normalize(c->name)); | 969 gaim_home_dir(), gaim_normalize(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", |
1874 char *tmp; | 1874 char *tmp; |
1875 | 1875 |
1876 name = g_object_get_data(G_OBJECT(filesel), "name"); | 1876 name = g_object_get_data(G_OBJECT(filesel), "name"); |
1877 tmp = gaim_user_dir(); | 1877 tmp = gaim_user_dir(); |
1878 g_snprintf(filename, PATHSIZE, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, | 1878 g_snprintf(filename, PATHSIZE, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, |
1879 name ? normalize(name) : "system", name ? ".log" : ""); | 1879 name ? gaim_normalize(name) : "system", name ? ".log" : ""); |
1880 | 1880 |
1881 file = (const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); | 1881 file = (const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); |
1882 strncpy(path, file, PATHSIZE - 1); | 1882 strncpy(path, file, PATHSIZE - 1); |
1883 if (gaim_gtk_check_if_dir(path, GTK_FILE_SELECTION(filesel))) | 1883 if (gaim_gtk_check_if_dir(path, GTK_FILE_SELECTION(filesel))) |
1884 return; | 1884 return; |
1912 { | 1912 { |
1913 GtkWidget *filesel; | 1913 GtkWidget *filesel; |
1914 gchar buf[BUF_LEN]; | 1914 gchar buf[BUF_LEN]; |
1915 | 1915 |
1916 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S "%s%s", gaim_home_dir(), | 1916 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S "%s%s", gaim_home_dir(), |
1917 name ? normalize(name) : "system", name ? ".log" : ""); | 1917 name ? gaim_normalize(name) : "system", name ? ".log" : ""); |
1918 | 1918 |
1919 filesel = gtk_file_selection_new(_("Save Log File")); | 1919 filesel = gtk_file_selection_new(_("Save Log File")); |
1920 g_signal_connect(G_OBJECT(filesel), "delete_event", | 1920 g_signal_connect(G_OBJECT(filesel), "delete_event", |
1921 G_CALLBACK(destroy_dialog), filesel); | 1921 G_CALLBACK(destroy_dialog), filesel); |
1922 | 1922 |
1941 GtkWidget *window; | 1941 GtkWidget *window; |
1942 char *tmp; | 1942 char *tmp; |
1943 | 1943 |
1944 tmp = gaim_user_dir(); | 1944 tmp = gaim_user_dir(); |
1945 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, | 1945 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s%s", tmp, |
1946 name ? normalize(name) : "system", name ? ".log" : ""); | 1946 name ? gaim_normalize(name) : "system", name ? ".log" : ""); |
1947 | 1947 |
1948 if ((remove(filename)) == -1) { | 1948 if ((remove(filename)) == -1) { |
1949 g_snprintf(buf, 256, _("Couldn't remove file %s." ), filename); | 1949 g_snprintf(buf, 256, _("Couldn't remove file %s." ), filename); |
1950 gaim_notify_error(NULL, NULL, buf, strerror(errno)); | 1950 gaim_notify_error(NULL, NULL, buf, strerror(errno)); |
1951 } | 1951 } |
2010 | 2010 |
2011 string = g_string_new(""); | 2011 string = g_string_new(""); |
2012 | 2012 |
2013 if (view->name) { | 2013 if (view->name) { |
2014 char *tmp = gaim_user_dir(); | 2014 char *tmp = gaim_user_dir(); |
2015 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, normalize(view->name)); | 2015 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, gaim_normalize(view->name)); |
2016 } else { | 2016 } else { |
2017 char *tmp = gaim_user_dir(); | 2017 char *tmp = gaim_user_dir(); |
2018 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "system", tmp); | 2018 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "system", tmp); |
2019 } | 2019 } |
2020 if ((fp = fopen(filename, "r")) == NULL) { | 2020 if ((fp = fopen(filename, "r")) == NULL) { |
2186 hbox = gtk_hbox_new(FALSE, 5); | 2186 hbox = gtk_hbox_new(FALSE, 5); |
2187 gtk_box_pack_start(GTK_BOX(box), hbox, TRUE, TRUE, 0); | 2187 gtk_box_pack_start(GTK_BOX(box), hbox, TRUE, TRUE, 0); |
2188 | 2188 |
2189 if (name) { | 2189 if (name) { |
2190 char *tmp = gaim_user_dir(); | 2190 char *tmp = gaim_user_dir(); |
2191 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, normalize(name)); | 2191 g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, gaim_normalize(name)); |
2192 if ((fp = fopen(filename, "r")) == NULL) { | 2192 if ((fp = fopen(filename, "r")) == NULL) { |
2193 g_snprintf(buf, BUF_LONG, _("Couldn't open log file %s."), filename); | 2193 g_snprintf(buf, BUF_LONG, _("Couldn't open log file %s."), filename); |
2194 gaim_notify_error(NULL, NULL, buf, strerror(errno)); | 2194 gaim_notify_error(NULL, NULL, buf, strerror(errno)); |
2195 return; | 2195 return; |
2196 } | 2196 } |