Mercurial > pidgin.yaz
changeset 20615:78ef8bd992f9
Re-worked gtklog functions and perl bindings
author | Gabriel Schulhof <nix@go-nix.ca> |
---|---|
date | Sat, 22 Sep 2007 20:55:11 +0000 |
parents | 64d8871bef8f |
children | 56a470fc7be8 |
files | pidgin/gtkblist.c pidgin/gtkconv.c pidgin/gtkdialogs.c pidgin/gtklog.c pidgin/gtklog.h pidgin/plugins/perl/common/GtkLog.xs |
diffstat | 6 files changed, 45 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Sat Sep 22 20:41:58 2007 +0000 +++ b/pidgin/gtkblist.c Sat Sep 22 20:55:11 2007 +0000 @@ -643,7 +643,7 @@ name = prpl_info->get_chat_name(c->components); } } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { - pidgin_log_show_contact(GTK_WINDOW(gtkblist->window), (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(GTK_WINDOW(gtkblist->window), type, name, account); + pidgin_log_show_with_parent(GTK_WINDOW(gtkblist->window), type, name, account); g_free(name); pidgin_clear_cursor(gtkblist->window); @@ -3098,7 +3098,7 @@ { "/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, pidgin_blist_show_with_parent, (int)pidgin_syslog_show, "<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 */
--- a/pidgin/gtkconv.c Sat Sep 22 20:41:58 2007 +0000 +++ b/pidgin/gtkconv.c Sat Sep 22 20:55:11 2007 +0000 @@ -1081,7 +1081,7 @@ PurpleBlistNode *node = cur->data; if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) { - pidgin_log_show_contact(GTK_WINDOW(win->window), (PurpleContact *)node->parent); + pidgin_log_show_contact_with_parent(GTK_WINDOW(win->window), (PurpleContact *)node->parent); g_slist_free(buddies); gdk_window_set_cursor(gtkblist->window->window, NULL); gdk_window_set_cursor(win->window->window, NULL); @@ -1090,7 +1090,7 @@ } g_slist_free(buddies); - pidgin_log_show(GTK_WINDOW(win->window), type, name, account); + pidgin_log_show_with_parent(GTK_WINDOW(win->window), type, name, account); gdk_window_set_cursor(gtkblist->window->window, NULL); gdk_window_set_cursor(win->window->window, NULL);
--- a/pidgin/gtkdialogs.c Sat Sep 22 20:41:58 2007 +0000 +++ b/pidgin/gtkdialogs.c Sat Sep 22 20:55:11 2007 +0000 @@ -944,7 +944,7 @@ PurpleBlistNode *node = cur->data; if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) { - pidgin_log_show_contact(GTK_WINDOW(gtkblist->window), (PurpleContact *)node->parent); + pidgin_log_show_contact_with_parent(GTK_WINDOW(gtkblist->window), (PurpleContact *)node->parent); g_slist_free(buddies); pidgin_clear_cursor(gtkblist->window); g_free(username); @@ -953,7 +953,7 @@ } g_slist_free(buddies); - pidgin_log_show(GTK_WINDOW(gtkblist->window), PURPLE_LOG_IM, username, account); + pidgin_log_show_with_parent(GTK_WINDOW(gtkblist->window), PURPLE_LOG_IM, username, account); pidgin_clear_cursor(gtkblist->window); }
--- a/pidgin/gtklog.c Sat Sep 22 20:41:58 2007 +0000 +++ b/pidgin/gtklog.c Sat Sep 22 20:55:11 2007 +0000 @@ -675,7 +675,11 @@ return lv; } -void pidgin_log_show(GtkWindow *parent, PurpleLogType type, const char *screenname, PurpleAccount *account) { +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; @@ -723,7 +727,11 @@ g_free(title); } -void pidgin_log_show_contact(GtkWindow *parent, PurpleContact *contact) { +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; @@ -781,7 +789,12 @@ g_free(title); } -void pidgin_syslog_show(GtkWindow *parent) +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;
--- a/pidgin/gtklog.h Sat Sep 22 20:41:58 2007 +0000 +++ b/pidgin/gtklog.h Sat Sep 22 20:55:11 2007 +0000 @@ -52,10 +52,13 @@ -void pidgin_log_show(GtkWindow *parent, PurpleLogType type, const char *screenname, PurpleAccount *account); -void pidgin_log_show_contact(GtkWindow *parent, PurpleContact *contact); +void pidgin_log_show(PurpleLogType type, const char *screenname, PurpleAccount *account); +void pidgin_log_show_with_parent(GtkWindow *parent, PurpleLogType type, const char *screenname, PurpleAccount *account); +void pidgin_log_show_contact(PurpleContact *contact); +void pidgin_log_show_contact_with_parent(GtkWindow *parent, PurpleContact *contact); -void pidgin_syslog_show(GtkWindow *parent); +void pidgin_syslog_show(void); +void pidgin_syslog_show_with_parent(GtkWindow *parent); /**************************************************************************/ /** @name GTK+ Log Subsystem */
--- a/pidgin/plugins/perl/common/GtkLog.xs Sat Sep 22 20:41:58 2007 +0000 +++ b/pidgin/plugins/perl/common/GtkLog.xs Sat Sep 22 20:55:11 2007 +0000 @@ -11,19 +11,29 @@ Purple::LogType type const char * screenname Purple::Account account -CODE: - pidgin_log_show(NULL, type, screenname, account); + +void +pidgin_log_show_with_parent(parent, type, screenname, account) + void * parent + Purple::LogType type + const char * screenname + Purple::Account account void pidgin_log_show_contact(contact) Purple::BuddyList::Contact contact -CODE: - pidgin_log_show_contact(NULL, contact); + +void +pidgin_log_show_contact_with_parent(parent, contact) + void * parent + Purple::BuddyList::Contact contact MODULE = Pidgin::Log PACKAGE = Pidgin::SysLog PREFIX = pidgin_syslog_ PROTOTYPES: ENABLE void pidgin_syslog_show() -CODE: - pidgin_syslog_show(NULL); + +void +pidgin_syslog_show_with_parent(parent) + void * parent