Mercurial > pidgin.yaz
changeset 5436:ad445074d239
[gaim-migrate @ 5818]
Another big commit. Ugh. I need a very smart regexp.
Core/UI split do_error_dialog(), and soon the mail dialogs! Yay! This
should work without problems at all, but standard disclaimer..
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 18 May 2003 19:59:02 +0000 |
parents | a2f26666de42 |
children | 0031a613a87d |
files | plugins/notify.c plugins/perl/perl.c src/Makefile.am src/blist.c src/browser.c src/buddy_chat.c src/conversation.c src/core.h src/dialogs.c src/ft.c src/gaim.h src/gaimrc.c src/gtkconv.c src/gtkft.c src/gtkpounce.c src/gtkutils.c src/log.c src/main.c src/multi.c src/plugin.c src/prefs.c src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/msn/error.c src/protocols/msn/error.h src/protocols/msn/msn.c src/protocols/msn/notification.c src/protocols/msn/servconn.c src/protocols/msn/switchboard.c src/protocols/napster/napster.c src/protocols/oscar/oscar.c src/protocols/toc/toc.c src/protocols/yahoo/yahoo.c src/protocols/zephyr/zephyr.c src/prpl.c src/server.c src/sound.c |
diffstat | 38 files changed, 405 insertions(+), 291 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/notify.c Sun May 18 19:13:21 2003 +0000 +++ b/plugins/notify.c Sun May 18 19:59:02 2003 +0000 @@ -49,6 +49,8 @@ #define METHOD_URGENT 0x00000004 #define METHOD_COUNT 0x00000008 +static GaimPlugin *my_plugin = NULL; + void *handle; GtkWidget *Entry; gchar *title_string; @@ -436,7 +438,9 @@ snprintf(buf, 1000, "%s/.gaim/.notify", getenv("HOME")); if (!(fp = fopen(buf, "w"))) { - do_error_dialog(_("Unable to write to config file"), _("Notify plugin"), GAIM_ERROR); + gaim_notify_error(my_plugin, NULL, + _("Unable to write to config file"), + _("Notify plugin")); return; } @@ -712,6 +716,7 @@ static void __init_plugin(GaimPlugin *plugin) { + my_plugin = plugin; } GAIM_INIT_PLUGIN(notify, __init_plugin, info);
--- a/plugins/perl/perl.c Sun May 18 19:13:21 2003 +0000 +++ b/plugins/perl/perl.c Sun May 18 19:59:02 2003 +0000 @@ -107,6 +107,7 @@ GaimPlugin *plug; }; +static GaimPlugin *my_plugin = NULL; static GList *perl_list = NULL; static GList *perl_timeout_handlers = NULL; static GList *perl_event_handlers = NULL; @@ -658,7 +659,7 @@ title = SvPV(ST(0), junk); message = SvPV(ST(1), junk); - do_error_dialog(title, message, GAIM_INFO); + gaim_dialog_info(my_plugin, NULL, title, message); XSRETURN(0); } @@ -1392,6 +1393,8 @@ static void __init_plugin(GaimPlugin *plugin) { + my_plugin = plugin; + loader_info.exts = g_list_append(loader_info.exts, "pl"); }
--- a/src/Makefile.am Sun May 18 19:13:21 2003 +0000 +++ b/src/Makefile.am Sun May 18 19:59:02 2003 +0000 @@ -18,6 +18,8 @@ event.h \ ft.c \ ft.h \ + notify.c \ + notify.h \ plugin.c \ plugin.h \ pounce.c \ @@ -59,6 +61,8 @@ gtkft.h \ gtkimhtml.c \ gtkimhtml.h \ + gtknotify.c \ + gtknotify.h \ gtkplugin.c \ gtkplugin.h \ gtkpounce.c \
--- a/src/blist.c Sun May 18 19:13:21 2003 +0000 +++ b/src/blist.c Sun May 18 19:59:02 2003 +0000 @@ -36,6 +36,7 @@ #include "gaim.h" #include "prpl.h" #include "blist.h" +#include "notify.h" #ifdef _WIN32 #include "win32dep.h" @@ -678,7 +679,8 @@ "removed because their accounts were not logged in. These " "buddies, and the group were not removed.\n"), count, group->name); - do_error_dialog(_("Group Not Removed"), buf, GAIM_ERROR); + + gaim_notify_error(NULL, NULL, _("Group not removed"), NULL); g_free(buf); return; } @@ -1569,7 +1571,7 @@ if(!gaim_blist_read(filename)) { msg = g_strdup_printf(_("An error was encountered parsing your " "buddy list. It has not been loaded.")); - do_error_dialog(_("Buddy List Error"), msg, GAIM_ERROR); + gaim_notify_error(NULL, NULL, _("Buddy List Error"), msg); g_free(msg); } } else if(g_slist_length(gaim_accounts)) { @@ -1578,7 +1580,7 @@ msg = g_strdup_printf(_("Gaim is converting your old buddy lists " "to a new format, which will now be located at %s"), filename); - do_error_dialog(_("Converting Buddy List"), msg, GAIM_INFO); + gaim_notify_info(NULL, NULL, _("Converting Buddy List"), msg); g_free(msg); /* now, let gtk actually display the dialog before we start anything */
--- a/src/browser.c Sun May 18 19:13:21 2003 +0000 +++ b/src/browser.c Sun May 18 19:59:02 2003 +0000 @@ -49,6 +49,7 @@ #include <gtk/gtk.h> #include <gdk/gdkprivate.h> #include "gaim.h" +#include "notify.h" #ifndef _WIN32 @@ -424,8 +425,9 @@ unsigned char *data = 0; if (window == NULL || GDK_WINDOW_OBJECT(window)->destroyed) { - do_error_dialog(_("Communication with the browser failed. Please close all " - "windows and try again."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Communication with the browser failed. " + "Please close all windows and try again."), NULL); gaim_debug(GAIM_DEBUG_WARNING, "browser", "netscape_response_cb called with NULL window.\n"); return GDK_FILTER_CONTINUE; @@ -451,8 +453,9 @@ &data) != Success || data == NULL || (data[0] != '1' && data[0] != '2')) { - do_error_dialog(_("Communication with the browser failed. Please close all " - "windows and try again."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Communication with the browser failed. " + "Please close all windows and try again."), NULL); } if (data[0] == '1') { @@ -584,7 +587,11 @@ char *space_free_url = NULL; if (!web_command[0]) { - do_error_dialog(_("Unable to launch your browser because the 'Manual' browser command has been chosen, but no command has been set."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Unable to launch your browser because " + "the 'Manual' browser command has been " + "chosen, but no command has been set."), + NULL); return; } @@ -600,7 +607,7 @@ if (g_spawn_command_line_async(command, &error) == FALSE) { char *tmp = g_strdup_printf(_("There was an error launching your chosen browser: %s"), error->message); - do_error_dialog(tmp, NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, tmp, NULL); g_free(tmp); g_error_free(error); }
--- a/src/buddy_chat.c Sun May 18 19:13:21 2003 +0000 +++ b/src/buddy_chat.c Sun May 18 19:59:02 2003 +0000 @@ -32,6 +32,7 @@ #include "gtkimhtml.h" #include "prpl.h" +#include "notify.h" #ifdef _WIN32 #include "wspell.h" @@ -245,9 +246,10 @@ } if (gc == NULL) { - do_error_dialog( - _("You are not currently signed on with any protocols that have " - "the ability to chat."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("You are not currently signed on wit any " + "protocols that have the ability to chat."), + NULL); return; }
--- a/src/conversation.c Sun May 18 19:13:21 2003 +0000 +++ b/src/conversation.c Sun May 18 19:59:02 2003 +0000 @@ -31,6 +31,7 @@ #include "conversation.h" #include "gaim.h" #include "prpl.h" +#include "notify.h" #ifdef _WIN32 #include "win32dep.h" @@ -399,16 +400,16 @@ if (err < 0) { if (err == -E2BIG) { - do_error_dialog(_("Unable to send message. " - "The message is too large."), NULL, - GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Unable to send message. The message is " + "too large."), NULL); } else if (err == -ENOTCONN) { gaim_debug(GAIM_DEBUG_ERROR, "conversation", "Not yet connected.\n"); } else { - do_error_dialog(_("Unable to send message."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, _("Unable to send message."), NULL); } } else {
--- a/src/core.h Sun May 18 19:13:21 2003 +0000 +++ b/src/core.h Sun May 18 19:59:02 2003 +0000 @@ -56,6 +56,7 @@ #include "privacy.h" #include "plugin.h" #include "event.h" +#include "notify.h" /* Really user states are controlled by the PRPLs now. We just use this for event_away */ #define UC_UNAVAILABLE 1
--- a/src/dialogs.c Sun May 18 19:13:21 2003 +0000 +++ b/src/dialogs.c Sun May 18 19:59:02 2003 +0000 @@ -49,6 +49,7 @@ #include "gtkimhtml.h" #include "prpl.h" #include "gtkblist.h" +#include "notify.h" #ifdef _WIN32 #include "win32dep.h" @@ -486,66 +487,6 @@ /*------------------------------------------------------------------------*/ /* The dialog for getting an error */ /*------------------------------------------------------------------------*/ - -GtkWidget *do_error_dialog(const char *primary, const char *secondary, int type) -{ - GtkWidget *d; - GtkWidget *label; - GtkWidget *img = NULL; - GtkWidget *hbox; - char labeltext[1024 * 2]; - const char *name = NULL; - - /* These are the GTK stock dialog icons with our little Gaim logo on top. - * Inspired by the GIMP. */ - switch (type){ - case GAIM_LOGO: - name = GAIM_STOCK_ICON_ONLINE; - break; - case GAIM_INFO: - name = GAIM_STOCK_DIALOG_INFO; - break; - case GAIM_WARNING: - name = GAIM_STOCK_DIALOG_WARNING; - break; - case GAIM_ERROR: - name = GAIM_STOCK_DIALOG_ERROR; - break; - } - - if (name) { - img = gtk_image_new_from_stock(name, GTK_ICON_SIZE_DIALOG); - gtk_misc_set_alignment(GTK_MISC(img), 0, 0); - } - - d = gtk_dialog_new_with_buttons("", NULL, 0, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); - g_signal_connect(d, "response", G_CALLBACK(gtk_widget_destroy), NULL); - - gtk_container_set_border_width (GTK_CONTAINER(d), 6); - gtk_window_set_resizable(GTK_WINDOW(d), FALSE); - gtk_dialog_set_has_separator(GTK_DIALOG(d), FALSE); - gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(d)->vbox), 12); - gtk_container_set_border_width (GTK_CONTAINER(GTK_DIALOG(d)->vbox), 6); - - hbox = gtk_hbox_new(FALSE, 12); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(d)->vbox), hbox); - if (img) { - gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); - } - - g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s", primary, secondary ? secondary : ""); - - label = gtk_label_new(NULL); - gtk_label_set_markup(GTK_LABEL(label), labeltext); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - - gtk_widget_show_all(d); - - return d; -} - static void do_im(GtkWidget *widget, int resp, struct getuserinfo *info) { const char *who; @@ -1401,10 +1342,10 @@ } if (!ac->account) { - do_error_dialog( - _("You are not currently signed on with any protocols " - "that have the ability to chat."), NULL, GAIM_ERROR); - return; + gaim_notify_error(NULL, NULL, + _("You are not currently signed on with any " + "protocols that have the ability to chat."), NULL); + return; } ac->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); @@ -2159,12 +2100,14 @@ new2 = gtk_entry_get_text(GTK_ENTRY(b->new2)); if (g_utf8_collate(new1, new2)) { - do_error_dialog(_("New Passwords Do Not Match"), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("New passwords do not match."), NULL); return; } if ((strlen(orig) < 1) || (strlen(new1) < 1) || (strlen(new2) < 1)) { - do_error_dialog(_("Fill out all fields completely"), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Fill out all fields completely."), NULL); return; } @@ -3311,9 +3254,11 @@ char *msg; if ((strlen(gtk_entry_get_text(GTK_ENTRY(ca->entry))) == 0) && (type == 1)) { /* We shouldn't allow a blank title */ - do_error_dialog(_("You cannot save an away message with a blank title"), - _("Please give the message a title, or choose \"Use\" to use " - "without saving."), GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("You cannot save an away message with a " + "blank title"), + _("Please give the message a title, or choose " + "\"Use\" to use without saving.")); return 0; } @@ -3321,7 +3266,8 @@ if (!msg && (type <= 1)) { /* We shouldn't allow a blank message */ - do_error_dialog(_("You cannot create an empty away message"), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("You cannot create an empty away message"), NULL); return 0; } @@ -3845,14 +3791,14 @@ if ((fp_new = fopen(path, "w")) == NULL) { g_snprintf(error, BUF_LONG, _("Couldn't write to %s."), path); - do_error_dialog(error, strerror(errno), GAIM_ERROR); + gaim_notify_error(NULL, NULL, error, strerror(errno)); return; } if ((fp_old = fopen(filename, "r")) == NULL) { g_snprintf(error, BUF_LONG, _("Couldn't write to %s."), filename); - do_error_dialog(error, strerror(errno), GAIM_ERROR); + gaim_notify_error(NULL, NULL, error, strerror(errno)); fclose(fp_new); return; } @@ -3906,7 +3852,7 @@ if ((remove(filename)) == -1) { g_snprintf(buf, 256, _("Couldn't remove file %s." ), filename); - do_error_dialog(buf, strerror(errno), GAIM_ERROR); + gaim_notify_error(NULL, NULL, buf, strerror(errno)); } window = g_object_get_data(G_OBJECT(w), "log_window"); @@ -3979,7 +3925,7 @@ if ((fp = fopen(filename, "r")) == NULL) { if (view->name) { g_snprintf(buf, BUF_LONG, _("Couldn't open log file %s."), filename); - do_error_dialog(buf, strerror(errno), GAIM_ERROR); + gaim_notify_error(NULL, NULL, buf, strerror(errno)); } /* If the system log doesn't exist.. no message just show empty system log window. That way user knows that the log is empty :) @@ -4141,7 +4087,7 @@ g_snprintf(filename, 256, "%s" G_DIR_SEPARATOR_S "logs" G_DIR_SEPARATOR_S "%s.log", tmp, normalize(name)); if ((fp = fopen(filename, "r")) == NULL) { g_snprintf(buf, BUF_LONG, _("Couldn't open log file %s"), filename); - do_error_dialog(buf, strerror(errno), GAIM_ERROR); + gaim_notify_error(NULL, NULL, buf, strerror(errno)); return; }
--- a/src/ft.c Sun May 18 19:13:21 2003 +0000 +++ b/src/ft.c Sun May 18 19:59:02 2003 +0000 @@ -33,6 +33,7 @@ #include <gtk/gtk.h> #include "gaim.h" #include "proxy.h" +#include "notify.h" static struct gaim_xfer_ui_ops *xfer_ui_ops = NULL; @@ -739,7 +740,7 @@ else title = g_strdup_printf(_("File transfer from %s aborted.\n"), who); - do_error_dialog(title, msg, GAIM_ERROR); + gaim_notify_error(NULL, NULL, title, msg); g_free(title); }
--- a/src/gaim.h Sun May 18 19:13:21 2003 +0000 +++ b/src/gaim.h Sun May 18 19:59:02 2003 +0000 @@ -348,7 +348,6 @@ /* Functions in dialogs.c */ extern void g_show_info_text(struct gaim_connection *, const char *, int, const char *, ...); -extern GtkWidget *do_error_dialog(const char *, const char *, int type); extern void show_change_passwd(struct gaim_connection *); extern void show_set_dir(struct gaim_connection *); extern void show_find_email(struct gaim_connection *);
--- a/src/gaimrc.c Sun May 18 19:13:21 2003 +0000 +++ b/src/gaimrc.c Sun May 18 19:59:02 2003 +0000 @@ -41,6 +41,7 @@ #include "sound.h" #include "pounce.h" #include "gtkpounce.h" +#include "notify.h" #ifdef _WIN32 #include "win32dep.h" @@ -1547,7 +1548,7 @@ } } else if (opt_rcfile_arg) { g_snprintf(buf, sizeof(buf), _("Could not open config file %s."), opt_rcfile_arg); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, buf, NULL); set_defaults(); } else { set_defaults(); @@ -1603,7 +1604,11 @@ "Error renaming %s to %s\n", filename_temp, filename); } else { fclose(f); - do_error_dialog(_("Unable to Save Preferences"), _("Gaim was unable to save your preferences. Please verify that you have enough free space."), GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Unable to Save Preferences"), + _("Gaim was unable to save your preferences. " + "Please verify that you have enough " + "free space.")); } is_saving_prefs = 0; } else
--- a/src/gtkconv.c Sun May 18 19:13:21 2003 +0000 +++ b/src/gtkconv.c Sun May 18 19:59:02 2003 +0000 @@ -44,6 +44,7 @@ #include "dnd-hints.h" #include "sound.h" #include "gtkblist.h" +#include "notify.h" #ifdef _WIN32 #include "win32dep.h" @@ -235,7 +236,7 @@ } } - static void +static void insert_link_cb(GtkWidget *w, struct gaim_conversation *conv) { struct gaim_gtk_conversation *gtkconv; @@ -3333,9 +3334,6 @@ gaim_window_add_conversation(win, c); } - - /* do_error_dialog("MWAHAHAHA! I AM A TROLL! I AM GOING TO EAT YOU!", - NULL, GAIM_WARNING); */ } /**************************************************************************
--- a/src/gtkft.c Sun May 18 19:13:21 2003 +0000 +++ b/src/gtkft.c Sun May 18 19:59:02 2003 +0000 @@ -28,6 +28,7 @@ #include <string.h> #include "gtkcellrendererprogress.h" #include "gaim-disclosure.h" +#include "notify.h" #define GAIM_GTKXFER(xfer) \ (struct gaim_gtkxfer_ui_data *)(xfer)->ui_data @@ -1006,14 +1007,15 @@ gaim_xfer_request_accepted(xfer, g_strdup(name)); } else { - do_error_dialog(_("That file does not exist."), - NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("That file does not exist."), NULL); gaim_xfer_request_denied(xfer); } } else if ((gaim_xfer_get_type(xfer) == GAIM_XFER_SEND) && (st.st_size == 0)) { - do_error_dialog(_("Can not send a file of 0 bytes."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Cannot send a file of 0 bytes."), NULL); gaim_xfer_request_denied(xfer); }
--- a/src/gtkpounce.c Sun May 18 19:13:21 2003 +0000 +++ b/src/gtkpounce.c Sun May 18 19:59:02 2003 +0000 @@ -27,6 +27,7 @@ #include "gtkblist.h" #include "prpl.h" #include "sound.h" +#include "notify.h" struct gaim_gtkpounce_dialog { @@ -167,7 +168,8 @@ name = gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)); if (*name == '\0') { - do_error_dialog(_("Please enter a buddy to pounce."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Please enter a buddy to pounce."), NULL); return; } @@ -350,7 +352,7 @@ _("Unknown pounce event. Please report this!"), pouncee); - do_error_dialog(tmp, NULL, GAIM_INFO); + gaim_notify_info(NULL, NULL, tmp, NULL); } if (pounce_data->actions & GAIM_GTKPOUNCE_SEND_MSG &&
--- a/src/gtkutils.c Sun May 18 19:13:21 2003 +0000 +++ b/src/gtkutils.c Sun May 18 19:59:02 2003 +0000 @@ -46,6 +46,7 @@ #include <gdk/gdkkeysyms.h> #include "prpl.h" #include "ui.h" +#include "notify.h" #ifdef _WIN32 #include "wspell.h" @@ -279,8 +280,8 @@ fclose(file); } else { - do_error_dialog("Can't save icon file to disk", - strerror(errno), GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Can't save icon file to disk."), NULL); } gtk_widget_destroy(gtkconv->u.im->save_icon);
--- a/src/log.c Sun May 18 19:13:21 2003 +0000 +++ b/src/log.c Sun May 18 19:59:02 2003 +0000 @@ -15,6 +15,7 @@ #include "core.h" #include "multi.h" #include "prpl.h" +#include "notify.h" #include <string.h> #include <sys/stat.h> #include <unistd.h> @@ -158,7 +159,7 @@ if (res < 0) { g_snprintf(buf, BUF_LONG, _("Unable to make directory %s for logging"), log_all_file); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, buf, NULL); g_free(buf); g_free(buf2); return NULL; @@ -179,7 +180,7 @@ if (res < 0) { g_snprintf(buf, BUF_LONG, _("Unable to make directory %s for logging"), log_all_file); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, buf, NULL); g_free(buf); g_free(buf2); return NULL; @@ -191,7 +192,7 @@ if( _mkdir(log_all_file) < 0 && errno != EEXIST ) { g_snprintf(buf, BUF_LONG, _("Unable to make directory %s for logging"), log_all_file); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, buf, NULL); g_free(buf); g_free(buf2); return NULL;
--- a/src/main.c Sun May 18 19:13:21 2003 +0000 +++ b/src/main.c Sun May 18 19:59:02 2003 +0000 @@ -50,8 +50,10 @@ #include "sound.h" #include "gaim.h" #include "gaim-socket.h" +#include "notify.h" #include "gtkblist.h" #include "gtkdebug.h" +#include "gtknotify.h" #if HAVE_SIGNAL_H #include <signal.h> #endif @@ -178,7 +180,7 @@ const char *password = gtk_entry_get_text(GTK_ENTRY(pass)); if (!strlen(username)) { - do_error_dialog(_("Please enter your login."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, _("Please enter your login."), NULL); return; } @@ -874,6 +876,7 @@ gaim_set_win_ui_ops(gaim_get_gtk_window_ui_ops()); gaim_set_xfer_ui_ops(gaim_get_gtk_xfer_ui_ops()); gaim_set_blist_ui_ops(gaim_get_gtk_blist_ui_ops()); + gaim_set_notify_ui_ops(gaim_get_gtk_notify_ui_ops()); plugin_search_paths[0] = LIBDIR;
--- a/src/multi.c Sun May 18 19:13:21 2003 +0000 +++ b/src/multi.c Sun May 18 19:59:02 2003 +0000 @@ -27,6 +27,7 @@ #include "multi.h" #include "gaim.h" #include "conversation.h" +#include "notify.h" #include "gtkblist.h" #include "gaim-disclosure.h" @@ -302,6 +303,38 @@ */ } +static void +__rows_reordered_cb(GtkTreeModel *model, GtkTreePath *arg1, + GtkTreeIter *arg2, int *new_order, gpointer user_data) +{ + GSList *accounts = gaim_accounts; + GSList *new_accounts = NULL; + struct gaim_account **account_array; + int count, i; + + gaim_debug(GAIM_DEBUG_INFO, "accounts", "Reordering accounts\n"); + + count = g_slist_length(accounts); + + /* Grr. */ + account_array = g_new(struct gaim_account *, count); + + /* I hate this. */ + for (i = 0; i < count; i++, accounts = accounts->next) + account_array[new_order[i]] = accounts->data; + + /* I hate this too. */ + for (i = 0; i < count; i++) + new_accounts = g_slist_append(new_accounts, account_array[i]); + + gaim_accounts = new_accounts; + + g_slist_free(accounts); + g_free(account_array); + + save_prefs(); +} + static GtkWidget *generate_list() { GtkWidget *win; @@ -330,6 +363,9 @@ regenerate_user_list(); gtk_tree_view_set_reorderable (GTK_TREE_VIEW(treeview), TRUE); + g_signal_connect(G_OBJECT(model), "rows-reordered", + G_CALLBACK(__rows_reordered_cb), NULL); + gtk_widget_show(win); return win; } @@ -1416,17 +1452,21 @@ signoff(account->gc); } else { if (account->protocol == GAIM_PROTO_TOC) - do_error_dialog(_("TOC not found."), - _("You have attempted to login an IM account using the " - "TOC protocol. Because this protocol is inferior to " - "OSCAR, it is now compiled as a plugin by default. " - "To login, edit this account to use OSCAR or load the " - "TOC plugin."), GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("TOC not found."), + _("You have attempted to login an IM account " + "using the TOC protocol. Because this " + "protocol is inferior to OSCAR, it is now " + "compiled as a plugin by default. To login, " + "edit this account to use OSCAR or load the " + "TOC plugin.")); else - do_error_dialog(_("Protocol not found."), - _("You cannot log this account in; you do not have " - "the protocol it uses loaded, or the protocol does " - "not have a login function."), GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Protocol not found."), + _("You cannot log this account in; you do " + "not have the protocol it uses loaded, or " + "the protocol does not have a login " + "function.")); } } @@ -1967,7 +2007,7 @@ return NULL; } -static void set_kick_null(GtkObject *obj, struct kick_dlg *k) +static void set_kick_null(struct kick_dlg *k) { kicks = g_slist_remove(kicks, k); g_free(k); @@ -1989,10 +2029,9 @@ gtk_widget_destroy(k->dlg); k = g_new0(struct kick_dlg, 1); k->account = gc->account; - k->dlg = do_error_dialog(title, buf, GAIM_ERROR); + k->dlg = gaim_notify_message(NULL, GAIM_NOTIFY_MSG_ERROR, NULL, + title, buf, G_CALLBACK(set_kick_null), k); kicks = g_slist_append(kicks, k); - g_signal_connect(G_OBJECT(k->dlg), "destroy", - G_CALLBACK(set_kick_null), k); if (meter) { kill_meter(meter); meters = g_slist_remove(meters, meter);
--- a/src/plugin.c Sun May 18 19:13:21 2003 +0000 +++ b/src/plugin.c Sun May 18 19:59:02 2003 +0000 @@ -42,6 +42,7 @@ #include "gaim.h" #include "prpl.h" #include "event.h" +#include "notify.h" #include <string.h> @@ -228,8 +229,8 @@ "information"), plugin->path); - do_error_dialog(_("Gaim was unable to load your plugin."), buf, - GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Gaim was unable to load your plugin."), buf); gaim_plugin_destroy(plugin);
--- a/src/prefs.c Sun May 18 19:13:21 2003 +0000 +++ b/src/prefs.c Sun May 18 19:59:02 2003 +0000 @@ -42,6 +42,7 @@ #include "prpl.h" #include "proxy.h" #include "sound.h" +#include "notify.h" #ifdef _WIN32 #include "win32dep.h" @@ -881,7 +882,7 @@ char *error = g_strdup_printf(_("The entered manual browser " "'%s' is not valid. Hyperlinks will " "not work."), program); - do_error_dialog(error, NULL, GAIM_WARNING); + gaim_notify_warning(NULL, NULL, error, NULL); } g_strlcpy(web_command, program, sizeof(web_command));
--- a/src/protocols/gg/gg.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/gg/gg.c Sun May 18 19:59:02 2003 +0000 @@ -1,6 +1,6 @@ /* * gaim - Gadu-Gadu Protocol Plugin - * $Id: gg.c 5573 2003-04-25 06:47:33Z chipx86 $ + * $Id: gg.c 5818 2003-05-18 19:59:02Z chipx86 $ * * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> * @@ -588,8 +588,9 @@ gchar *imsg; if (invalid_uin(who)) { - do_error_dialog(_("You are trying to send a message to an invalid Gadu-Gadu UIN."), NULL, - GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("You are trying to send a message to an " + "invalid Gadu-Gadu UIN."), NULL); return -1; } @@ -651,7 +652,7 @@ if ((ptr = strstr(webdata, "query_results:")) == NULL || (ptr = strchr(ptr, '\n')) == NULL) { debug_printf("search_callback: pubdir result [%s]\n", webdata); - do_error_dialog(_("Couldn't get search results"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Couldn't get search results"), NULL); return; } ptr++; @@ -755,13 +756,16 @@ gchar **users_tbl; int i; if (strstr(webdata, "no_data:")) { - do_error_dialog(_("There is no Buddy List stored on the Gadu-Gadu server."), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("There is no Buddy List stored on the " + "Gadu-Gadu server."), NULL); return; } if ((ptr = strstr(webdata, "get_results:")) == NULL || (ptr = strchr(ptr, ':')) == NULL) { debug_printf("import_buddies_server_results: import buddies result [%s]\n", webdata); - do_error_dialog(_("Couldn't Import Buddy List from Server"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Couldn't Import Buddy List from Server"), NULL); return; } ptr++; @@ -821,34 +825,44 @@ static void export_buddies_server_results(struct gaim_connection *gc, gchar *webdata) { if (strstr(webdata, "put_success:")) { - do_error_dialog(_("Buddy List successfully transferred to Gadu-Gadu server"), NULL, GAIM_INFO); + gaim_notify_info(gc, NULL, + _("Buddy List successfully transferred to " + "Gadu-Gadu server"), NULL); return; } debug_printf("export_buddies_server_results: webdata [%s]\n", webdata); - do_error_dialog(_("Couldn't transfer Buddy List to Gadu-Gadu server"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Couldn't transfer Buddy List to Gadu-Gadu server"), + NULL); } static void delete_buddies_server_results(struct gaim_connection *gc, gchar *webdata) { if (strstr(webdata, "put_success:")) { - do_error_dialog(_("Buddy List successfully deleted from Gadu-Gadu server"), NULL, GAIM_INFO); + gaim_notify_info(gc, NULL, + _("Buddy List successfully deleted from " + "Gadu-Gadu server"), NULL); return; } debug_printf("delete_buddies_server_results: webdata [%s]\n", webdata); - do_error_dialog(_("Couldn't delete Buddy List from Gadu-Gadu server"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Couldn't delete Buddy List from Gadu-Gadu server"), + NULL); } static void password_change_server_results(struct gaim_connection *gc, gchar *webdata) { if (strstr(webdata, "reg_success:")) { - do_error_dialog(_("Password changed successfully"), NULL, GAIM_INFO); + gaim_notify_info(gc, NULL, + _("Password changed successfully"), NULL); return; } debug_printf("password_change_server_results: webdata [%s]\n", webdata); - do_error_dialog(_("Password couldn't be changed"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Password couldn't be changed"), NULL); } static void http_results(gpointer data, gint source, GaimInputCondition cond) @@ -959,10 +973,11 @@ g_free(buf); g_free(hdata); close(source); - do_error_dialog(_("Error communicating with Gadu-Gadu server"), - _("Gaim was unable to complete your request due to a problem " - "communicating with the Gadu-Gadu HTTP server. Please try again " - "later."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Error communicating with Gadu-Gadu server"), + _("Gaim was unable to complete your request due " + "to a problem communicating with the Gadu-Gadu " + "HTTP server. Please try again later.")); return; } @@ -987,9 +1002,10 @@ g_free(p); if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, hi) < 0) { - do_error_dialog(_("Unable to import Gadu-Gadu buddy list"), - _("Gaim was unable to connect to the Gadu-Gadu buddy list " - "server. Please try again later."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Unable to import Gadu-Gadu buddy list"), + _("Gaim was unable to connect to the Gadu-Gadu " + "buddy list server. Please try again later.")); g_free(hi->request); g_free(hi); return; @@ -1056,9 +1072,10 @@ } if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) { - do_error_dialog(_("Couldn't export buddy list"), - _("Gaim was unable to connect to the buddy list server. " - "Please try again later."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Couldn't export buddy list"), + _("Gaim was unable to connect to the buddy " + "list server. Please try again later.")); g_free(he->request); g_free(he); return; @@ -1078,9 +1095,10 @@ he->request = g_strdup_printf("FmNum=%s&Pass=%s&Delete=1", u, p); if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) { - do_error_dialog(_("Unable to delete Gadu-Gadu buddy list"), - _("Gaim was unable to connect to the buddy list server. " - "Please try again later."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Unable to delete Gadu-Gadu buddy list"), + _("Gaim was unable to connect to the buddy " + "list server. Please try again later.")); g_free(he->request); g_free(he); return; @@ -1126,10 +1144,11 @@ } if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, srch) < 0) { - do_error_dialog(_("Unable to access directory"), - _("Gaim was unable to search the Directory because it " - "was unable to connect to the directory server. Please try " - "again later."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Unable to access directory"), + _("Gaim was unable to search the Directory " + "because it was unable to connect to the " + "directory server. Please try again later.")); g_free(srch->request); g_free(srch); return; @@ -1159,9 +1178,12 @@ g_free(eold); if (proxy_connect(gc->account, GG_REGISTER_HOST, GG_REGISTER_PORT, http_req_callback, hpass) < 0) { - do_error_dialog(_("Unable to change Gadu-Gadu password"), - _("Gaim was unable to change your password due to an error connecting " - "to the Gadu-Gadu server. Please try again later."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Unable to change Gadu-Gadu password"), + _("Gaim was unable to change your password " + "due to an error connecting to the " + "Gadu-Gadu server. Please try again " + "later.")); g_free(hpass->request); g_free(hpass); return; @@ -1234,9 +1256,11 @@ srch->request = g_strdup_printf("Mode=3&UserId=%s", who); if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, srch) < 0) { - do_error_dialog(_("Unable to access user profile."), - _("Gaim was unable to access this user's profile due to an error " - "connecting to the directory server. Please try again later."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Unable to access user profile."), + _("Gaim was unable to access this user's " + "profile due to an error connecting to the " + "directory server. Please try again later.")); g_free(srch->request); g_free(srch); return;
--- a/src/protocols/irc/irc.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/irc/irc.c Sun May 18 19:59:02 2003 +0000 @@ -1093,21 +1093,22 @@ irc_request_buddy_update(gc); break; case 382: /* RPL_REHASHING */ - do_error_dialog(_("Rehashing server"), _("IRC Operator"), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Rehashing server"), _("IRC Operator")); break; case 401: /* ERR_NOSUCHNICK */ - do_error_dialog(_("No such nick/channel"), _("IRC Error"), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("No such nick/channel"), _("IRC Error")); break; case 402: /* ERR_NOSUCHSERVER */ - do_error_dialog(_("No such server"), _("IRC Error"), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("No such server"), _("IRC Error")); break; case 422: /* ERR_NOMOTD */ break; /* drop it - bringing up dialog for NOMOTD is annoying */ case 431: /* ERR_NONICKNAMEGIVEN */ - do_error_dialog(_("No nickname given"), _("IRC Error"), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("No nickname given"), _("IRC Error")); break; case 481: /* ERR_NOPRIVILEGES */ - do_error_dialog(_("You're not an IRC operator!"), _("IRC Error"), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("You're not an IRC operator!"), + _("IRC Error")); break; case 433: do_prompt_dialog(_("That nick is already in use. Please enter a new nick"), gc->displayname, gc, irc_change_nick, NULL); @@ -1117,10 +1118,15 @@ if (n > 400 && n < 502) { char errmsg[IRC_BUF_LEN]; char *errmsg1 = strrchr(text, ':'); + g_snprintf(errmsg, sizeof(errmsg), "IRC Error %d", n); - if (errmsg) - do_error_dialog(errmsg, errmsg1 ? errmsg1+1 : NULL, GAIM_ERROR); + + if (errmsg) { + gaim_notify_error(gc, NULL, errmsg, + (errmsg1 ? errmsg1 + 1 : NULL)); + } } + break; } } @@ -1390,19 +1396,19 @@ "Multi-protocol Messaging Client: " WEBSITE "\001"); irc_send_notice (gc, nick, buf); g_snprintf(out, sizeof(out), ">> CTCP VERSION requested from %s", nick); - do_error_dialog(out, _("IRC CTCP info"), GAIM_INFO); + gaim_notify_info(gc, NULL, out, _("IRC CTCP info")); } else if (!g_ascii_strncasecmp(msg, "CLIENTINFO", 10)) { g_snprintf(buf, sizeof(buf), "\001CLIENTINFO USERINFO CLIENTINFO VERSION\001"); irc_send_notice (gc, nick, buf); g_snprintf(out, sizeof(out), ">> CTCP CLIENTINFO requested from %s", nick); - do_error_dialog(out, _("IRC CTCP info"), GAIM_INFO); + gaim_notify_info(gc, NULL, out, _("IRC CTCP info")); } else if (!g_ascii_strncasecmp(msg, "USERINFO", 8)) { g_snprintf(buf, sizeof(buf), "\001USERINFO Alias: %s\001", gc->account->alias); irc_send_notice (gc, nick, buf); g_snprintf(out, sizeof(out), ">> CTCP USERINFO requested from %s", nick); - do_error_dialog(out, _("IRC CTCP info"), GAIM_INFO); + gaim_notify_info(gc, NULL, out, _("IRC CTCP info")); } else if (!g_ascii_strncasecmp(msg, "ACTION", 6)) { char *po = strchr(msg + 6, 1); @@ -1416,7 +1422,7 @@ g_snprintf(buf, sizeof(buf), "\001%s\001", msg); irc_send_notice (gc, nick, buf); g_snprintf(out, sizeof(out), ">> CTCP PING requested from %s", nick); - do_error_dialog(out, _("IRC CTCP info"), GAIM_INFO); + gaim_notify_info(gc, NULL, out, _("IRC CTCP info")); } else if (!g_ascii_strncasecmp(msg, "DCC CHAT", 8)) { char **chat_args = g_strsplit(msg, " ", 5); @@ -1456,7 +1462,7 @@ _("Received an invalid file send request from %s."), nick); - do_error_dialog(buf, _("IRC Error"), GAIM_ERROR); + gaim_notify_error(gc, NULL, buf, _("IRC Error")); return; } @@ -1599,7 +1605,7 @@ gaim_conversation_set_account(c, NULL); g_snprintf(outbuf, sizeof(outbuf), _("You have been kicked from %s: %s"), word[3], *word_eol[5] == ':' ? word_eol[5] + 1 : word_eol[5]); - do_error_dialog(outbuf, _("IRC Error"), GAIM_ERROR); + gaim_notify_error(gc, NULL, outbuf, _("IRC Error")); } else { char *reason = *word_eol[5] == ':' ? word_eol[5] + 1 : word_eol[5]; char *msg = g_strdup_printf(_("Kicked by %s: %s"), nick, reason); @@ -1641,7 +1647,7 @@ } else if (!strcmp(cmd, "WALLOPS")) { /* Don't know if a dialog box is the right way? */ char *msg = strrchr(word_eol[0], ':'); if (msg) - do_error_dialog(msg+1, _("IRC Operator"), GAIM_ERROR); + gaim_notify_error(gc, NULL, msg+1, _("IRC Operator")); } return FALSE; @@ -1658,19 +1664,19 @@ char *p = g_strrstr(word_eol[5], "\001"); *p = 0; g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", word_eol[5]); - do_error_dialog(buf, _("CTCP ClientInfo"), GAIM_INFO); + gaim_notify_info(gc, NULL, buf, _("CTCP ClientInfo")); } else if (!g_ascii_strcasecmp(word[4], ":\001USERINFO")) { char *p = g_strrstr(word_eol[5], "\001"); *p = 0; g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", word_eol[5]); - do_error_dialog(buf, _("CTCP UserInfo"), GAIM_INFO); + gaim_notify_info(gc, NULL, buf, _("CTCP UserInfo")); } else if (!g_ascii_strcasecmp(word[4], ":\001VERSION")) { char *p = g_strrstr(word_eol[5], "\001"); *p = 0; g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", word_eol[5]); - do_error_dialog(buf, _("CTCP Version"), GAIM_INFO); + gaim_notify_info(gc, NULL, buf, _("CTCP Version")); } else if (!g_ascii_strcasecmp(word[4], ":\001PING")) { char *p = g_strrstr(word_eol[5], "\001"); @@ -1698,7 +1704,7 @@ "CTCP Ping reply from %s: %lu.%.03lu seconds", nick, ping_time.tv_sec, (ping_time.tv_usec/1000)); - do_error_dialog(buf, _("CTCP Ping"), GAIM_INFO); + gaim_notify_info(gc, NULL, buf, _("CTCP Ping")); g_strfreev(vector); } } else { @@ -2304,7 +2310,7 @@ gc->buddy_chats = g_slist_remove(gc->buddy_chats, c); gaim_conversation_set_account(c, NULL); g_snprintf(buf, sizeof(buf), _("You have left %s"), chan); - do_error_dialog(buf, _("IRC Part"), GAIM_INFO); + gaim_notify_info(gc, NULL, buf, _("IRC Part")); } } else if (!g_ascii_strcasecmp(pdibuf, "WHOIS")) { g_snprintf(buf, sizeof(buf), "WHOIS %s\r\n", word_eol[2]);
--- a/src/protocols/jabber/jabber.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/jabber/jabber.c Sun May 18 19:59:02 2003 +0000 @@ -986,15 +986,18 @@ if(strcmp(old, gjc->pass)) { - do_error_dialog(_("Unable to change password."), - _("The current password you entered is incorrect. Your password has " - "not been changed."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Unable to change password."), + _("The current password you entered is incorrect. " + "Your password has not been changed.")); } else if(!strcmp(old, new)) { - do_error_dialog(_("Unable to change password"), - _("The new password you entered is the same as your current password. " - "Your password remains the same."), GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Unable to change password"), + _("The new password you entered is the same as " + "your current password. " + "Your password remains the same.")); } else { @@ -1422,7 +1425,7 @@ if (msg) { from = g_strdup_printf(_("Jabber Error %s"), type ? type : ""); - do_error_dialog(from, msg, GAIM_ERROR); + gaim_notify_error(GJ_GC(gjc), NULL, from, msg); g_free(from); } } else if (!strcasecmp(type, "groupchat")) { @@ -1735,7 +1738,7 @@ char *msg = g_strdup_printf(_("The Jabber user %s does not exist and was therefore " "not added to your roster."), xmlnode_get_attrib(p->x, "from")); - do_error_dialog(_("No such user."), msg, GAIM_ERROR ); + gaim_notify_error(GJ_GC(gjc), NULL, _("No such user."), msg); g_free(msg); } } @@ -2285,7 +2288,7 @@ char buf[BUF_LONG]; sprintf(buf, _("Password successfully changed.")); - do_error_dialog(buf, NULL, GAIM_INFO); + gaim_notify_info(GJ_GC(gjc), NULL, buf, NULL); } } } @@ -2304,7 +2307,7 @@ } from = g_strdup_printf("Jabber Error %d (%s)", errcode, from); - do_error_dialog(from, errmsg, GAIM_ERROR); + gaim_notify_error(GJ_GC(gjc), NULL, from, errmsg); g_free(from); } @@ -2687,7 +2690,8 @@ if((realwho = get_realwho(gjc, name, FALSE, &gjid)) == NULL) { char *msg = g_strdup_printf(_("The user %s is an invalid Jabber I.D. and was " "therefore not added."), name); - do_error_dialog("Unable to add buddy.", _("Jabber Error"), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Unable to add buddy."), + _("Jabber Error")); g_free(msg); jabber_remove_gaim_buddy(gc, name); return; @@ -2987,7 +2991,7 @@ if((gjid = gaim_jid_new(realwho)) == NULL) { char *msg = g_strdup_printf("The Jabber I.D. %s is invalid.", realwho); - do_error_dialog(_("Unable to join chat"), msg, GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Unable to join chat"), msg); g_free(msg); g_free(realwho); return;
--- a/src/protocols/msn/error.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/msn/error.c Sun May 18 19:59:02 2003 +0000 @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "msn.h" +#include "error.h" const char * msn_error_get_text(unsigned int type) @@ -170,11 +171,11 @@ } void -msn_error_handle(unsigned int type) +msn_error_handle(MsnSession *session, unsigned int type) { const char *text; text = msn_error_get_text(type); - do_error_dialog(text, NULL, GAIM_ERROR); + gaim_notify_error(session->account->gc, NULL, text, NULL); }
--- a/src/protocols/msn/error.h Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/msn/error.h Sun May 18 19:59:02 2003 +0000 @@ -22,6 +22,8 @@ #ifndef _MSN_ERROR_H_ #define _MSN_ERROR_H_ +#include "session.h" + /** * Returns the string representation of an error type. * @@ -34,8 +36,9 @@ /** * Handles an error. * - * @param type The error type. + * @param session The current session. + * @param type The error type. */ -void msn_error_handle(unsigned int type); +void msn_error_handle(MsnSession *session, unsigned int type); #endif /* _MSN_ERROR_H_ */
--- a/src/protocols/msn/msn.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/msn/msn.c Sun May 18 19:59:02 2003 +0000 @@ -56,8 +56,8 @@ alias = g_strdup(entry); if (strlen(alias) >= BUDDY_ALIAS_MAXLEN) { - do_error_dialog(_("Your new MSN friendly name is too long."), - NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Your new MSN friendly name is too long."), NULL); return; } @@ -663,7 +663,7 @@ "Perhaps you meant %s@hotmail.com. No changes were made " "to your allow list."), who); - do_error_dialog(_("Invalid MSN screenname"), buf, GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Invalid MSN screenname"), buf); gaim_privacy_permit_remove(gc->account, who); return; @@ -704,7 +704,7 @@ "Perhaps you meant %s@hotmail.com. No changes were made " "to your block list."), who); - do_error_dialog(_("Invalid MSN screenname"), buf, GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Invalid MSN screenname"), buf); gaim_privacy_deny_remove(gc->account, who);
--- a/src/protocols/msn/notification.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/msn/notification.c Sun May 18 19:59:02 2003 +0000 @@ -131,7 +131,7 @@ g_snprintf(buf, sizeof(buf), "MSN Error: Unable to parse message\n"); } - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(servconn->session->account->gc, NULL, buf, NULL); return TRUE; } @@ -1218,9 +1218,8 @@ break; } - if (*buf != '\0') { - do_error_dialog(buf, NULL, GAIM_INFO); - } + if (*buf != '\0') + gaim_notify_info(servconn->session->account->gc, NULL, buf, NULL); } g_hash_table_destroy(table);
--- a/src/protocols/msn/servconn.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/msn/servconn.c Sun May 18 19:59:02 2003 +0000 @@ -99,6 +99,9 @@ return FALSE; } + gaim_debug(GAIM_DEBUG_MISC, "msn", + "Message: {%s}\n", msn_message_get_body(msg)); + cb(servconn, msg); msn_message_destroy(msg);
--- a/src/protocols/msn/switchboard.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/msn/switchboard.c Sun May 18 19:59:02 2003 +0000 @@ -221,8 +221,8 @@ * TODO: Investigate this, as it seems to occur frequently with * the old prpl. */ - do_error_dialog(_("An MSN message may not have been received."), - NULL, GAIM_ERROR); + gaim_notify_error(servconn->session->account->gc, NULL, + _("An MSN message may not have been received."), NULL); return TRUE; }
--- a/src/protocols/napster/napster.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/napster/napster.c Sun May 18 19:59:02 2003 +0000 @@ -274,7 +274,7 @@ switch (command) { case 000: /* MSG_SERVER_ERROR */ - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, buf, NULL); gaim_input_remove(gc->inpa); gc->inpa = 0; close(source); @@ -335,13 +335,14 @@ case 302: /* MSG_SERVER_HOTLIST_ERROR */ buf2 = g_strdup_printf(_("Unable to add \"%s\" to your Napster hotlist"), buf); - do_error_dialog(buf2, NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, buf2, NULL); g_free(buf2); break; case 316: /* MSG_SERVER_DISCONNECTING */ /* we have been kicked off =^( */ - do_error_dialog(_("You were disconnected from the server."), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("You were disconnected from the server."), NULL); signoff(gc); break; @@ -426,7 +427,9 @@ case 748: /* MSG_SERVER_GHOST */ /* Looks like someone logged in as us! =-O */ - do_error_dialog(_("You were disconnected from the server, because you logged on from a different location"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("You were disconnected from the server, because " + "you logged on from a different location"), NULL); signoff(gc); break; @@ -441,7 +444,7 @@ case 752: /* MSG_CLIENT_PONG */ buf2 = g_strdup_printf("Received pong from %s", buf); - do_error_dialog(buf2, NULL, GAIM_INFO); + gaim_notify_info(gc, NULL, buf2, NULL); g_free(buf2); break;
--- a/src/protocols/oscar/oscar.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/oscar/oscar.c Sun May 18 19:59:02 2003 +0000 @@ -554,7 +554,7 @@ c->fd = -1; aim_conn_kill(od->sess, &conn); buf = g_strdup_printf(_("You have been disconnected from chat room %s."), c->name); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, buf, NULL); g_free(buf); } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { if (od->cnpa > 0) @@ -568,7 +568,9 @@ od->create_rooms = g_slist_remove(od->create_rooms, cr); g_free(cr); - do_error_dialog(_("Chat is currently unavailable"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Chat is currently unavailable"), + NULL); } aim_conn_kill(od->sess, &conn); } else if (conn->type == AIM_CONN_TYPE_AUTH) { @@ -870,7 +872,8 @@ aim_im_sendch2_sendfile_ask(od->sess, oft_info); aim_conn_addhandler(od->sess, oft_info->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_ESTABLISHED, oscar_sendfile_estblsh, 0); } else { - do_error_dialog(_("File Transfer Aborted"), _("Unable to establish listener socket."), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("File Transfer Aborted"), + _("Unable to establish listener socket.")); /* XXX - The below line causes a crash because the transfer is canceled before the "Ok" callback on the file selection thing exists, I think */ /* gaim_xfer_cancel_remote(xfer); */ } @@ -881,11 +884,13 @@ aim_conn_addhandler(od->sess, oft_info->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_PROMPT, oscar_sendfile_prompt, 0); oft_info->conn->fd = xfer->fd = proxy_connect(gc->account, xfer->remote_ip, xfer->remote_port, oscar_sendfile_connected, xfer); if (xfer->fd == -1) { - do_error_dialog(_("File Transfer Aborted"), _("Unable to establish file descriptor."), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("File Transfer Aborted"), + _("Unable to establish file descriptor.")); /* gaim_xfer_cancel_remote(xfer); */ } } else { - do_error_dialog(_("File Transfer Aborted"), _("Unable to create new connection."), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("File Transfer Aborted"), + _("Unable to create new connection.")); /* gaim_xfer_cancel_remote(xfer); */ /* Try a different port? Ask them to connect to us? */ } @@ -1220,8 +1225,9 @@ char buf[256]; g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. You may want to use TOC until " "this is fixed. Check %s for updates."), WEBSITE); - do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."), - buf, GAIM_WARNING); + gaim_notify_warning(pos->gc, NULL, + _("Gaim was Unable to get a valid AIM login hash."), + buf); gaim_input_remove(pos->inpa); close(pos->fd); g_free(pos); @@ -1249,7 +1255,9 @@ if (source < 0) { buf = g_strdup_printf(_("You may be disconnected shortly. You may want to use TOC until " "this is fixed. Check %s for updates."), WEBSITE); - do_error_dialog(_("Gaim was Unable to get a valid AIM login hash."), buf, GAIM_WARNING); + gaim_notify_warning(pos->gc, NULL, + _("Gaim was Unable to get a valid AIM login hash."), + buf); g_free(buf); if (pos->modname) g_free(pos->modname); @@ -1335,8 +1343,9 @@ g_free(pos); g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. You may want to use TOC until " "this is fixed. Check %s for updates."), WEBSITE); - do_error_dialog(_("Gaim was Unable to get a valid login hash."), - buf, GAIM_WARNING); + gaim_notify_warning(pos->gc, NULL, + _("Gaim was Unable to get a valid login hash."), + buf); } return 1; @@ -2572,21 +2581,23 @@ case 0x07: { /* Someone has denied you authorization */ if (i >= 1) { gchar *dialog_msg = g_strdup_printf(_("The user %lu has denied your request to add them to your contact list for the following reason:\n%s"), args->uin, msg2[0] ? msg2[0] : _("No reason given.")); - do_error_dialog(_("ICQ authorization denied."), dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, _("ICQ authorization denied."), + dialog_msg); g_free(dialog_msg); } } break; case 0x08: { /* Someone has granted you authorization */ gchar *dialog_msg = g_strdup_printf(_("The user %lu has granted your request to add them to your contact list."), args->uin); - do_error_dialog("ICQ authorization accepted.", dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, "ICQ authorization accepted.", + dialog_msg); g_free(dialog_msg); } break; case 0x09: { /* Message from the Godly ICQ server itself, I think */ if (i >= 5) { gchar *dialog_msg = g_strdup_printf(_("You have received a special message\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); - do_error_dialog("ICQ Server Message", dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, "ICQ Server Message", dialog_msg); g_free(dialog_msg); } } break; @@ -2594,7 +2605,7 @@ case 0x0d: { /* Someone has sent you a pager message from http://www.icq.com/your_uin */ if (i >= 6) { gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ page\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); - do_error_dialog("ICQ Page", dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, "ICQ Page", dialog_msg); g_free(dialog_msg); } } break; @@ -2602,7 +2613,7 @@ case 0x0e: { /* Someone has emailed you at your_uin@pager.icq.com */ if (i >= 6) { gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ email from %s [%s]\n\nMessage is:\n%s"), msg2[0], msg2[3], msg2[5]); - do_error_dialog("ICQ Email", dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, "ICQ Email", dialog_msg); g_free(dialog_msg); } } break; @@ -2760,7 +2771,7 @@ userinfo->sn); break; } - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(sess->aux_data, NULL, buf, NULL); g_free(buf); return 1; @@ -2902,7 +2913,7 @@ m = g_strdup_printf(_("SNAC threw error: %s\n"), reason < msgerrreasonlen ? _(msgerrreason[reason]) : _("Unknown error")); - do_error_dialog(m, NULL, GAIM_ERROR); + gaim_notify_error(sess->aux_data, NULL, m, NULL); g_free(m); return 1; @@ -2937,7 +2948,8 @@ /* Data is assumed to be the destination sn */ buf = g_strdup_printf(_("Your message to %s did not get sent:"), data); - do_error_dialog(buf, (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("No reason given."), GAIM_ERROR); + gaim_notify_error(sess->aux_data, NULL, buf, + (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("No reason given.")); g_free(buf); return 1; @@ -2988,7 +3000,8 @@ va_end(ap); buf = g_strdup_printf(_("User information for %s unavailable:"), destn); - do_error_dialog(buf, (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("No reason given."), GAIM_ERROR); + gaim_notify_error(sess->aux_data, NULL, buf, + (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("No reason given.")); g_free(buf); return 1; @@ -3203,7 +3216,8 @@ gaim_debug(GAIM_DEBUG_MISC, "oscar", "MOTD: %s (%hu)\n", msg ? msg : "Unknown", id); if (id < 4) - do_error_dialog(_("Your AIM connection may be lost."), NULL, GAIM_WARNING); + gaim_notify_warning(sess->aux_data, NULL, + _("Your AIM connection may be lost."), NULL); return 1; } @@ -3564,9 +3578,10 @@ } else if (code == AIM_RATE_CODE_WARNING) { aim_conn_setlatency(fr->conn, windowsize/4); } else if (code == AIM_RATE_CODE_LIMIT) { - do_error_dialog(_("Rate limiting error."), - _("The last message was not sent because you are over the rate limit. " - "Please wait 10 seconds and try again."), GAIM_ERROR); + gaim_notify_error(sess->aux_data, NULL, _("Rate limiting error."), + _("The last message was not sent because you " + "are over the rate limit. Please wait 10 " + "seconds and try again.")); aim_conn_setlatency(fr->conn, windowsize/2); } else if (code == AIM_RATE_CODE_CLEARLIMIT) { aim_conn_setlatency(fr->conn, 0); @@ -4032,7 +4047,7 @@ va_end(ap); buf = g_strdup_printf(_("No results found for email address %s"), address); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(sess->aux_data, NULL, buf, NULL); g_free(buf); return 1; @@ -4054,7 +4069,7 @@ if (!status) { g_snprintf(msg, sizeof(msg), _("You should receive an email asking to confirm %s."), gc->username); - do_error_dialog(_("Account Confirmation Requested"), msg, GAIM_INFO); + gaim_notify_info(gc, NULL, _("Account Confirmation Requested"), msg); } return 1; @@ -4106,7 +4121,7 @@ dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err); } break; } - do_error_dialog(dialog_top, dialog_msg, GAIM_ERROR); + gaim_notify_error(gc, NULL, dialog_top, dialog_msg); g_free(dialog_top); g_free(dialog_msg); return 1; @@ -4114,13 +4129,13 @@ if (sn) { char *dialog_msg = g_strdup_printf(_("Your screen name is currently formatted as follows:\n%s"), sn); - do_error_dialog(_("Account Info"), dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, _("Account Info"), dialog_msg); g_free(dialog_msg); } if (email) { char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), gc->username, email); - do_error_dialog(_("Account Info"), dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, _("Account Info"), dialog_msg); g_free(dialog_msg); } @@ -4341,9 +4356,11 @@ int msglen = 0; if (od->rights.maxsiglen == 0) - do_error_dialog(_("Unable to set AIM profile."), - _("You have probably requested to set your profile before the login procedure completed. " - "Your profile remains unset; try setting it again when you are fully connected."), GAIM_WARNING); + gaim_notify_warning(gc, NULL, _("Unable to set AIM profile."), + _("You have probably requested to set your " + "profile before the login procedure completed. " + "Your profile remains unset; try setting it " + "again when you are fully connected.")); if (od->icq) aim_bos_setprofile(od->sess, od->conn, NULL, NULL, 0, NULL, NULL, 0, caps_icq); @@ -4371,7 +4388,7 @@ gchar *errstr; errstr = g_strdup_printf(_("The maximum profile length of %d bytes has been exceeded. " "Gaim has truncated it for you."), od->rights.maxsiglen); - do_error_dialog(_("Profile too long."), errstr, GAIM_WARNING); + gaim_notify_warning(gc, NULL, _("Profile too long."), errstr); g_free(errstr); } @@ -4387,9 +4404,12 @@ int msglen = 0; if (od->rights.maxawaymsglen == 0) - do_error_dialog(_("Unable to set AIM away message."), - _("You have probably requested to set your away message before the login procedure completed. " - "You remain in a \"present\" state; try setting it again when you are fully connected."), GAIM_WARNING); + gaim_notify_warning(gc, NULL, _("Unable to set AIM away message."), + _("You have probably requested to set your " + "away message before the login procedure " + "completed. You remain in a \"present\" " + "state; try setting it again when you are " + "fully connected.")); if (gc->away) { g_free(gc->away); @@ -4426,7 +4446,7 @@ errstr = g_strdup_printf(_("The maximum away message length of %d bytes has been exceeded. " "Gaim has truncated it and set you away."), od->rights.maxawaymsglen); - do_error_dialog(_("Away message too long."), errstr, GAIM_WARNING); + gaim_notify_warning(gc, NULL, _("Away message too long."), errstr); g_free(errstr); } @@ -4639,7 +4659,8 @@ gaim_debug(GAIM_DEBUG_ERROR, "oscar", "ssi: SNAC error %hu\n", reason); if (reason == 0x0005) { - do_error_dialog(_("Unable To Retrive Buddy List"), _("Gaim was temporarily unable to retrive your buddy list from the AIM servers. Your buddy list is not lost, and will probably become available in a few hours."), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Unable To Retrive Buddy List"), + _("Gaim was temporarily unable to retrive your buddy list from the AIM servers. Your buddy list is not lost, and will probably become available in a few hours.")); } /* Activate SSI */ @@ -4900,7 +4921,7 @@ case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ gchar *buf; buf = g_strdup_printf(_("Could not add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); - do_error_dialog(_("Unable To Add"), buf, GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Unable To Add"), buf); g_free(buf); } @@ -4913,7 +4934,7 @@ gchar *buf; gaim_debug(GAIM_DEBUG_ERROR, "oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason. The most common reason for this is that you have the maximum number of allowed buddies in your buddy list."), (retval->name ? retval->name : _("(no name)"))); - do_error_dialog(_("Unable To Add"), buf, GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Unable To Add"), buf); g_free(buf); /* XXX - Should remove buddy from local list */ } break; @@ -5021,11 +5042,11 @@ if (reply) { /* Granted */ dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your contact list."), nombre); - do_error_dialog(_("Authorization Granted"), dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, _("Authorization Granted"), dialog_msg); } else { /* Denied */ dialog_msg = g_strdup_printf(_("The user %s has denied your request to add them to your contact list for the following reason:\n%s"), nombre, msg ? msg : _("No reason given.")); - do_error_dialog(_("Authorization Denied"), dialog_msg, GAIM_INFO); + gaim_notify_info(gc, NULL, _("Authorization Denied"), dialog_msg); } g_free(dialog_msg); g_free(nombre); @@ -5499,7 +5520,7 @@ gaim_debug(GAIM_DEBUG_INFO, "oscar", "Gave up on old direct IM, trying again\n"); } else { - do_error_dialog("DirectIM already open.", NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, "DirectIM already open.", NULL); g_free(data->who); g_free(data); return; @@ -5517,7 +5538,7 @@ aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIM_ESTABLISHED, gaim_odc_initiate, 0); } else { - do_error_dialog(_("Unable to open Direct IM"), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, _("Unable to open Direct IM"), NULL); g_free(dim); } @@ -5725,8 +5746,8 @@ aim_admin_setnick(od->sess, aim_getconn_type(od->sess, AIM_CONN_TYPE_AUTH), nick); } } else { - do_error_dialog(_("The new formatting is invalid."), - _("Screenname formatting can change only capitalization and whitespace."), GAIM_ERROR); + gaim_notify_error(gc, NULL, _("The new formatting is invalid."), + _("Screenname formatting can change only capitalization and whitespace.")); } }
--- a/src/protocols/toc/toc.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/toc/toc.c Sun May 18 19:59:02 2003 +0000 @@ -681,8 +681,9 @@ } g_snprintf(snd, sizeof snd, "toc_init_done"); sflap_send(gc, snd, -1, TYPE_DATA); - do_error_dialog(_("TOC has come back from its pause. You may now send" - " messages again."), NULL, GAIM_INFO); + gaim_notify_info(gc, NULL, + _("TOC has come back from its pause. You may " + "now send messages again."), NULL); } } else if (!g_ascii_strcasecmp(c, "CONFIG")) { c = strtok(NULL, ":"); @@ -755,7 +756,7 @@ serv_got_update(gc, c, logged, evil, signon, time_idle, type); } else if (!g_ascii_strcasecmp(c, "ERROR")) { - do_error_dialog(show_error_message(), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, show_error_message(), NULL); } else if (!g_ascii_strcasecmp(c, "EVILED")) { int lev; char *name; @@ -853,7 +854,7 @@ gaim_conversation_set_account(b, NULL); g_snprintf(error_buf, sizeof error_buf, _("You have been disconnected" " from chat room %s."), b->name); - do_error_dialog(error_buf, NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, error_buf, NULL); } else serv_got_chat_left(gc, id); } else if (!g_ascii_strcasecmp(c, "GOTO_URL")) { @@ -870,13 +871,16 @@ } else if (!g_ascii_strcasecmp(c, "DIR_STATUS")) { } else if (!g_ascii_strcasecmp(c, "ADMIN_NICK_STATUS")) { } else if (!g_ascii_strcasecmp(c, "ADMIN_PASSWD_STATUS")) { - do_error_dialog(_("Password Change Successful"), NULL, GAIM_INFO); + gaim_notify_info(gc, NULL, _("Password Change Successful"), NULL); } else if (!g_ascii_strcasecmp(c, "PAUSE")) { tdt->state = STATE_PAUSE; - do_error_dialog(_("TOC has sent a PAUSE command."), _("When this happens, TOC ignores" - " any messages sent to it, and may kick you off if you send a" - " message. Gaim will prevent anything from going through. This" - " is only temporary, please be patient."), GAIM_WARNING); + gaim_notify_warning(gc, NULL, + _("TOC has sent a PAUSE command."), + _("When this happens, TOC ignores any messages " + "sent to it, and may kick you off if you send a" + " message. Gaim will prevent anything from " + "going through. This is only temporary, please " + "be patient.")); } else if (!g_ascii_strcasecmp(c, "RVOUS_PROPOSE")) { char *user, *uuid, *cookie; int seq; @@ -1564,7 +1568,7 @@ ft->file = fopen(ft->filename, "w"); if (!ft->file) { buf = g_strdup_printf(_("Could not open %s for writing!"), ft->filename); - do_error_dialog(buf, strerror(errno), GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, buf, strerror(errno)); g_free(buf); gaim_input_remove(ft->inpa); toc_soc_close(source); @@ -1581,7 +1585,7 @@ if (!ft->file) { buf = g_strdup_printf("Could not open %s/%s for writing!", ft->filename, ft->hdr.name); - do_error_dialog(buf, strerror(errno), GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, buf, strerror(errno)); g_free(buf); gaim_input_remove(ft->inpa); toc_soc_close(source); @@ -1598,7 +1602,9 @@ rt = toc_read(source, buf, MIN(ntohl(ft->hdr.size) - ft->recvsize, 1024)); if (rt < 0) { - do_error_dialog("File transfer failed; other side probably canceled.", NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, + _("File transfer failed; other side probably " + "canceled."), NULL); gaim_input_remove(ft->inpa); toc_soc_close(source); g_free(ft->user); @@ -1641,7 +1647,8 @@ struct file_transfer *ft = data; if (src == -1) { - do_error_dialog(_("Could not connect for transfer."), NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, + _("Could not connect for transfer."), NULL); g_free(ft->filename); g_free(ft->cookie); g_free(ft->user); @@ -1680,7 +1687,8 @@ sflap_send(ft->gc, buf, -1, TYPE_DATA); if (proxy_connect(account, ft->ip, ft->port, toc_send_file_connect, ft) != 0) { - do_error_dialog(_("Could not connect for transfer."), NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, + _("Could not connect for transfer."), NULL); g_free(ft->filename); g_free(ft->cookie); g_free(ft->user); @@ -1746,7 +1754,7 @@ if (ft->hdr.hdrtype != htons(0x120c)) { g_snprintf(buf, sizeof(buf), "%s decided to cancel the transfer", ft->user); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, buf, NULL); gaim_input_remove(ft->inpa); toc_soc_close(source); g_free(ft->filename); @@ -1803,7 +1811,8 @@ char *basename; if (src == -1) { - do_error_dialog(_("Could not connect for transfer!"), NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, + _("Could not connect for transfer!"), NULL); fclose(ft->file); g_free(ft->filename); g_free(ft->cookie); @@ -1835,7 +1844,9 @@ hdr->lsizeoffset = 0x10; g_snprintf(hdr->name, 64, "listing.txt"); if (toc_write(src, hdr, 256) < 0) { - do_error_dialog(_("Could not write file header. The file will not be transferred."), NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, + _("Could not write file header. The file will " + "not be transferred."), NULL); fclose(ft->file); g_free(ft->filename); g_free(ft->cookie); @@ -1862,7 +1873,7 @@ ft->file = fopen(ft->filename, "r"); if (!ft->file) { buf = g_strdup_printf("Unable to open %s for transfer.", ft->filename); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, buf, NULL); g_free(buf); g_free(ft->filename); g_free(ft); @@ -1870,7 +1881,7 @@ } if (stat(dirname, &ft->st)) { buf = g_strdup_printf("Unable to examine %s.", dirname); - do_error_dialog(buf, NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, buf, NULL); g_free(buf); g_free(ft->filename); g_free(ft); @@ -1888,7 +1899,8 @@ sflap_send(ft->gc, buf2, -1, TYPE_DATA); if (proxy_connect(account, ft->ip, ft->port, toc_get_file_connect, ft) < 0) { - do_error_dialog(_("Could not connect for transfer."), NULL, GAIM_ERROR); + gaim_notify_error(ft->gc, NULL, + _("Could not connect for transfer."), NULL); fclose(ft->file); g_free(ft->filename); g_free(ft->cookie);
--- a/src/protocols/yahoo/yahoo.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/yahoo/yahoo.c Sun May 18 19:59:02 2003 +0000 @@ -446,7 +446,7 @@ case 60: /* no clue */ break; case 16: /* Custom error message */ - do_error_dialog(pair->value, NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, pair->value, NULL); break; default: gaim_debug(GAIM_DEBUG_ERROR, "yahoo", @@ -601,7 +601,8 @@ msg[j] = 0; serv_got_im(gc, from, g_strdup(msg), 0, tm, -1); } else if (pkt->status == 2) { - do_error_dialog(_("Your Yahoo! message did not get sent."), NULL, GAIM_ERROR); + gaim_notify_error(gc, NULL, + _("Your Yahoo! message did not get sent."), NULL); } }
--- a/src/protocols/zephyr/zephyr.c Sun May 18 19:13:21 2003 +0000 +++ b/src/protocols/zephyr/zephyr.c Sun May 18 19:59:02 2003 +0000 @@ -594,8 +594,11 @@ ZSubscription_t sub; if (zgc) { - do_error_dialog(_("Already logged in with Zephyr"), _("Because Zephyr uses your system username, you are unable to " - "have multiple accounts on it when logged in as the same user."), GAIM_ERROR); + gaim_notify_error(account->gc, NULL, + _("Already logged in with Zephyr"), + _("Because Zephyr uses your system username, you " + "are unable to have multiple accounts on it " + "when logged in as the same user.")); return; }
--- a/src/prpl.c Sun May 18 19:13:21 2003 +0000 +++ b/src/prpl.c Sun May 18 19:59:02 2003 +0000 @@ -23,6 +23,7 @@ #include "gtkutils.h" #include "gtkblist.h" #include "prpl.h" +#include "notify.h" #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> @@ -700,10 +701,13 @@ msg ? ": " : ".", msg ? msg : "", b ? "" : _("\n\nDo you wish to add him or her to your buddy list?")); - if (b) - do_error_dialog(_("Gaim - Information"), buf, GAIM_INFO); + + if (b) { + gaim_notify_info(NULL, NULL, _("Gaim - Information"), buf); + } else - do_ask_dialog(_("Gaim - Confirm"), buf, ga, _("Add"), do_add, _("Cancel"), dont_add, NULL, FALSE); + do_ask_dialog(_("Gaim - Confirm"), buf, ga, + _("Add"), do_add, _("Cancel"), dont_add, NULL, FALSE); } static GtkWidget *regdlg = NULL;
--- a/src/server.c Sun May 18 19:13:21 2003 +0000 +++ b/src/server.c Sun May 18 19:59:02 2003 +0000 @@ -37,6 +37,7 @@ #include "gaim.h" #include "sound.h" #include "pounce.h" +#include "notify.h" void serv_login(struct gaim_account *account) { @@ -51,7 +52,8 @@ if (prpl_info->login) { if (!strlen(account->password) && !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) { - do_error_dialog(_("Please enter your password"), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Please enter your password"), NULL); return; } @@ -1138,7 +1140,7 @@ gc->username, ((name == NULL)? _("an anonymous person") : name), lev); - do_error_dialog(buf2, NULL, GAIM_INFO); + gaim_notify_info(NULL, NULL, buf2, NULL); } void serv_got_typing(struct gaim_connection *gc, char *name, int timeout,
--- a/src/sound.c Sun May 18 19:13:21 2003 +0000 +++ b/src/sound.c Sun May 18 19:59:02 2003 +0000 @@ -49,6 +49,7 @@ #include "gaim.h" #include "sound.h" +#include "notify.h" #ifdef _WIN32 #include "win32dep.h" @@ -181,7 +182,7 @@ if (!g_file_test(filename, G_FILE_TEST_EXISTS)) { char *tmp = g_strdup_printf(_("Unable to play sound because the chosen file (%s) does not exist."), filename); - do_error_dialog(tmp, NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, tmp, NULL); g_free(tmp); return; } @@ -192,7 +193,10 @@ GError *error = NULL; if(!sound_cmd) { - do_error_dialog(_("Unable to play sound because the 'Command' sound method has been chosen, but no command has been set."), NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, + _("Unable to play sound because the " + "'Command' sound method has been chosen, " + "but no command has been set."), NULL); return; } @@ -200,7 +204,7 @@ if(!g_spawn_command_line_async(command, &error)) { char *tmp = g_strdup_printf(_("Unable to play sound because the configured sound command could not be launched: %s"), error->message); - do_error_dialog(tmp, NULL, GAIM_ERROR); + gaim_notify_error(NULL, NULL, tmp, NULL); g_free(tmp); g_error_free(error); }