aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-config-autocompletion.c
blob: df232e806732df4d672b7f53cb2895529ffb83ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* e-shell-config-autocompletion.c - Configuration page for addressbook autocompletion.
 *
 * Copyright (C) 2002 Ximian, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Authors: Chris Lahey <clahey@ximian.com>
 *          Chris Toshok <toshok@ximian.com>
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif


#include "e-shell-config-autocompletion.h"

#include "e-folder-list.h"

#include "Evolution.h"

#include <bonobo/bonobo-exception.h>

#include <libgnome/gnome-i18n.h>
#include <gtk/gtkwidget.h>
#include <gtk/gtksignal.h>

#include <gconf/gconf-client.h>


typedef struct {
    EvolutionConfigControl *config_control;

    GtkWidget *control_widget;

    EvolutionShellClient *shell_client;
} EvolutionAutocompletionConfig;

static void
folder_list_changed_callback (EFolderList *efl,
                  EvolutionAutocompletionConfig *ac)
{
    evolution_config_control_changed (ac->config_control);
}

static void
config_control_destroy_notify (void *data,
                   GObject *where_the_config_control_was)
{
    EvolutionAutocompletionConfig *ac = (EvolutionAutocompletionConfig *) data;

    g_object_unref (ac->shell_client);

    g_free (ac);
}


static void
config_control_apply_callback (EvolutionConfigControl *config_control,
                   EvolutionAutocompletionConfig *ac)
{
    GConfClient *client;
    char *xml;

    client = gconf_client_get_default ();

    xml = e_folder_list_get_xml (E_FOLDER_LIST (ac->control_widget));
    gconf_client_set_string (client, "/apps/evolution/addressbook/completion/uris", xml, NULL);
    g_free (xml);

    g_object_unref (client);
}

GtkWidget *
e_shell_config_autocompletion_create_widget (EShell *shell, EvolutionConfigControl *config_control)
{
    EvolutionAutocompletionConfig *ac;
    CORBA_Environment ev;
    GConfClient *client;
    static const char *possible_types[] = { "contacts/*", NULL };
    char *xml;

    ac = g_new0 (EvolutionAutocompletionConfig, 1);

    CORBA_exception_init (&ev);

    ac->shell_client = evolution_shell_client_new (BONOBO_OBJREF (shell));

    client = gconf_client_get_default ();
    xml = gconf_client_get_string (client, "/apps/evolution/addressbook/completion/uris", NULL);
    g_object_unref (client);

    ac->control_widget = e_folder_list_new (ac->shell_client, xml);
    g_free (xml);

    g_object_set((ac->control_widget),
            "title", _("Extra Completion folders"),
            "possible_types", possible_types,
            NULL);

    gtk_widget_show (ac->control_widget);

    ac->config_control = config_control;

    g_signal_connect (ac->control_widget, "changed",
              G_CALLBACK (folder_list_changed_callback), ac);
    g_signal_connect (ac->config_control, "apply",
              G_CALLBACK (config_control_apply_callback), ac);

    g_object_weak_ref (G_OBJECT (ac->config_control), config_control_destroy_notify, ac);

    CORBA_exception_free (&ev);

    return ac->control_widget;
}

