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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* e-table-field-chooser.c
* Copyright (C) 2000 Helix Code, Inc.
* Author: Chris Lahey <clahey@helixcode.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* 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 library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <gnome.h>
#include "e-addressbook-view.h"
#include <gal/e-table/e-table-scrolled.h>
#include <gal/e-table/e-table-model.h>
#include <gal/e-table/e-table-col.h>
#include <gal/e-table/e-table-header.h>
#include <gal/e-table/e-cell-text.h>
#include <gal/widgets/e-scroll-frame.h>
#include <gal/widgets/e-popup-menu.h>
#include "e-addressbook-model.h"
#include "e-minicard-view-widget.h"
#include "e-contact-editor.h"
#include "e-contact-save-as.h"
#include "addressbook/printing/e-contact-print.h"
#include "e-card-simple.h"
#include "e-card.h"
#include "e-book.h"
#include "glade/glade-xml.h"
#include <libgnomeprint/gnome-print.h>
#include <libgnomeprint/gnome-print-dialog.h>
#include <libgnomeprint/gnome-print-master.h>
#include <libgnomeprint/gnome-print-master-preview.h>
static void e_addressbook_view_init (EAddressbookView *card);
static void e_addressbook_view_class_init (EAddressbookViewClass *klass);
static void e_addressbook_view_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
static void e_addressbook_view_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
static void e_addressbook_view_destroy (GtkObject *object);
static void change_view_type (EAddressbookView *view, EAddressbookViewType view_type);
static GtkTableClass *parent_class = NULL;
/* The arguments we take */
enum {
ARG_0,
ARG_BOOK,
ARG_QUERY,
ARG_TYPE,
};
GtkType
e_addressbook_view_get_type (void)
{
static GtkType type = 0;
if (!type) {
static const GtkTypeInfo info =
{
"EAddressbookView",
sizeof (EAddressbookView),
sizeof (EAddressbookViewClass),
(GtkClassInitFunc) e_addressbook_view_class_init,
(GtkObjectInitFunc) e_addressbook_view_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
type = gtk_type_unique (gtk_table_get_type (), &info);
}
return type;
}
static void
e_addressbook_view_class_init (EAddressbookViewClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS(klass);
parent_class = gtk_type_class (gtk_table_get_type ());
object_class->set_arg = e_addressbook_view_set_arg;
object_class->get_arg = e_addressbook_view_get_arg;
object_class->destroy = e_addressbook_view_destroy;
gtk_object_add_arg_type ("EAddressbookView::book", GTK_TYPE_OBJECT,
GTK_ARG_READWRITE, ARG_BOOK);
gtk_object_add_arg_type ("EAddressbookView::query", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_QUERY);
gtk_object_add_arg_type ("EAddressbookView::type", GTK_TYPE_ENUM,
GTK_ARG_READWRITE, ARG_TYPE);
}
static void
e_addressbook_view_init (EAddressbookView *eav)
{
eav->view_type = E_ADDRESSBOOK_VIEW_NONE;
eav->book = NULL;
eav->query = g_strdup("(contains \"x-evolution-any-field\" \"\")");
eav->object = NULL;
eav->widget = NULL;
}
static void
e_addressbook_view_destroy (GtkObject *object)
{
EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object);
if (eav->book)
gtk_object_unref(GTK_OBJECT(eav->book));
g_free(eav->query);
if (GTK_OBJECT_CLASS(parent_class)->destroy)
GTK_OBJECT_CLASS(parent_class)->destroy(object);
}
GtkWidget*
e_addressbook_view_new (void)
{
GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_addressbook_view_get_type ()));
return widget;
}
static void
e_addressbook_view_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object);
switch (arg_id){
case ARG_BOOK:
if (eav->book)
gtk_object_unref(GTK_OBJECT(eav->book));
if (GTK_VALUE_OBJECT(*arg)) {
eav->book = E_BOOK(GTK_VALUE_OBJECT(*arg));
gtk_object_ref(GTK_OBJECT(eav->book));
}
else
eav->book = NULL;
if (eav->object)
gtk_object_set(GTK_OBJECT(eav->object),
"book", eav->book,
NULL);
break;
case ARG_QUERY:
g_free(eav->query);
eav->query = g_strdup(GTK_VALUE_STRING(*arg));
if (!eav->query)
eav->query = g_strdup("(contains \"x-evolution-any-field\" \"\")");
if (eav->object)
gtk_object_set(GTK_OBJECT(eav->object),
"query", eav->query,
NULL);
break;
case ARG_TYPE:
change_view_type(eav, GTK_VALUE_ENUM(*arg));
break;
default:
break;
}
}
static void
e_addressbook_view_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object);
switch (arg_id) {
case ARG_BOOK:
if (eav->book)
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(eav->book);
else
GTK_VALUE_OBJECT (*arg) = NULL;
break;
case ARG_QUERY:
GTK_VALUE_STRING (*arg) = eav->query;
break;
case ARG_TYPE:
GTK_VALUE_ENUM (*arg) = eav->view_type;
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
typedef struct {
EAddressbookView *view;
char letter;
} LetterClosure;
static void
jump_to_letter(GtkWidget *button, LetterClosure *closure)
{
if (closure->view->widget && E_IS_MINICARD_VIEW_WIDGET(closure->view->widget))
e_minicard_view_widget_jump_to_letter(E_MINICARD_VIEW_WIDGET(closure->view->widget), closure->letter);
}
static void
free_closure(GtkWidget *button, LetterClosure *closure)
{
g_free(closure);
}
static void
connect_button (EAddressbookView *view, GladeXML *gui, char letter)
{
char *name;
GtkWidget *button;
LetterClosure *closure;
name = g_strdup_printf("button-%c", letter);
button = glade_xml_get_widget(gui, name);
g_free(name);
if (!button)
return;
closure = g_new(LetterClosure, 1);
closure->view = view;
closure->letter = letter;
gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(jump_to_letter), closure);
gtk_signal_connect(GTK_OBJECT(button), "destroy",
GTK_SIGNAL_FUNC(free_closure), closure);
}
static GtkWidget *
create_alphabet (EAddressbookView *view)
{
GtkWidget *widget;
char letter;
GladeXML *gui = glade_xml_new (EVOLUTION_GLADEDIR "/alphabet.glade", NULL);
widget = glade_xml_get_widget(gui, "scrolledwindow-top");
if (!widget) {
return NULL;
}
connect_button(view, gui, '1');
for (letter = 'a'; letter <= 'z'; letter ++) {
connect_button(view, gui, letter);
}
gtk_object_unref(GTK_OBJECT(gui));
return widget;
}
static void
create_minicard_view (EAddressbookView *view)
{
GtkWidget *scrollframe;
GtkWidget *alphabet;
GtkWidget *minicard_view;
GtkWidget *minicard_hbox;
gtk_widget_push_visual (gdk_rgb_get_visual ());
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
minicard_hbox = gtk_hbox_new(FALSE, 0);
minicard_view = e_minicard_view_widget_new();
view->object = GTK_OBJECT(minicard_view);
view->widget = minicard_hbox;
scrollframe = e_scroll_frame_new (NULL, NULL);
e_scroll_frame_set_policy (E_SCROLL_FRAME (scrollframe),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrollframe), minicard_view);
gtk_box_pack_start(GTK_BOX(minicard_hbox), scrollframe, TRUE, TRUE, 0);
alphabet = create_alphabet(view);
if (alphabet) {
gtk_object_ref(GTK_OBJECT(alphabet));
gtk_widget_unparent(alphabet);
gtk_box_pack_start(GTK_BOX(minicard_hbox), alphabet, FALSE, FALSE, 0);
gtk_object_unref(GTK_OBJECT(alphabet));
}
gtk_table_attach(GTK_TABLE(view), minicard_hbox,
0, 1,
0, 1,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
0, 0);
gtk_widget_show_all( GTK_WIDGET(minicard_hbox) );
gtk_widget_pop_visual ();
gtk_widget_pop_colormap ();
}
static void
card_added_cb (EBook* book, EBookStatus status, const char *id,
gpointer user_data)
{
g_print ("%s: %s(): a card was added\n", __FILE__, __FUNCTION__);
}
static void
card_modified_cb (EBook* book, EBookStatus status,
gpointer user_data)
{
g_print ("%s: %s(): a card was modified\n", __FILE__, __FUNCTION__);
}
/* Callback for the add_card signal from the contact editor */
static void
add_card_cb (EContactEditor *ce, ECard *card, gpointer data)
{
EBook *book;
book = E_BOOK (data);
e_book_add_card (book, card, card_added_cb, NULL);
}
/* Callback for the commit_card signal from the contact editor */
static void
commit_card_cb (EContactEditor *ce, ECard *card, gpointer data)
{
EBook *book;
book = E_BOOK (data);
e_book_commit_card (book, card, card_modified_cb, NULL);
}
/* Callback for the delete_card signal from the contact editor */
static void
delete_card_cb (EContactEditor *ce, ECard *card, gpointer data)
{
EBook *book;
book = E_BOOK (data);
e_book_remove_card (book, card, card_modified_cb, NULL);
}
/* Callback used when the contact editor is closed */
static void
editor_closed_cb (EContactEditor *ce, gpointer data)
{
gtk_object_unref (GTK_OBJECT (ce));
}
static void
table_double_click(ETableScrolled *table, gint row, EAddressbookView *view)
{
if (E_IS_ADDRESSBOOK_MODEL(view->object)) {
EAddressbookModel *model = E_ADDRESSBOOK_MODEL(view->object);
ECard *card = e_addressbook_model_get_card(model, row);
EBook *book;
EContactEditor *ce;
gtk_object_get(GTK_OBJECT(model),
"book", &book,
NULL);
g_assert (E_IS_BOOK (book));
ce = e_contact_editor_new (card, FALSE);
gtk_signal_connect (GTK_OBJECT (ce), "add_card",
GTK_SIGNAL_FUNC (add_card_cb), book);
gtk_signal_connect (GTK_OBJECT (ce), "commit_card",
GTK_SIGNAL_FUNC (commit_card_cb), book);
gtk_signal_connect (GTK_OBJECT (ce), "delete_card",
GTK_SIGNAL_FUNC (delete_card_cb), book);
gtk_signal_connect (GTK_OBJECT (ce), "editor_closed",
GTK_SIGNAL_FUNC (editor_closed_cb), NULL);
gtk_object_unref(GTK_OBJECT(card));
}
}
typedef struct {
EBook *book;
ECard *card;
GtkWidget *widget;
} CardAndBook;
static void
card_and_book_free (CardAndBook *card_and_book)
{
gtk_object_unref(GTK_OBJECT(card_and_book->card));
gtk_object_unref(GTK_OBJECT(card_and_book->book));
}
static void
save_as (GtkWidget *widget, CardAndBook *card_and_book)
{
e_contact_save_as(_("Save as VCard"), card_and_book->card);
card_and_book_free(card_and_book);
}
static void
print (GtkWidget *widget, CardAndBook *card_and_book)
{
gtk_widget_show(e_contact_print_card_dialog_new(card_and_book->card));
card_and_book_free(card_and_book);
}
static void
delete (GtkWidget *widget, CardAndBook *card_and_book)
{
if (e_contact_editor_confirm_delete(GTK_WINDOW(gtk_widget_get_toplevel(card_and_book->widget)))) {
/* Add the card in the contact editor to our ebook */
e_book_remove_card (card_and_book->book,
card_and_book->card,
NULL,
NULL);
}
card_and_book_free(card_and_book);
}
static gint
table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EAddressbookView *view)
{
if (E_IS_ADDRESSBOOK_MODEL(view->object)) {
EAddressbookModel *model = E_ADDRESSBOOK_MODEL(view->object);
CardAndBook *card_and_book;
EPopupMenu menu[] = {
{"Save as VCard", NULL, GTK_SIGNAL_FUNC(save_as), 0},
{"Print", NULL, GTK_SIGNAL_FUNC(print), 0},
{"Delete", NULL, GTK_SIGNAL_FUNC(delete), 0},
{NULL, NULL, NULL, 0}
};
card_and_book = g_new(CardAndBook, 1);
card_and_book->card = e_addressbook_model_get_card(model, row);
card_and_book->widget = GTK_WIDGET(table);
gtk_object_get(GTK_OBJECT(model),
"book", &(card_and_book->book),
NULL);
gtk_object_ref(GTK_OBJECT(card_and_book->book));
e_popup_menu_run (menu, (GdkEventButton *)event, 0, 0, card_and_book);
return TRUE;
} else
return FALSE;
}
#define SPEC "<?xml version=\"1.0\"?> \
<ETableSpecification click-to-add=\"1\"> \
<columns-shown> \
<column>0</column> \
<column>1</column> \
<column>5</column> \
<column>3</column> \
<column>4</column> \
</columns-shown> \
<grouping> \
<leaf column=\"0\" ascending=\"1\"/> \
</grouping> \
</ETableSpecification>"
static void
create_table_view (EAddressbookView *view)
{
ECell *cell_left_just;
ETableHeader *e_table_header;
int i;
ETableModel *model;
ECardSimple *simple;
GtkWidget *table;
simple = e_card_simple_new(NULL);
model = e_addressbook_model_new();
/*
Next we create a header. The ETableHeader is used in two
different way. The first is the full_header. This is the
list of possible columns in the view. The second use is
completely internal. Many of the ETableHeader functions are
for that purpose. The only functions we really need are
e_table_header_new and e_table_header_add_col.
First we create the header. */
e_table_header = e_table_header_new ();
/* Next we have to build renderers for all of the columns.
Since all our columns are text columns, we can simply use
the same renderer over and over again. If we had different
types of columns, we could use a different renderer for
each column. */
cell_left_just = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT);
/* Next we create a column object for each view column and add
them to the header. We don't create a column object for
the importance column since it will not be shown. */
for (i = 0; i < E_CARD_SIMPLE_FIELD_LAST - 1; i++){
/* Create the column. */
ETableCol *ecol = e_table_col_new (
i, e_card_simple_get_name(simple, i+1),
1.0, 20, cell_left_just,
g_str_compare, TRUE);
/* Add it to the header. */
e_table_header_add_column (e_table_header, ecol, i);
}
/* Here we create the table. We give it the three pieces of
the table we've created, the header, the model, and the
initial layout. It does the rest. */
table = e_table_scrolled_new (e_table_header, model, SPEC);
view->object = GTK_OBJECT(model);
view->widget = table;
gtk_signal_connect(GTK_OBJECT(table), "double_click",
GTK_SIGNAL_FUNC(table_double_click), view);
gtk_signal_connect(GTK_OBJECT(table), "right_click",
GTK_SIGNAL_FUNC(table_right_click), view);
gtk_object_set (GTK_OBJECT(table),
"click_to_add_message", _("* Click here to add a contact *"),
"drawgrid", TRUE,
NULL);
gtk_table_attach(GTK_TABLE(view), table,
0, 1,
0, 1,
GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
0, 0);
gtk_widget_show( GTK_WIDGET(table) );
gtk_object_unref(GTK_OBJECT(simple));
}
static void
change_view_type (EAddressbookView *view, EAddressbookViewType view_type)
{
if (view_type == view->view_type)
return;
if (view->widget) {
gtk_widget_destroy (view->widget);
view->widget = NULL;
}
view->object = NULL;
switch (view_type) {
case E_ADDRESSBOOK_VIEW_MINICARD:
create_minicard_view (view);
break;
case E_ADDRESSBOOK_VIEW_TABLE:
create_table_view (view);
break;
default:
g_warning ("view_type must be either TABLE or MINICARD\n");
return;
}
view->view_type = view_type;
gtk_object_set(view->object,
"query", view->query,
"book", view->book,
NULL);
}
static void
e_contact_print_destroy(GnomeDialog *dialog, gpointer data)
{
ETableScrolled *table = gtk_object_get_data(GTK_OBJECT(dialog), "table");
EPrintable *printable = gtk_object_get_data(GTK_OBJECT(dialog), "printable");
gtk_object_unref(GTK_OBJECT(printable));
gtk_object_unref(GTK_OBJECT(table));
}
static void
e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data)
{
GnomePrintMaster *master;
GnomePrintContext *pc;
EPrintable *printable = gtk_object_get_data(GTK_OBJECT(dialog), "printable");
GtkWidget *preview;
switch( button ) {
case GNOME_PRINT_PRINT:
master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) );
pc = gnome_print_master_get_context( master );
e_printable_reset(printable);
while (e_printable_data_left(printable)) {
if (gnome_print_gsave(pc) == -1)
/* FIXME */;
if (gnome_print_translate(pc, 72, 72) == -1)
/* FIXME */;
e_printable_print_page(printable,
pc,
6.5 * 72,
5 * 72,
TRUE);
if (gnome_print_grestore(pc) == -1)
/* FIXME */;
if (gnome_print_showpage(pc) == -1)
/* FIXME */;
}
gnome_print_master_close(master);
gnome_print_master_print(master);
gtk_object_unref(GTK_OBJECT(master));
gnome_dialog_close(dialog);
break;
case GNOME_PRINT_PREVIEW:
master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) );
pc = gnome_print_master_get_context( master );
e_printable_reset(printable);
while (e_printable_data_left(printable)) {
if (gnome_print_gsave(pc) == -1)
/* FIXME */;
if (gnome_print_translate(pc, 72, 72) == -1)
/* FIXME */;
e_printable_print_page(printable,
pc,
6.5 * 72,
9 * 72,
TRUE);
if (gnome_print_grestore(pc) == -1)
/* FIXME */;
if (gnome_print_showpage(pc) == -1)
/* FIXME */;
}
gnome_print_master_close(master);
preview = GTK_WIDGET(gnome_print_master_preview_new(master, "Print Preview"));
gtk_widget_show_all(preview);
gtk_object_unref(GTK_OBJECT(master));
break;
case GNOME_PRINT_CANCEL:
gnome_dialog_close(dialog);
break;
}
}
void
e_addressbook_view_print(EAddressbookView *view)
{
if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD) {
char *query;
EBook *book;
GtkWidget *print;
gtk_object_get (view->object,
"query", &query,
"book", &book,
NULL);
print = e_contact_print_dialog_new(book, query);
g_free(query);
gtk_widget_show_all(print);
} else if (view->view_type == E_ADDRESSBOOK_VIEW_TABLE) {
GtkWidget *dialog;
EPrintable *printable;
dialog = gnome_print_dialog_new("Print cards", GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES);
gnome_print_dialog_construct_range_any(GNOME_PRINT_DIALOG(dialog), GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_SELECTION,
NULL, NULL, NULL);
printable = e_table_scrolled_get_printable(E_TABLE_SCROLLED(view->widget));
gtk_object_ref(GTK_OBJECT(view->widget));
gtk_object_set_data(GTK_OBJECT(dialog), "table", view->widget);
gtk_object_set_data(GTK_OBJECT(dialog), "printable", printable);
gtk_signal_connect(GTK_OBJECT(dialog),
"clicked", GTK_SIGNAL_FUNC(e_contact_print_button), NULL);
gtk_signal_connect(GTK_OBJECT(dialog),
"destroy", GTK_SIGNAL_FUNC(e_contact_print_destroy), NULL);
gtk_widget_show(dialog);
}
}
static void
card_deleted_cb (EBook* book, EBookStatus status, gpointer user_data)
{
g_print ("%s: %s(): a card was deleted\n", __FILE__, __FUNCTION__);
}
void
e_addressbook_view_delete_selection(EAddressbookView *view)
{
if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD)
e_minicard_view_widget_remove_selection (E_MINICARD_VIEW_WIDGET(view->object), card_deleted_cb, NULL);
}
|