Mercurial > pidgin.yaz
changeset 21098:7e200a629109
explicit merge of '8f24e3576448fefbc861e06f1e8d5fe17db2e71a'
and '49d0219884ede2c6c571f2df73e29dffa86f54ad'
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 14 Oct 2007 02:13:14 +0000 |
parents | 5e46cdf9ef2b (diff) c5f9e1eb59d5 (current diff) |
children | 0b67d509a305 |
files | pidgin/gtkblist.c pidgin/gtkconv.c pidgin/gtkdialogs.h pidgin/gtklog.c pidgin/gtklog.h pidgin/gtkplugin.h pidgin/gtkpounce.h pidgin/gtkutils.c pidgin/plugins/perl/common/GtkDialogs.xs pidgin/plugins/perl/common/GtkLog.xs pidgin/plugins/perl/common/GtkPlugin.xs pidgin/plugins/perl/common/GtkPounce.xs |
diffstat | 2 files changed, 32 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Sun Oct 14 01:57:08 2007 +0000 +++ b/pidgin/gtkblist.c Sun Oct 14 02:13:14 2007 +0000 @@ -617,7 +617,7 @@ static void gtk_blist_menu_bp_cb(GtkWidget *w, PurpleBuddy *b) { - pidgin_pounce_editor_show(b->account, b->name, NULL); + pidgin_pounce_editor_show_with_parent(GTK_WINDOW(gtkblist->window), b->account, b->name, NULL); } static void gtk_blist_menu_showlog_cb(GtkWidget *w, PurpleBlistNode *node) @@ -643,7 +643,7 @@ name = prpl_info->get_chat_name(c->components); } } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { - pidgin_log_show_contact((PurpleContact *)node); + pidgin_log_show_contact_with_parent(GTK_WINDOW(gtkblist->window), (PurpleContact *)node); pidgin_clear_cursor(gtkblist->window); return; } else { @@ -655,7 +655,7 @@ } if (name && account) { - pidgin_log_show(type, name, account); + pidgin_log_show_with_parent(GTK_WINDOW(gtkblist->window), type, name, account); g_free(name); pidgin_clear_cursor(gtkblist->window); @@ -682,11 +682,6 @@ pidgin_blist_update(purple_get_blist(), node); } -static void gtk_blist_show_systemlog_cb() -{ - pidgin_syslog_show(); -} - static void gtk_blist_show_onlinehelp_cb() { purple_notify_uri(NULL, PURPLE_WEBSITE "documentation"); @@ -3057,6 +3052,11 @@ !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); } +static void +pidgin_blist_show_with_parent(gpointer data1, void (*callback)(GtkWindow *parent), gpointer data3) +{ + callback(GTK_WINDOW(gtkblist->window)); +} /*************************************************** * Crap * @@ -3090,15 +3090,15 @@ /* Tools */ { N_("/_Tools"), NULL, NULL, 0, "<Branch>", NULL }, - { N_("/Tools/Buddy _Pounces"), NULL, pidgin_pounces_manager_show, 0, "<Item>", NULL }, + { N_("/Tools/Buddy _Pounces"), NULL, pidgin_blist_show_with_parent, (int)pidgin_pounces_manager_show_with_parent, "<Item>", NULL }, { N_("/Tools/_Certificates"), NULL, pidgin_certmgr_show, 0, "<Item>", NULL }, - { N_("/Tools/Plu_gins"), "<CTL>U", pidgin_plugin_dialog_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS }, + { N_("/Tools/Plu_gins"), "<CTL>U", pidgin_blist_show_with_parent, (int)pidgin_plugin_dialog_show_with_parent, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS }, { N_("/Tools/Pr_eferences"), "<CTL>P", pidgin_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES }, { N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "<Item>", NULL }, { "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL }, { N_("/Tools/_File Transfers"), "<CTL>T", pidgin_xfer_dialog_show, 0, "<Item>", NULL }, { N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "<Item>", NULL }, - { N_("/Tools/System _Log"), NULL, gtk_blist_show_systemlog_cb, 0, "<Item>", NULL }, + { N_("/Tools/System _Log"), NULL, pidgin_blist_show_with_parent, (int)pidgin_syslog_show_with_parent, "<Item>", NULL }, { "/Tools/sep3", NULL, NULL, 0, "<Separator>", NULL }, { N_("/Tools/Mute _Sounds"), "<CTL>S", pidgin_blist_mute_sounds_cb, 0, "<CheckItem>", NULL }, /* Help */ @@ -3106,9 +3106,9 @@ { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "<StockItem>", GTK_STOCK_HELP }, { N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL }, #if GTK_CHECK_VERSION(2,6,0) - { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "<StockItem>", GTK_STOCK_ABOUT }, + { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, (int)pidgin_dialogs_about_with_parent, "<StockItem>", GTK_STOCK_ABOUT }, #else - { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "<Item>", NULL }, + { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, (int)pidgin_dialogs_about_with_parent, "<Item>", NULL }, #endif };
--- a/pidgin/gtklog.c Sun Oct 14 01:57:08 2007 +0000 +++ b/pidgin/gtklog.c Sun Oct 14 02:13:14 2007 +0000 @@ -523,7 +523,7 @@ } } -static PidginLogViewer *display_log_viewer(struct log_viewer_hash_t *ht, GList *logs, +static PidginLogViewer *display_log_viewer(GtkWindow *parent, struct log_viewer_hash_t *ht, GList *logs, const char *title, GtkWidget *icon, int log_size) { PidginLogViewer *lv; @@ -569,7 +569,7 @@ g_hash_table_insert(log_viewers, ht, lv); /* Window ***********/ - lv->window = gtk_dialog_new_with_buttons(title, NULL, 0, + lv->window = gtk_dialog_new_with_buttons(title, parent, 0, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); #ifdef _WIN32 /* Steal the "HELP" response and use it to trigger browsing to the logs folder */ @@ -676,6 +676,10 @@ } void pidgin_log_show(PurpleLogType type, const char *screenname, PurpleAccount *account) { + pidgin_log_show_with_parent(NULL, type, screenname, account); +} + +void pidgin_log_show_with_parent(GtkWindow *parent, PurpleLogType type, const char *screenname, PurpleAccount *account) { struct log_viewer_hash_t *ht; PidginLogViewer *lv = NULL; const char *name = screenname; @@ -720,7 +724,7 @@ prpl_icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); - display_log_viewer(ht, purple_log_get_logs(type, screenname, account), + display_log_viewer(parent, ht, purple_log_get_logs(type, screenname, account), title, gtk_image_new_from_pixbuf(prpl_icon), purple_log_get_total_size(type, screenname, account)); @@ -730,6 +734,10 @@ } void pidgin_log_show_contact(PurpleContact *contact) { + pidgin_log_show_contact_with_parent(NULL, contact); +} + +void pidgin_log_show_contact_with_parent(GtkWindow *parent, PurpleContact *contact) { struct log_viewer_hash_t *ht = g_new0(struct log_viewer_hash_t, 1); PurpleBlistNode *child; PidginLogViewer *lv = NULL; @@ -783,11 +791,16 @@ } title = g_strdup_printf(_("Conversations with %s"), name); - display_log_viewer(ht, logs, title, image, total_log_size); + display_log_viewer(parent, ht, logs, title, image, total_log_size); g_free(title); } -void pidgin_syslog_show() +void pidgin_syslog_show(void) +{ + pidgin_syslog_show_with_parent(NULL); +} + +void pidgin_syslog_show_with_parent(GtkWindow *parent) { GList *accounts = NULL; GList *logs = NULL; @@ -807,7 +820,7 @@ } logs = g_list_sort(logs, purple_log_compare); - syslog_viewer = display_log_viewer(NULL, logs, _("System Log"), NULL, 0); + syslog_viewer = display_log_viewer(parent, NULL, logs, _("System Log"), NULL, 0); } /****************************************************************************