~ubuntu-branches/ubuntu/hardy/deskbar-applet/hardy-proposed

« back to all changes in this revision

Viewing changes to deskbar/handlers/evolution/_evolution.override

  • Committer: Bazaar Package Importer
  • Author(s): Aron Sisak
  • Date: 2007-08-07 17:00:18 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: james.westby@ubuntu.com-20070807170018-ms9xlfneeo7x3aag
Tags: 2.19.6.1-0ubuntu1
* New upstream release (2.19.6.1):
  - Fixed bug #463974: 2.19.6 evolution handler does not build
  - Updated Translations: Gujarati, Spanish, Swedish, Thai
* New upstream release (2.19.6):
  - Added actions
  - Fixed bug #461627: Change the amount of items in history
  - Always show count in category header
  - Fixed evolution address book search with evo-ldap
  - Removed obsolete definitions from GConf and preferences and added
    new controls to preferences for previously unsupported options
  - Set process name to deskbar-applet
  - Cell containing the icon of a match doesn't expand anymore
  - Print tracebacks if module failed to load
  - Renamed gsoc_deskbar.py to deskbar-applet.py
  - Made sure that all icons are included in gnome-icon-theme
  - Added default icons for each category
  - Show window always in the foreground if triggered
  - Adjusted schema file so that intltool-merge works fast
  - Fixed: Pressing icon in panel didn't raise window
  - Don't show matches from a previous search if entry has been cleared by
    hand (i.e. not by hitting escape)
  - Fixed errors in epiphany and gdmactions module (Insted of printing error
    set INSTRUCION attribute)
  - Fixed bugs in BrowserMatch.py (fixes bug #438080)
  - Added: Check for duplicates
  - Make return value of get_hash() hashable for all modules
  - Only paste selection if keybinding has been activated
  - Each category has its own default icon
  - Fixed bug #456969: Desklicious plugin uses non-existent deskbar.Utils
  - Fixed bug #456968: Find /usr/lib*/firefox*/searchplugins
  - Fixed bug #456971: desklicious plugin improperly passess category to
    DeliciousMatch
  - Fixed bug #457133: DeliciousMatch has no 'name' and only default icon
  - Fixed bug #445145: Deskbar doesn't show up localized in the applet list
  - Fixed bug #456417: Poorly written schema descriptions
  - Updated Translations: Basque, Bengali, Dutch, Estonian, Finnish, French,
    German, Japanese, Norwegian, Slovenian, Spanish, Thai, Vietnamese
* New upstream release (2.19.5):
  - Major refactoring including a new GUI and Modules API.
  - Old modules won't work with this version
  - This release should contain almost all the features that Deskbar had
    before refactoring
* debian/patches/01_fix_python_interpreter.patch:
  - updated
* debian/patches/01_fix_pythonlib.patch:
  - dropped as not needed any more
* debian/patches/01_gpm_methods_naming_update.patch:
  - updated
* debian/patches/80-intltoolize.patch
  - updated via 'intltoolize --force'
* debian/patches/90_aclocal+autoconf+automake.patch:
  - updated via automagic

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; c-basic-offset: 4 -*- */
 
2
%%
 
3
headers
 
4
#include <Python.h>
 
5
 
 
6
#define NO_IMPORT_PYGOBJECT
 
7
#include "pygobject.h"
 
8
 
 
9
#include <evolution.h>
 
10
 
 
11
typedef struct _Search_Handler_User_Data {
 
12
        PyObject *handler;
 
13
        PyObject *args;
 
14
} Search_Handler_User_Data;
 
15
 
 
16
static PyObject *
 
17
hits_as_python_object (GList *hits)
 
18
{
 
19
        PyObject *result;
 
20
        int i;
 
21
 
 
22
        if ((result = PyList_New (g_list_length (hits))) == NULL)
 
23
                return NULL;
 
24
 
 
25
        i = 0;
 
26
        for (; hits != NULL; hits = hits->next) {
 
27
                Hit *hit = (Hit *) hits->data;
 
28
                PyObject *t = PyTuple_New (3);
 
29
                if (hit->text == NULL) {
 
30
                        Py_INCREF (Py_None);
 
31
                        PyTuple_SET_ITEM (t, 0, Py_None);
 
32
                } else {
 
33
                        PyTuple_SET_ITEM (t, 0, PyString_FromString(hit->text));
 
34
                }
 
35
                
 
36
                if (hit->email == NULL) {
 
37
                        Py_INCREF (Py_None);
 
38
                        PyTuple_SET_ITEM (t, 1, Py_None);
 
39
                } else {
 
40
                        PyTuple_SET_ITEM (t, 1, PyString_FromString(hit->email));
 
41
                }
 
42
                
 
43
                if (hit->pixbuf == NULL) {
 
44
                        Py_INCREF (Py_None);
 
45
                        PyTuple_SET_ITEM (t, 2, Py_None);
 
46
                } else {
 
47
                        PyTuple_SET_ITEM (t, 2, pygobject_new ((GObject*) hit->pixbuf));
 
48
                }
 
49
 
 
50
                PyList_SET_ITEM (result, i, t);
 
51
                i++;
 
52
        }
 
53
        return result;
 
54
}
 
55
 
 
56
static void
 
57
handler_c_func (GList *hits, gpointer user_data)
 
58
{
 
59
        int args_length;
 
60
        PyObject *hits_and_args;
 
61
        PyObject *hits_apo;
 
62
        int i;
 
63
        PyGILState_STATE gstate;
 
64
        Search_Handler_User_Data *ud = (Search_Handler_User_Data *) user_data;
 
65
 
 
66
        gstate = PyGILState_Ensure();
 
67
 
 
68
        hits_apo = hits_as_python_object (hits);
 
69
 
 
70
        args_length = PyTuple_Size (ud->args);
 
71
        hits_and_args = PyTuple_New (1 + args_length);
 
72
        PyTuple_SET_ITEM (hits_and_args, 0, hits_apo);
 
73
        g_list_foreach (hits, (GFunc) free_hit, NULL);
 
74
        g_list_free (hits);
 
75
 
 
76
        for (i = 0; i < args_length; i++) {
 
77
                PyObject *element = PyTuple_GET_ITEM (ud->args, i);
 
78
                PyTuple_SET_ITEM (hits_and_args, 1 + i, element);
 
79
        }
 
80
        Py_XDECREF (ud->args);
 
81
 
 
82
        PyObject *result = PyEval_CallObject (ud->handler, hits_and_args);
 
83
        if (result == NULL) {
 
84
                if (PyErr_Occurred ()) {
 
85
                        PyErr_Print ();
 
86
                }
 
87
        } else {
 
88
                Py_DECREF (result);
 
89
        }
 
90
        Py_XDECREF (hits_apo);
 
91
        Py_XDECREF (hits_and_args);
 
92
        Py_XDECREF (ud->handler);
 
93
        g_free (ud);
 
94
        PyGILState_Release(gstate);
 
95
}
 
96
 
 
97
%%
 
98
modulename _evolution
 
99
%%
 
100
%%
 
101
ignore-glob
 
102
        init
 
103
        free_*
 
104
        *_get_type
 
105
%%
 
106
override search_async kwargs 
 
107
static PyObject*
 
108
_wrap_search_async (PyGObject *self, PyObject *args, PyObject *kwargs) 
 
109
{
 
110
        guint len;
 
111
        PyObject *first;
 
112
        char *query = NULL;
 
113
        int max_results;
 
114
        PyObject *handler;
 
115
        PyObject *extra_args;
 
116
        Search_Handler_User_Data *user_data;
 
117
 
 
118
        len = PyTuple_Size (args);
 
119
        if (len < 3) {
 
120
                PyErr_SetString (PyExc_TypeError, "search_async requires at least 3 arguments");
 
121
                return NULL;
 
122
        }
 
123
        first = PySequence_GetSlice (args, 0, 3);
 
124
        if (!PyArg_ParseTuple (first, "Osi:search_async", &handler, &query, &max_results)) {
 
125
                Py_XDECREF (first);
 
126
                return NULL;
 
127
        }
 
128
        Py_XDECREF(first);
 
129
 
 
130
        if (!PyCallable_Check (handler)) {
 
131
                PyErr_SetString (PyExc_TypeError, "search_async: 1st argument must be callable");
 
132
                return NULL;
 
133
        }
 
134
 
 
135
        extra_args = PySequence_GetSlice (args, 1, len);
 
136
        if (extra_args == NULL) {
 
137
                return NULL;
 
138
        }
 
139
        
 
140
        user_data = g_new (Search_Handler_User_Data, 1);
 
141
        user_data->handler = handler;
 
142
        user_data->args = extra_args;
 
143
        Py_XINCREF (handler);
 
144
        Py_XINCREF (extra_args);
 
145
        search_async (query, max_results, &handler_c_func, user_data);
 
146
 
 
147
        Py_INCREF (Py_None);
 
148
        return Py_None;
 
149
}
 
150
%%
 
151
override search_sync kwargs 
 
152
static PyObject*
 
153
_wrap_search_sync (PyGObject *self, PyObject *args, PyObject *kwargs) 
 
154
{
 
155
        char *query;
 
156
        int max_results;
 
157
        GList *hits;
 
158
        PyObject *hits_apo;
 
159
 
 
160
        if (!PyArg_ParseTuple (args, "si:search_sync", &query, &max_results)) {
 
161
                return NULL;
 
162
        }
 
163
 
 
164
        hits = search_sync (query, max_results);
 
165
        hits_apo = hits_as_python_object (hits);
 
166
        g_list_foreach (hits, (GFunc) free_hit, NULL);
 
167
        g_list_free (hits);
 
168
 
 
169
        return hits_apo;
 
170
}