aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/groupwise-features/junk-mail-settings.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-09-23 00:44:48 +0800
committerMilan Crha <mcrha@redhat.com>2009-09-23 00:46:33 +0800
commitffe9df88b271e52aa8934762e73ed70b01464a60 (patch)
tree4eb70294042e441cf611b4115b49a73d2e841164 /plugins/groupwise-features/junk-mail-settings.c
parent7c80528594c272e3295dae6a4e11e27fd1763466 (diff)
downloadgsoc2013-evolution-ffe9df88b271e52aa8934762e73ed70b01464a60.tar
gsoc2013-evolution-ffe9df88b271e52aa8934762e73ed70b01464a60.tar.gz
gsoc2013-evolution-ffe9df88b271e52aa8934762e73ed70b01464a60.tar.bz2
gsoc2013-evolution-ffe9df88b271e52aa8934762e73ed70b01464a60.tar.lz
gsoc2013-evolution-ffe9df88b271e52aa8934762e73ed70b01464a60.tar.xz
gsoc2013-evolution-ffe9df88b271e52aa8934762e73ed70b01464a60.tar.zst
gsoc2013-evolution-ffe9df88b271e52aa8934762e73ed70b01464a60.zip
GN-bug #593617 - GroupWise plugins are not built
Diffstat (limited to 'plugins/groupwise-features/junk-mail-settings.c')
-rw-r--r--plugins/groupwise-features/junk-mail-settings.c74
1 files changed, 19 insertions, 55 deletions
diff --git a/plugins/groupwise-features/junk-mail-settings.c b/plugins/groupwise-features/junk-mail-settings.c
index bfaeee585d..fe82ccb4d5 100644
--- a/plugins/groupwise-features/junk-mail-settings.c
+++ b/plugins/groupwise-features/junk-mail-settings.c
@@ -29,22 +29,14 @@
#include <stdio.h>
#include <gtk/gtk.h>
-#include "camel/camel-store.h"
-#include "camel/camel-folder.h"
-#include "camel/camel-medium.h"
-#include "camel/camel-mime-message.h"
-#include "mail/em-popup.h"
-#include <mail/em-folder-view.h>
+#include <mail/e-mail-reader.h>
+
#include <e-gw-connection.h>
-#include "mail/em-account-editor.h"
-#include "libedataserver/e-account.h"
-#include "mail/em-config.h"
+
+#include "gw-ui.h"
#include "share-folder.h"
#include "junk-settings.h"
-void
-org_gnome_junk_settings(EPlugin *ep, EMPopupTargetSelect *t);
-
static void
abort_changes (JunkSettings *js)
{
@@ -65,17 +57,26 @@ junk_dialog_response (GtkWidget *dialog, gint response, JunkSettings *js)
}
-static void
-junk_mail_settings (EPopup *ep, EPopupItem *item, gpointer data)
+void
+gw_junk_mail_settings_cb (GtkAction *action, EShellView *shell_view)
{
GtkWidget *dialog ,*w, *notebook, *box;
JunkSettings *junk_tab;
gint page_count =0;
EGwConnection *cnc;
gchar *msg;
- CamelFolder *folder = (CamelFolder *)data;
- CamelStore *store = folder->parent_store;
- cnc = get_cnc (store);
+ EShellContent *shell_content;
+ EMailReader *reader;
+ MessageList *message_list;
+
+ shell_content = e_shell_view_get_shell_content (shell_view);
+
+ reader = (EMailReader *) (shell_content);
+ message_list = e_mail_reader_get_message_list (reader);
+ g_return_if_fail (message_list != NULL);
+ g_return_if_fail (message_list->folder != NULL);
+
+ cnc = get_cnc (message_list->folder->parent_store);
dialog = gtk_dialog_new_with_buttons (_("Junk Settings"),
NULL,
@@ -99,7 +100,7 @@ junk_mail_settings (EPopup *ep, EPopupItem *item, gpointer data)
w = (GtkWidget *)junk_tab->vbox;
gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 6);
- /*We might have to add more options for settings i.e. more pages*/
+ /* We might have to add more options for settings i.e. more pages */
while (page_count > 0 ) {
notebook = gtk_notebook_new ();
gtk_notebook_append_page ((GtkNotebook *)notebook, box, NULL);
@@ -112,40 +113,3 @@ junk_mail_settings (EPopup *ep, EPopupItem *item, gpointer data)
g_signal_connect (dialog, "response", G_CALLBACK (junk_dialog_response), junk_tab);
gtk_widget_show_all (dialog);
}
-
-static EPopupItem popup_items[] = {
- { E_POPUP_ITEM, (gchar *) "50.emfv.05", (gchar *) N_("Junk Mail Settings..."), junk_mail_settings, NULL, NULL, 0, EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY}
-};
-
-static void
-popup_free (EPopup *ep, GSList *items, gpointer data)
-{
-g_slist_free (items);
-}
-
-void
-org_gnome_junk_settings(EPlugin *ep, EMPopupTargetSelect *t)
-{
- GSList *menus = NULL;
-
- gint i = 0;
- static gint first = 0;
-
- if (! g_strrstr (t->uri, "groupwise://"))
- return;
-
- /* for translation*/
- if (!first) {
- popup_items[0].label = _(popup_items[0].label);
-
- }
-
- first++;
-
- for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++)
- menus = g_slist_prepend (menus, &popup_items[i]);
-
- e_popup_add_items (t->target.popup, menus, NULL, popup_free, t->folder);
-
-}
-