diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2012-01-06 08:42:40 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2012-01-06 08:42:40 +0000 |
commit | 07d534bd00afb989cfd472eb22f463d31be71b03 (patch) | |
tree | 76ec992f3c508b790d9f5ae4b7471ed18aaee7c0 /src | |
parent | a66da11c866424de50962209f38708a15b61b2d3 (diff) |
added new plug-in signals to notify start and end of receiving.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3005 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/inc.c | 9 | ||||
-rw-r--r-- | src/plugin-marshal.list | 1 | ||||
-rw-r--r-- | src/plugin.c | 22 | ||||
-rw-r--r-- | src/plugin.h | 7 |
4 files changed, 38 insertions, 1 deletions
@@ -61,6 +61,7 @@ #include "filter.h" #include "folder.h" #include "procheader.h" +#include "plugin.h" static GList *inc_dialog_list = NULL; @@ -167,6 +168,8 @@ static void inc_finished(MainWindow *mainwin, gint new_messages) trayicon_set_notify(TRUE); } + syl_plugin_signal_emit("inc-mail-finished", new_messages); + inc_block_notify(FALSE); if (new_messages <= 0 && !prefs_common.scan_all_after_inc) return; @@ -213,6 +216,8 @@ void inc_mail(MainWindow *mainwin) summary_write_cache(mainwin->summaryview); main_window_lock(mainwin); + syl_plugin_signal_emit("inc-mail-start", cur_account); + if (prefs_common.use_extinc && prefs_common.extinc_cmd) { /* external incorporating program */ if (execute_command_line(prefs_common.extinc_cmd, FALSE) != 0) { @@ -406,6 +411,8 @@ gint inc_account_mail(MainWindow *mainwin, PrefsAccount *account) summary_write_cache(mainwin->summaryview); main_window_lock(mainwin); + syl_plugin_signal_emit("inc-mail-start", account); + new_msgs = inc_account_mail_real(mainwin, account); inc_finished(mainwin, new_msgs); @@ -431,6 +438,8 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck) summary_write_cache(mainwin->summaryview); main_window_lock(mainwin); + syl_plugin_signal_emit("inc-mail-start", NULL); + if (prefs_common.inc_local) { new_msgs = inc_spool(); if (new_msgs < 0) diff --git a/src/plugin-marshal.list b/src/plugin-marshal.list index 07b7f3de..7ae8571e 100644 --- a/src/plugin-marshal.list +++ b/src/plugin-marshal.list @@ -2,3 +2,4 @@ VOID:POINTER VOID:POINTER,POINTER,STRING,STRING,POINTER BOOLEAN:POINTER,INT,INT,STRING,POINTER VOID:POINTER,POINTER,BOOLEAN +VOID:INT diff --git a/src/plugin.c b/src/plugin.c index 666a4fb2..c3be1255 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -38,6 +38,8 @@ enum { TEXTVIEW_MENU_POPUP, COMPOSE_SEND, MESSAGEVIEW_SHOW, + INC_MAIL_START, + INC_MAIL_FINISHED, LAST_SIGNAL }; @@ -200,6 +202,26 @@ 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), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, inc_mail_start), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, + G_TYPE_POINTER); + plugin_signals[INC_MAIL_FINISHED] = + g_signal_new("inc-mail-finished", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET(SylPluginClass, inc_mail_finished), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, + 1, + G_TYPE_INT); } void syl_plugin_signal_connect(const gchar *name, GCallback callback, diff --git a/src/plugin.h b/src/plugin.h index f966fd69..c9bd3830 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -45,7 +45,7 @@ typedef void (*SylPluginLoadFunc) (void); typedef void (*SylPluginUnloadFunc) (void); typedef void (*SylPluginCallbackFunc) (void); -#define SYL_PLUGIN_INTERFACE_VERSION 0x0108 +#define SYL_PLUGIN_INTERFACE_VERSION 0x0109 struct _SylPlugin { @@ -83,6 +83,11 @@ struct _SylPluginClass gpointer msgview, MsgInfo *msginfo, gboolean all_headers); + + void (* inc_mail_start) (GObject *obj, + PrefsAccount *account); + void (* inc_mail_finished) (GObject *obj, + gint new_messages); }; struct _SylPluginInfo |