diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-18 04:06:17 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-18 04:06:17 +0800 |
commit | c22126d54f0cf0637e3d5ddd5d78b3ff5d111582 (patch) | |
tree | 64f296a85dd817e3184159126e8dbde39c173363 /plugins/mail-account-disable/mail-account-disable.c | |
parent | 4d07d219d1f18aeba2c16317ade4b4004d8934b9 (diff) | |
download | gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.gz gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.zst gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.zip |
Hack GtkIconTheme so we can reference category icons as named icons.
Necessary for EActionComboBox, since GtkActions can only handle named
or stock icons. Hopefully this is just a temporary hack. Eventually
we should make the category icons themeable.
Kill the "mail-account-disable" plugin and integrate it properly.
More dead plugins to follow...
Don't show disabled menu items in pop-up context menus. It does the
user no good to see things he CAN'T do with the object he clicked on.
svn path=/branches/kill-bonobo/; revision=37093
Diffstat (limited to 'plugins/mail-account-disable/mail-account-disable.c')
-rw-r--r-- | plugins/mail-account-disable/mail-account-disable.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/plugins/mail-account-disable/mail-account-disable.c b/plugins/mail-account-disable/mail-account-disable.c deleted file mode 100644 index 886b66a66f..0000000000 --- a/plugins/mail-account-disable/mail-account-disable.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Shreyas Srinivasan <sshreyas@novell.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <glib.h> -#include <glib/gi18n.h> -#include <string.h> -#include <mail/mail-component.h> -#include <mail/em-folder-selector.h> -#include <mail/em-popup.h> -#include <mail/em-account-editor.h> -#include <mail/mail-config.h> -#include <libedataserver/e-account.h> -#include <libedataserver/e-account-list.h> - -#define ACCOUNT_DISABLE 0 -#define PROXY_LOGOUT 1 - -void mail_account_disable (EPopup *ep, EPopupItem *p, void *data); -void org_gnome_create_mail_account_disable (EPlugin *ep, EMPopupTargetFolder *t); - -static EPopupItem popup_items[] = { - { E_POPUP_ITEM, "40.emc.04", N_("_Disable"), mail_account_disable, NULL, NULL, 0, EM_POPUP_FOLDER_STORE }, - { E_POPUP_ITEM, "40.emc.04", N_("Proxy _Logout"), mail_account_disable, NULL, NULL, 0, EM_POPUP_FOLDER_STORE } -}; - -static void -popup_free (EPopup *ep, GSList *items, void *data) -{ - g_slist_free (items); -} - -void -mail_account_disable (EPopup *ep, EPopupItem *p, void *data) -{ - MailComponent *component; - EAccount *account = data; - - g_assert (account != NULL); - - component = mail_component_peek (); - - if (mail_config_has_proxies (account)) - mail_config_remove_account_proxies (account); - - account->enabled = !account->enabled; - e_account_list_change (mail_config_get_accounts (), account); - mail_component_remove_store_by_uri (component, account->source->url); - - if (account->parent_uid) - mail_config_remove_account (account); - - mail_config_save_accounts(); -} - -void -org_gnome_create_mail_account_disable (EPlugin *ep, EMPopupTargetFolder *t) -{ - EAccount *account; - GSList *menus = NULL; - - account = mail_config_get_account_by_source_url (t->uri); - - if (account == NULL) - return; - - if (g_strrstr (t->uri,"groupwise://") && account->parent_uid) { - popup_items[PROXY_LOGOUT].label = _(popup_items [PROXY_LOGOUT].label); - menus = g_slist_prepend (menus, &popup_items [PROXY_LOGOUT]); - } - else { - popup_items[ACCOUNT_DISABLE].label = _(popup_items [ACCOUNT_DISABLE].label); - menus = g_slist_prepend (menus, &popup_items [ACCOUNT_DISABLE]); - } - - e_popup_add_items (t->target.popup, menus, NULL, popup_free, account); -} - |