lass='insertions'>+4 | * editors/emacs: Update to version 26.3jrm2019-08-312-24/+15 | * editors/jucipp: Fix WWWtobik2019-08-301-1/+1 * | Merge remote-tracking branch 'upstream/master'Koop Mast2019-08-24137-650/+723 |\| | * Workaround for build failure due to newer C++ features when KDE5 and QT5 definedlwhsu2019-08-222-0/+34 | * - Update to 6.3.0lwhsu2019-08-20109-512/+439 | * Fix build of editors/calligraplan.adridg2019-08-201-0/+68 | * devel/boost-*: update to 1.71.0jbeich2019-08-1910-10/+10 | * - Bump PORTREVISION (lazarus ports were updated to 2.0.4)acm2019-08-161-2/+1 | * - Remove LD_UNSAFE (I forgotten it on previous commit)acm2019-08-161-1/+0 | * - Update to 1.84.2acm2019-08-164-82/+77 | * - Update to 2.0.4acm2019-08-163-12/+42 | * Update KDE Applications to latest upstream release, 19.08adridg2019-08-154-28/+49 | * lang/rust: Update to 1.37.0tobik2019-08-154-4/+4 * | Merge remote-tracking branch 'upstream/master'Koop Mast2019-08-1555-2866/+234 |\| | * Update KDE Frameworks to latest upstream release, 5.61adridg2019-08-153-0/+70 | * Convert to UCL & cleanup pkg-message (categories e-g)mat2019-08-1414-22/+84 | * editors/emacs-devel: Update to 2019-08-12 commit, 2b329edjrm2019-08-133-8/+7 | * - Switch to the version maintained by the developers of Wanderlust.nobutaka2019-08-128-65/+27 | * - Switch to the version maintained by the developers of Wanderlust.nobutaka2019-08-1213-474/+29 | * - Switch to the version maintained by the developers of Wanderlust.nobutaka2019-08-1210-2292/+9 | * - reclaimjgh2019-08-081-1/+1 | * - Update to 1.16.6zi2019-08-083-4/+7 * | Merge remote-tracking branch 'upstream/master'Koop Mast2019-08-0754-89/+106 |\| | * Return jgh's ports to the various pools after his commit bit was safekept.rene2019-08-061-1/+1 | * Mark BROKEN: unfetchableantoine2019-08-042-0/+4 | * Deprecate ports broken for more than 6 monthsantoine2019-08-042-0/+6 | * vim: Simplify patchadamw2019-08-041-23/+9 | * vim: Update to patchlevel 1790adamw2019-08-022-21/+21 | * editors/emacs-devel: Update to 2019-08-01 commit, b22b59cjrm2019-08-013-5/+7 | * graphics/poppler: update to 0.79.0tcberner2019-08-016-5/+6 | * Update mousepad to 0.4.2madpilot2019-07-303-7/+13 | * - Use "localbase" instead of CPPFLAGSdanilo2019-07-291-2/+1 | * - Update to 4.3danilo2019-07-292-4/+5 | * Bump PORTREVISION for ports depending on the canonical version of GCCgerald2019-07-2739-27/+39 * | Merge remote-tracking branch 'upstream/master'Koop Mast2019-07-27127-562/+507 |\| | * editors/texmaker:makc2019-07-267-62/+70 | * Drop maintainershipgblach2019-07-191-1/+1 | * - Update to git snapshot ed29d9fashish2019-07-143-13/+16 | * Remove expired ports:rene2019-07-146-56/+0 | * Prepare for powerpc-on-clang by deleting hard-coded tests for architecturelinimon2019-07-131-1/+1 | * KDE Applications: update to 19.04.3tcberner2019-07-122-3/+4 | * x11-toolkits/scintilla: update 4.1.0 -> 4.2.0pi2019-07-114-21/+11 | * - Update to 6.2.5lwhsu2019-07-08103-405/+404 * | Git and myself don't get along, I messed up the master branch really goodKoop Mast2019-07-27185-963/+1947 |\| | * neovim: Update to 0.3.8adamw2019-07-052-4/+4 | * editors/nvi-devel: Take maintainership. Update MASTER_SITES to useleres2019-07-051-2/+3 | * lang/rust: Update to 1.36.0tobik2019-07-044-3/+4 | * editors/nvi-devel: Fix DB_CREATE error and segmentation fault; addleres2019-07-042-1/+17 | * editors/kakoune: Update to 2019.07.01tobik2019-07-014-100/+167 | * editors/xcoral: fix buildpkubaj2019-07-011-1/+1 | * editors/quilter: fix buildpkubaj2019-07-011-1/+1 | * editors/with-editor: Update to 2.8.3swills2019-07-012-4/+4 | * graphics/poppler: update to 0.78.0tcberner2019-06-296-5/+6 | * Convert all Go ports to USES=gotobik2019-06-291-1/+1 | * editors/quilter: Update 1.9.1 -> 1.9.2yuri2019-06-282-4/+4 | * - Update WWWamdmi32019-06-271-1/+1 | * Clean up final leftovers from Qt4.rene2019-06-265-11/+8 | * - Update WWWamdmi32019-06-241-1/+1 | * editors/nano: Make several port improvementskoobs2019-06-242-7/+9 | * KDE Applications: complete dependency liststcberner2019-06-231-1/+2 | * New port: editors/quilter: Editor allowing you to focus on your writingyuri2019-06-236-0/+99 | * - Simplify XFCE MASTER_SITES usagemadpilot2019-06-201-1/+1 | * - Remove dependence on devel/patchlwhsu2019-06-192-3/+8 | * - Update to git snapshot 83095a8ashish2019-06-163-5/+10 | * editors/nedit: take maintainershipswills2019-06-141-1/+1 | * editors/linux-sublime: Update MASTER_SITEmeta2019-06-141-1/+1 | * editors/vim: remove meaningless 85+ from USES tclgahr2019-06-121-1/+1 | * Mark as deprecated a bunch of abandonware using sys/dir.hbapt2019-06-121-0/+3 | * editors/featherpad: Update to 0.10.0jsm2019-06-093-5/+11 | * editors/the: Canonicalize options group names after r503781 (D20426)tobik2019-06-091-3/+3 | * Update KDE Applications to 19.04.2tcberner2019-06-071-3/+3 | * editors/neovim-qt: fix buildpkubaj2019-06-071-1/+1 | * editors/texstudio: Update to 2.12.16rigoletto2019-06-043-5/+6 | * Point the vim-tiny plist specifically at ${.CURDIR}adamw2019-06-041-1/+1 | * Add forgotten pkg-plist for vim-tinyadamw2019-06-012-3/+4 | * Update to Vim to patchlevel 1439, change default python, improve vimrcadamw2019-06-015-55/+42 | * graphics/poppler: update to 0.77.0tcberner2019-06-016-5/+6 | * Update neovim to 0.3.7adamw2019-05-292-4/+4 | * editors/kak-lsp: Update to 6.2.1tobik2019-05-292-6/+6 | * Update neovim to 0.3.6adamw2019-05-292-5/+4 | * Disable LuaJIT on non-x86 architecturesadamw2019-05-281-4/+16 | * editors/scite, x11-toolkits/scintilla: Remove nop CXXSTDtobik2019-05-271-1/+0 | * editors/emacs-devel: Update to recent master-branch commit, ec4b2c8jrm2019-05-263-6/+10 | * archivers/quazip: update to 0.8tcberner2019-05-261-1/+1 | * editors/calligra: fix plisttcberner2019-05-251-0/+2 | * editors/openoffice-devel: Fix spelling of MYSQL_DESCtobik2019-05-251-1/+1 | * lang/rust: Update to 1.35.0tobik2019-05-244-4/+4 | * - Update to 6.2.4lwhsu2019-05-24103-405/+404 | * editors/ecrire: Update 0.3.3 -> 0.3.4yuri2019-05-232-5/+4 | * editors/mg: Update to 6.5tobik2019-05-222-4/+10 | * lang/rust: Update to 1.34.2tobik2019-05-154-0/+4 | * graphics/poppler: update to 0.76.1tcberner2019-05-147-6/+7 | * - WPS import plugin request libwps-0.4, not -0.3fluffy2019-05-131-5/+5 | * editors/kak-lsp: Update to 6.2.0tobik2019-05-123-142/+124 | * update mate desktop to 1.22.1ericbsd2019-05-123-6/+7 | * Update KDE Applications to 19.04.1tcberner2019-05-101-3/+3 | * Remove expired ports:rene2019-05-095-105/+0 | * editors/parinfer-rust: Update to 0.3.1 (nop)tobik2019-05-082-6/+4 | * editors/wxhexeditor: fix build with GCC-based architecturespkubaj2019-05-061-1/+1 | * This port now builds on aarch64.linimon2019-05-061-1/+0 | * New port: editors/xi-termkai2019-05-054-0/+479 | * editors/xi-core: Update to latest snapshotkai2019-05-053-64/+461 | * Fix the a ports that were broken but did not know it.mat2019-05-031-2/+2 | * editors/emacs-devel: Update to latest master-branch commit, d17ae7fjrm2019-05-033-6/+5 | * Update vim to patchlevel 1248adamw2019-05-033-4/+18 | * Remove esound support from pulseaudio as audio/esound expired.rene2019-05-021-0/+1 |/ * editors/ghostwriter: Update to 1.8.0tobik2019-04-292-8/+9 * Update neovim to 0.3.5adamw2019-04-292-5/+4 * Bump PORTREVISION for ports using EMACS_VERSION_SITE_LISPDIRjrm2019-04-285-4/+5 * Change RUN_DEPENDS from rubygem-msgpack1 to rubygem-msgpacksunpoet2019-04-281-1/+3 * - Update to 4.2danilo2019-04-262-4/+4 * Clean up plistantoine2019-04-253-127/+127 * editors/dte: update to 1.8.2swills2019-04-232-4/+4 * - Update to 4.1danilo2019-04-232-4/+4 * - Update to 6.2.3lwhsu2019-04-21104-423/+404 * editors/dte: Update to 1.8swills2019-04-192-4/+7 * Update KDE Applications to 19.04.0tcberner2019-04-192-4/+3 * editors/emacs: Update to version 26.2jrm2019-04-174-40/+18 * - Update to git snapshot da3e3fcashish2019-04-153-9/+7 * devel/boost-*: update to 1.70.0jbeich2019-04-1210-9/+10 * lang/rust: Update to 1.34.0tobik2019-04-123-2/+3 * Bump a few PORTREVISIONs after r498529antoine2019-04-101-0/+1 * security/botan2: update to 2.10.0jbeich2019-04-081-1/+1 * Deprecate ports broken for more than 6 monthsantoine2019-04-071-0/+2 * Update vim to patchlevel 1099adamw2019-04-022-4/+4 * - Update to 4.0danilo2019-04-023-4/+5 * Drop USES=geckojbeich2019-03-301-2/+1 * Update to openoffice-devel to AOO420-Dev-m1 developer snapshot.truckman2019-03-302-4/+4 * Add USES=compiler:c++11-lang to fix build on GCC-based architectures.linimon2019-03-291-1/+2 * - Resurrect `editors/e93' and fix distfile fetching (unfortunately,danfe2019-03-299-1/+171 * Bump revision to make sure port is build against new libgit2 version 0.28.1.mfechner2019-03-283-2/+3 * graphics/poppler: update to 0.75tcberner2019-03-286-6/+6 * devel/icu: update to 64.1jbeich2019-03-282-2/+2 * - Add QT5 and KDE5 options [1]lwhsu2019-03-284-21/+74 * Use the correct FLAVOR for the optional pynvim dependency.adamw2019-03-271-1/+2 * Finish gwrite removalantoine2019-03-251-1/+0 * Remove expired webkit-gtk2 and webkit-gtk3 ports.kwm2019-03-254-106/+0 * Connect libreoffice-dsb and libreoffice-kablwhsu2019-03-231-0/+2 * Update to 6.2.2lwhsu2019-03-23124-775/+566 * editors/mp: Update to 5.31jhale2019-03-227-200/+142 * For those of us who prefer vi over vim there are no good optionsleres2019-03-222-2/+259 * Unlike the base vi (nvi 2.1.3), nvi-devel calls flock() on a writableleres2019-03-222-1/+12 * Chase webkit-gtk2 expirationantoine2019-03-211-0/+3 * Switch to devel/llvm80 for DEFAULT_VERSIONSjbeich2019-03-201-0/+1 * Add PYNVIM optionadamw2019-03-201-1/+4 * Remove trailing spaceadamw2019-03-201-1/+1 * Remove neovim from TEST_DEPENDS, and original submitter becomes maintaineradamw2019-03-201-5/+6 * New port: editors/py-pynvim: Python client and plugin host for Neovim0mp2019-03-185-0/+51 * Qt4 deprecationtcberner2019-03-172-16/+0 * editors/lazarus: remove qt4 flavor (Qt4 deprecation)tcberner2019-03-171-2/+1 * Qt4 deprecation: Remove Qt4 and its consumes.tcberner2019-03-1733-730/+0 * multimedia/phonon, multimedia/phonon-gestreamer, multimedia/phonon-designerpl...tcberner2019-03-171-1/+1 * devel/qca: remove flavors (Qt4 deprecation)tcberner2019-03-171-2/+2 * archivers/quazip: remove flavors (Qt4 deprecation)tcberner2019-03-171-2/+2 * editors/texmaker: remove QT4/QT5 options (Qt4 deprecation)tcberner2019-03-161-24/+5 * editors/texmacs: remove QT4 option (Qt4 deprecation)tcberner2019-03-161-18/+4 * editors/mp: remove QT4 option (Qt4 deprecation)tcberner2019-03-161-12/+2 * Fix build on gcc-based architectures:linimon2019-03-151-1/+2 * editors/emacs-devel: Update to latest commit, 8b30082jrm2019-03-143-6/+5 * editors/focuswriter: Update to 1.7.2kai2019-03-102-5/+4 * Update KDE Applications to 18.12.3tcberner2019-03-081-3/+3 * editors/poedit: unbreak after r493853jbeich2019-03-071-1/+1 * - New port: editors/cudatextacm2019-03-076-0/+1042 * - Update to 3.7.4acm2019-03-073-10/+10 * - Bump PORTREVISION. lang/ldc was update to 1.14.0acm2019-03-071-1/+1 * - Bump PORTREVISION. editors/lazarus was updated to 2.0.0acm2019-03-071-1/+1 * - Update to 2.0.0acm2019-03-073-8/+7 * Update MASTER_SITES.hrs2019-03-041-1/+1 * editors/kak-lsp: Update to 6.1.0tobik2019-03-02