diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2012-01-18 07:52:40 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2012-01-18 07:52:40 +0000 |
commit | 1c5e07140eac1ee51cb0b6bd0949ed3cb6b2e04b (patch) | |
tree | e4273659547e4c311115da99768b5cfcfb469f44 /src | |
parent | 4211f707092f099744ff2f37207c611e0305b99d (diff) |
added new plug-in signals for preferences dialogs (#30)
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3014 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin-marshal.list | 2 | ||||
-rw-r--r-- | src/plugin.c | 74 | ||||
-rw-r--r-- | src/plugin.h | 21 | ||||
-rw-r--r-- | src/plugin_manager.c | 4 | ||||
-rw-r--r-- | src/prefs_account_dialog.c | 6 | ||||
-rw-r--r-- | src/prefs_common_dialog.c | 3 | ||||
-rw-r--r-- | src/prefs_filter.c | 5 | ||||
-rw-r--r-- | src/prefs_filter_edit.c | 6 | ||||
-rw-r--r-- | src/prefs_template.c | 5 |
9 files changed, 119 insertions, 7 deletions
diff --git a/src/plugin-marshal.list b/src/plugin-marshal.list index 7ae8571e..2c692c47 100644 --- a/src/plugin-marshal.list +++ b/src/plugin-marshal.list @@ -1,5 +1,7 @@ VOID:POINTER +VOID:POINTER,POINTER VOID:POINTER,POINTER,STRING,STRING,POINTER BOOLEAN:POINTER,INT,INT,STRING,POINTER VOID:POINTER,POINTER,BOOLEAN VOID:INT +VOID:POINTER,STRING,STRING,POINTER diff --git a/src/plugin.c b/src/plugin.c index c3be1255..212a736d 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2011 Hiroyuki Yamamoto + * Copyright (C) 1999-2012 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,6 +40,12 @@ enum { MESSAGEVIEW_SHOW, INC_MAIL_START, INC_MAIL_FINISHED, + PREFS_COMMON_OPEN, + PREFS_ACCOUNT_OPEN, + PREFS_FILTER_OPEN, + PREFS_FILTER_EDIT_OPEN, + PREFS_TEMPLATE_OPEN, + PLUGIN_MANAGER_OPEN, LAST_SIGNAL }; @@ -202,6 +208,7 @@ static void syl_plugin_class_init(SylPluginClass *klass) G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_BOOLEAN); + plugin_signals[INC_MAIL_START] = g_signal_new("inc-mail-start", G_TYPE_FROM_CLASS(gobject_class), @@ -222,6 +229,71 @@ static void syl_plugin_class_init(SylPluginClass *klass) G_TYPE_NONE, 1, G_TYPE_INT); + + plugin_signals[PREFS_COMMON_OPEN] = + g_signal_new("prefs-common-open", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, prefs_common_open), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + plugin_signals[PREFS_ACCOUNT_OPEN] = + g_signal_new("prefs-account-open", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, prefs_account_open), + NULL, NULL, + syl_plugin_marshal_VOID__POINTER_POINTER, + G_TYPE_NONE, + 2, + G_TYPE_POINTER, + G_TYPE_POINTER); + plugin_signals[PREFS_FILTER_OPEN] = + g_signal_new("prefs-filter-open", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, prefs_filter_open), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + plugin_signals[PREFS_FILTER_EDIT_OPEN] = + g_signal_new("prefs-filter-edit-open", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, prefs_filter_edit_open), + NULL, NULL, + syl_plugin_marshal_VOID__POINTER_STRING_STRING_POINTER, + G_TYPE_NONE, + 4, + G_TYPE_POINTER, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_POINTER); + plugin_signals[PREFS_TEMPLATE_OPEN] = + g_signal_new("prefs-template-open", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, prefs_template_open), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + plugin_signals[PLUGIN_MANAGER_OPEN] = + g_signal_new("plugin-manager-open", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, plugin_manager_open), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); } void syl_plugin_signal_connect(const gchar *name, GCallback callback, diff --git a/src/plugin.h b/src/plugin.h index c9bd3830..fc8b6dd3 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2011 Hiroyuki Yamamoto + * Copyright (C) 1999-2012 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include "procmsg.h" #include "folder.h" +#include "filter.h" /* SylPlugin object */ @@ -88,6 +89,24 @@ struct _SylPluginClass PrefsAccount *account); void (* inc_mail_finished) (GObject *obj, gint new_messages); + + /* Prefs dialogs */ + void (* prefs_common_open) (GObject *obj, + GtkWidget *window); + void (* prefs_account_open) (GObject *obj, + PrefsAccount *account, + GtkWidget *window); + void (* prefs_filter_open) (GObject *obj, + GtkWidget *window); + void (* prefs_filter_edit_open) (GObject *obj, + FilterRule *rule, + const gchar *header, + const gchar *key, + GtkWidget *window); + void (* prefs_template_open) (GObject *obj, + GtkWidget *window); + void (* plugin_manager_open) (GObject *obj, + GtkWidget *window); }; struct _SylPluginInfo diff --git a/src/plugin_manager.c b/src/plugin_manager.c index 71f14bdc..793fa5b1 100644 --- a/src/plugin_manager.c +++ b/src/plugin_manager.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2009 Hiroyuki Yamamoto + * Copyright (C) 1999-2012 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,6 +98,8 @@ void plugin_manager_open(void) gtk_widget_show(pm_window.window); manage_window_focus_in(pm_window.window, NULL, NULL); + + syl_plugin_signal_emit("plugin-manager-open", pm_window.window); } #ifdef USE_UPDATE_CHECK_PLUGIN diff --git a/src/prefs_account_dialog.c b/src/prefs_account_dialog.c index c560afc9..faf77734 100644 --- a/src/prefs_account_dialog.c +++ b/src/prefs_account_dialog.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2010 Hiroyuki Yamamoto + * Copyright (C) 1999-2012 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,6 +52,7 @@ #include "alertpanel.h" #include "smtp.h" #include "imap.h" +#include "plugin.h" static gboolean cancelled; static gboolean new_account; @@ -550,7 +551,10 @@ PrefsAccount *prefs_account_open(PrefsAccount *ac_prefs) } gtk_widget_show(dialog.window); + syl_plugin_signal_emit("prefs-account-open", new_account ? NULL : ac_prefs, dialog.window); + gtk_main(); + gtk_widget_hide(dialog.window); inc_unlock(); diff --git a/src/prefs_common_dialog.c b/src/prefs_common_dialog.c index 965321b2..6ddb6fb8 100644 --- a/src/prefs_common_dialog.c +++ b/src/prefs_common_dialog.c @@ -56,6 +56,7 @@ #include "alertpanel.h" #include "folder.h" #include "socket.h" +#include "plugin.h" static PrefsDialog dialog; @@ -742,6 +743,8 @@ void prefs_common_open(void) prefs_common_colorlabel_set_dialog(); gtk_widget_show(dialog.window); + + syl_plugin_signal_emit("prefs-common-open", dialog.window); } static void prefs_common_create(void) diff --git a/src/prefs_filter.c b/src/prefs_filter.c index 4185bcbb..4e8a6eaf 100644 --- a/src/prefs_filter.c +++ b/src/prefs_filter.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2008 Hiroyuki Yamamoto + * Copyright (C) 1999-2012 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,6 +50,7 @@ #include "gtkutils.h" #include "alertpanel.h" #include "xml.h" +#include "plugin.h" static struct FilterRuleListWindow { GtkWidget *window; @@ -143,6 +144,8 @@ void prefs_filter_open(MsgInfo *msginfo, const gchar *header, const gchar *key) gtk_widget_show(rule_list_window.window); manage_window_focus_in(rule_list_window.window, NULL, NULL); + syl_plugin_signal_emit("prefs-filter-open", rule_list_window.window); + if (msginfo) { FilterRule *rule; diff --git a/src/prefs_filter_edit.c b/src/prefs_filter_edit.c index ce00fde3..64da3a99 100644 --- a/src/prefs_filter_edit.c +++ b/src/prefs_filter_edit.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2008 Hiroyuki Yamamoto + * Copyright (C) 1999-2012 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,6 +49,7 @@ #include "stock_pixmap.h" #include "alertpanel.h" #include "folder.h" +#include "plugin.h" static struct FilterRuleEditWindow { GtkWidget *window; @@ -171,6 +172,9 @@ FilterRule *prefs_filter_edit_open(FilterRule *rule, const gchar *header, GTK_EVENTS_FLUSH(); gtk_widget_show(rule_edit_window.window); + syl_plugin_signal_emit("prefs-filter-edit-open", rule, header, key, + rule_edit_window.window); + rule_edit_window.new_rule = NULL; rule_edit_window.edit_finished = FALSE; while (rule_edit_window.edit_finished == FALSE) diff --git a/src/prefs_template.c b/src/prefs_template.c index 147ce29f..fb535744 100644 --- a/src/prefs_template.c +++ b/src/prefs_template.c @@ -1,7 +1,7 @@ /* * Sylpheed templates subsystem * Copyright (C) 2001 Alexander Barinov - * Copyright (C) 2001-2010 Hiroyuki Yamamoto + * Copyright (C) 2001-2012 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +41,7 @@ #include "mainwindow.h" #include "addr_compl.h" #include "quote_fmt.h" +#include "plugin.h" static struct Templates { GtkWidget *window; @@ -98,6 +99,8 @@ void prefs_template_open(void) prefs_template_window_setup(); gtk_widget_show(templates.window); + + syl_plugin_signal_emit("prefs-template-open", templates.window); } #define ADD_ENTRY(entry, str, row) \ |